mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-05-03 22:30:27 +08:00
27 lines
664 B
YAML
27 lines
664 B
YAML
---
|
|
|
|
- name: check for count of faf tables
|
|
shell: psql -c "SELECT COUNT(*) FROM pg_stat_user_tables"
|
|
register: count_tables
|
|
changed_when: "( count_tables.stdout_lines[2]|int ) == 0"
|
|
become: yes
|
|
become_user: faf
|
|
|
|
# Skip whole block if faf owns atleast 1 table in db
|
|
- block:
|
|
- name: create faf's database schema
|
|
command: faf-migrate-db --create-all
|
|
become: yes
|
|
become_user: faf
|
|
|
|
- name: stamp database as migrated to latest version
|
|
command: faf-migrate-db --stamp-only
|
|
become: yes
|
|
become_user: faf
|
|
|
|
- name: init faf
|
|
command: faf init
|
|
become: yes
|
|
become_user: faf
|
|
when: ( count_tables.stdout_lines[2]|int ) == 0
|