|
|
@ -42,14 +42,28 @@
|
|
|
|
register: koji_database_initialized
|
|
|
|
register: koji_database_initialized
|
|
|
|
changed_when: "koji_database_initialized.failed"
|
|
|
|
changed_when: "koji_database_initialized.failed"
|
|
|
|
|
|
|
|
|
|
|
|
- name: Initialize Koji database
|
|
|
|
- name: Check if /usr/share/doc/koji/docs/schema.sql file exists
|
|
|
|
|
|
|
|
ansible.builtin.stat:
|
|
|
|
|
|
|
|
path: /usr/share/doc/koji/docs/schema.sql
|
|
|
|
|
|
|
|
register: koji_docs_schema_result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Initialize Koji database from /usr/share/doc/koji/docs/schema.sql
|
|
|
|
community.postgresql.postgresql_query:
|
|
|
|
community.postgresql.postgresql_query:
|
|
|
|
db: "{{ koji_db_name }}"
|
|
|
|
db: "{{ koji_db_name }}"
|
|
|
|
login_user: "{{ koji_db_user }}"
|
|
|
|
login_user: "{{ koji_db_user }}"
|
|
|
|
login_password: "{{ koji_db_password }}"
|
|
|
|
login_password: "{{ koji_db_password }}"
|
|
|
|
login_host: "{{ koji_db_server_ip }}"
|
|
|
|
login_host: "{{ koji_db_server_ip }}"
|
|
|
|
path_to_script: /usr/share/doc/koji/docs/schema.sql
|
|
|
|
path_to_script: /usr/share/doc/koji/docs/schema.sql
|
|
|
|
when: koji_database_initialized.failed
|
|
|
|
when: koji_database_initialized.failed and koji_docs_schema_result.stat.exists
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Initialize Koji database from /usr/share/koji/schema.sql
|
|
|
|
|
|
|
|
community.postgresql.postgresql_query:
|
|
|
|
|
|
|
|
db: "{{ koji_db_name }}"
|
|
|
|
|
|
|
|
login_user: "{{ koji_db_user }}"
|
|
|
|
|
|
|
|
login_password: "{{ koji_db_password }}"
|
|
|
|
|
|
|
|
login_host: "{{ koji_db_server_ip }}"
|
|
|
|
|
|
|
|
path_to_script: /usr/share/koji/schema.sql
|
|
|
|
|
|
|
|
when: koji_database_initialized.failed and not koji_docs_schema_result.stat.exists
|
|
|
|
|
|
|
|
|
|
|
|
- name: Check if Koji admin DB user exists
|
|
|
|
- name: Check if Koji admin DB user exists
|
|
|
|
community.postgresql.postgresql_query:
|
|
|
|
community.postgresql.postgresql_query:
|
|
|
|