Files
fedora-infra_ansible/roles/abrt/faf/tasks/first_time_setup.yml
2020-04-24 21:34:14 +02:00

28 lines
681 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"
check_mode: no
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