retrace: update faf role

This commit is contained in:
Miroslav Suchý 2017-04-06 15:50:01 +02:00
parent 47a2d4d557
commit 73726c7602
4 changed files with 22 additions and 17 deletions

View file

@ -13,10 +13,6 @@ memcached_port: 11211
# driver://user:password@host:port/database
faf_db_connectstring: postgresql:///faf
# set to true if this is the very first run of this playbook
# it will set-up postgresql database and initial data for faf
faf_first_time_setup: false
# dangerous, delete and re-create PostgreSQL database
# (will wipe Postgre's data dir and re-create from scratch)
faf_recreate_database: false
@ -119,7 +115,6 @@ faf_problem_packages:
faf_opsys_packages:
- faf-opsys-centos
- faf-opsys-fedora
# - faf-opsys-rhel
faf_action_packages:
- faf-action-add-compat-hashes
@ -130,6 +125,7 @@ faf_action_packages:
- faf-action-c2p
- faf-action-cleanup-task-results
- faf-action-create-problems
- faf-action-delete-invalid-ureports
- faf-action-external-faf
- faf-action-external-faf-clone-bz
- faf-action-find-components

View file

@ -1 +1 @@
{install_date: 'Thu Mar 23 14:13:24 2017', version: ''}
{install_date: 'Thu Apr 6 13:39:53 2017', version: ''}

View file

@ -1,16 +1,26 @@
---
- name: create faf's database schema
command: faf-migrate-db --create-all
- 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
- name: stamp database as migrated to latest version
command: faf-migrate-db --stamp-only
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: init faf
command: faf init
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

View file

@ -6,7 +6,6 @@
tags: [faf, faf_update, packages]
- include: first_time_setup.yml
when: faf_first_time_setup
tags: [faf, faf_fist_time_setup, config]
- include: config.yml