Files
fedora-infra_ansible/roles/abrt/faf/tasks/first_time_setup.yml
Ryan Lerch 3c41882bb0 ansiblelint fixes - fqcn[action-core] - shell to ansible.builtin.shell
Replaces references to shell: with ansible.builtin.shell

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-15 11:29:10 +10:00

28 lines
745 B
YAML

---
- name: Check for count of faf tables
ansible.builtin.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
ansible.builtin.command: faf-migrate-db --create-all
become: yes
become_user: faf
- name: Stamp database as migrated to latest version
ansible.builtin.command: faf-migrate-db --stamp-only
become: yes
become_user: faf
- name: Init faf
ansible.builtin.command: faf init
become: yes
become_user: faf
when: ( count_tables.stdout_lines[2]|int ) == 0