Make service_checks easier to run independently of kolla-ansible

Set a default for CONFIG_DIR in service_checks to more easily allow
consumers not using the kolla-ansible tool to run the prechecks.

Change-Id: I78bc5dd6f37e6a60ecc6a86d43e56b05803a4fd5
Closes-Bug: #1629893
This commit is contained in:
Paul Bourke 2016-10-03 15:24:51 +01:00
parent 00c068a173
commit 43517f48f5

View File

@ -38,14 +38,14 @@
- ansible_distribution == 'Ubuntu' and ansible_distribution_version == '14.04' - ansible_distribution == 'Ubuntu' and ansible_distribution_version == '14.04'
- name: Checking empty passwords in passwords.yml. Run kolla-genpwd if this task fails - name: Checking empty passwords in passwords.yml. Run kolla-genpwd if this task fails
local_action: command grep '^[^#].*:\s*$' "{{ CONFIG_DIR }}/passwords.yml" local_action: command grep '^[^#].*:\s*$' "{{ CONFIG_DIR | default('/etc/kolla') }}/passwords.yml"
register: result register: result
changed_when: false changed_when: false
failed_when: result.stdout | regex_replace('(.*ssh_key.*)', '') | search(":") failed_when: result.stdout | regex_replace('(.*ssh_key.*)', '') | search(":")
- name: Checking fernet_token_expiry in globals.yml. Update fernet_token_expiry to allowed value if this task fails - name: Checking fernet_token_expiry in globals.yml. Update fernet_token_expiry to allowed value if this task fails
run_once: true run_once: true
local_action: command awk '/^fernet_token_expiry/ { print $2 }' "{{ CONFIG_DIR }}/globals.yml" local_action: command awk '/^fernet_token_expiry/ { print $2 }' "{{ CONFIG_DIR | default('/etc/kolla') }}/globals.yml"
register: result register: result
changed_when: false changed_when: false
failed_when: result.stdout | regex_replace('(60|120|180|240|300|360|600|720|900|1200|1800|3600|7200|10800|14400|21600|28800|43200|86400|604800)', '') | search(".+") failed_when: result.stdout | regex_replace('(60|120|180|240|300|360|600|720|900|1200|1800|3600|7200|10800|14400|21600|28800|43200|86400|604800)', '') | search(".+")