From 9ef2e40d31d85110d74c45ee80108bbbe6aeb2ba Mon Sep 17 00:00:00 2001 From: FrantiĊĦek Zatloukal Date: Jan 25 2021 09:30:26 +0000 Subject: oraculum: Move playbook to oraculum.yml --- diff --git a/playbooks/openshift-apps/oraculum.yml b/playbooks/openshift-apps/oraculum.yml new file mode 100644 index 0000000..93706d7 --- /dev/null +++ b/playbooks/openshift-apps/oraculum.yml @@ -0,0 +1,93 @@ +- name: prepare setting up the database + hosts: db01.stg.iad2.fedoraproject.org + gather_facts: no + user: root + + tasks: + - name: install psycopg2 for the postgresql ansible modules + package: name=python3-psycopg2 state=present + tags: + - packages + +- name: setup the database + hosts: db01.stg.iad2.fedoraproject.org + gather_facts: no + become: yes + become_user: postgres + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "/srv/private/ansible/vars.yml" + - "/srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml" + + tasks: + - name: Create the database user + postgresql_user: + name: "{{ oraculum_db_user }}" + password: "{{ oraculum_db_pass }}" + - name: Create the database itself + postgresql_db: + name: "{{ oraculum_db_name }}" + owner: "{{ oraculum_db_user }}" + encoding: UTF-8 + - name: Test the database creation + postgresql_db: + name: "{{ oraculum_db_name }}" + owner: "{{ oraculum_db_user }}" + encoding: UTF-8 + +- name: make the app be real + hosts: os_masters_stg[0] + user: root + gather_facts: False + + vars_files: + - /srv/web/infra/ansible/vars/global.yml + - "/srv/private/ansible/vars.yml" + - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml + + roles: + - role: openshift/project + app: oraculum + description: Packager Dashboard + appowners: + - frantisekz + - pingou + tags: + - appowners + + - role: openshift/object + app: oraculum + template: buildconfig.yml + objectname: buildconfig.yml + + - role: openshift/object + app: oraculum + template: deploymentconfig.yml + objectname: deploymentconfig.yml + + - role: openshift/object + app: oraculum + template: imagestream.yml + objectname: imagestream.yml + + - role: openshift/object + app: oraculum + file: service.yml + objectname: service.yml + + - role: openshift/object + app: oraculum + template: secret.yml + objectname: secret.yml + + - role: openshift/route + app: oraculum + routename: packager-dashboard + host: "packager-dashboard{{ env_suffix }}.fedoraproject.org" + serviceport: 5000-tcp + servicename: oraculum-api-endpoint + + - role: openshift/start-build + app: oraculum + buildname: packager-dashboard-build + objectname: packager-dashboard-build diff --git a/playbooks/openshift-apps/packager-dashboard.yml b/playbooks/openshift-apps/packager-dashboard.yml deleted file mode 100644 index 93706d7..0000000 --- a/playbooks/openshift-apps/packager-dashboard.yml +++ /dev/null @@ -1,93 +0,0 @@ -- name: prepare setting up the database - hosts: db01.stg.iad2.fedoraproject.org - gather_facts: no - user: root - - tasks: - - name: install psycopg2 for the postgresql ansible modules - package: name=python3-psycopg2 state=present - tags: - - packages - -- name: setup the database - hosts: db01.stg.iad2.fedoraproject.org - gather_facts: no - become: yes - become_user: postgres - vars_files: - - /srv/web/infra/ansible/vars/global.yml - - "/srv/private/ansible/vars.yml" - - "/srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml" - - tasks: - - name: Create the database user - postgresql_user: - name: "{{ oraculum_db_user }}" - password: "{{ oraculum_db_pass }}" - - name: Create the database itself - postgresql_db: - name: "{{ oraculum_db_name }}" - owner: "{{ oraculum_db_user }}" - encoding: UTF-8 - - name: Test the database creation - postgresql_db: - name: "{{ oraculum_db_name }}" - owner: "{{ oraculum_db_user }}" - encoding: UTF-8 - -- name: make the app be real - hosts: os_masters_stg[0] - user: root - gather_facts: False - - vars_files: - - /srv/web/infra/ansible/vars/global.yml - - "/srv/private/ansible/vars.yml" - - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml - - roles: - - role: openshift/project - app: oraculum - description: Packager Dashboard - appowners: - - frantisekz - - pingou - tags: - - appowners - - - role: openshift/object - app: oraculum - template: buildconfig.yml - objectname: buildconfig.yml - - - role: openshift/object - app: oraculum - template: deploymentconfig.yml - objectname: deploymentconfig.yml - - - role: openshift/object - app: oraculum - template: imagestream.yml - objectname: imagestream.yml - - - role: openshift/object - app: oraculum - file: service.yml - objectname: service.yml - - - role: openshift/object - app: oraculum - template: secret.yml - objectname: secret.yml - - - role: openshift/route - app: oraculum - routename: packager-dashboard - host: "packager-dashboard{{ env_suffix }}.fedoraproject.org" - serviceport: 5000-tcp - servicename: oraculum-api-endpoint - - - role: openshift/start-build - app: oraculum - buildname: packager-dashboard-build - objectname: packager-dashboard-build