docstranslation: generate ssh key & add missing secrets

This commit is contained in:
Francois Andrieu 2020-10-07 20:47:25 +02:00 committed by kevin
parent 5b9a555fb9
commit 673855471a
2 changed files with 61 additions and 30 deletions

View file

@ -2,41 +2,64 @@
hosts: os_masters[0]:os_masters_stg[0] hosts: os_masters[0]:os_masters_stg[0]
user: root user: root
gather_facts: False gather_facts: False
vars:
app: docstranslation
vars_files: vars_files:
- /srv/web/infra/ansible/vars/global.yml - /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml" - "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
roles: tasks:
- role: openshift/project - import_role:
app: docstranslation name: openshift/project
description: Documentation translation vars:
appowners: description: Documentation translation
- asamalik appowners:
- darknao - asamalik
- jibecfed - darknao
- misc - jibecfed
- misc
tags: tags:
- apply-appowners - apply-appowners
- role: openshift/imagestream - name: Generate ssh keypair, if none exist
app: docstranslation openssh_keypair:
imagename: builder path: "/etc/openshift_apps/{{ app }}/id_rsa_docs_trans"
mode: 0600
regenerate: never
type: rsa
size: 4096
register: r_ssh_key
- role: openshift/object - import_role:
app: docstranslation name: openshift/imagestream
objectname: buildconfig.yml vars:
file: buildconfig.yml imagename: builder
- role: openshift/start-build - import_role:
app: docstranslation name: openshift/object
buildname: docstranslation-build vars:
objectname: buildconfig.yml
file: buildconfig.yml
- role: openshift/object - import_role:
app: docstranslation name: openshift/start-build
file: cron.yml vars:
objectname: cron.yml buildname: docstranslation-build
- import_role:
name: openshift/object
vars:
objectname: secrets.yml
template: secrets.yml
tags:
- deploy-secrets
- import_role:
name: openshift/object
vars:
file: cron.yml
objectname: cron.yml
tags: tags:
- deploy-cronjob - deploy-cronjob
@ -44,8 +67,16 @@
# actions to delete the project from OpenShift # actions to delete the project from OpenShift
############################################### ###############################################
# to run: sudo rbac-playbook -l os_masters_stg[0] -t delete openshift-apps/docstranslation.yml # to run: sudo rbac-playbook -l os_masters_stg[0] -t delete openshift-apps/docstranslation.yml
- role: openshift/object-delete - import_role:
app: docstranslation name: openshift/object-delete
objecttype: cronjob vars:
objectname: cron objecttype: cronjob
tags: [ never, delete ] objectname: cron
tags:
- never
- delete
post_tasks:
- name: Display git ssh key for adding in pagure
debug:
msg: "{{ r_ssh_key.public_key }}"

View file

@ -7,7 +7,7 @@ metadata:
app: docstranslation app: docstranslation
stringData: stringData:
id_rsa_docs_trans: |- id_rsa_docs_trans: |-
{{ lookup('file', {{private}} + '/files/id_rsa_docs_trans') }} {{ lookup('file', '/etc/openshift_apps/{{ app }}/id_rsa_docs_trans') }}
config: |- config: |-
Host pagure.io Host pagure.io
User git User git