ansible-role-kojihub/tasks/db.yml

27 lines
821 B
YAML
Raw Normal View History

2020-12-23 03:52:59 +00:00
---
2020-12-23 09:12:56 +00:00
# Note: We do not install postgresql. It's up to you to do so, whether locally or not.
2020-12-23 03:52:59 +00:00
- name: Template for koji admin and kojira
template:
src: koji-pgsql.sql.j2
dest: /var/tmp/koji-pgsql.sql
mode: '0644'
- name: Load schema to postgresql database
community.general.postgresql_db:
name: "{{ koji_db_name }}"
target: /usr/share/doc/koji/docs/schema.sql
owner: "{{ koji_db_user }}"
state: restore
login_host: "{{ koji_db_host }}"
login_user: "{{ koji_db_user }}"
login_password: "{{ koji_db_pass }}"
- name: Apply the postgres template
community.general.postgresql_db:
name: "{{ koji_db_name }}"
target: /var/tmp/koji-pgsql.sql
state: restore
login_host: "{{ koji_db_host }}"
login_user: "{{ koji_db_user }}"
login_password: "{{ koji_db_pass }}"