kolla-ansible/ansible/roles/prechecks/tasks/service_checks.yml
Vikram Hosakote 8595707a25 Check empty passwords in $CONFIG_DIR/passwords.yml
Co-Authored-By: Carlos Cesario <carloscesario@gmail.com>

Change-Id: Ic2ea835cf38be64a590d3f6b022683081aeb363b
Closes-Bug: #1566150
2016-04-05 04:48:35 +00:00

43 lines
1.8 KiB
YAML

---
- name: Checking that libvirt is not running
stat: path=/var/run/libvirt/libvirt-sock
register: result
failed_when: result.stat.exists
when: inventory_hostname in groups['compute']
- name: Checking Docker version
command: docker version
register: result
changed_when: false
failed_when: result | failed
or (result.stdout | from_yaml).Server.Version | regex_replace('(\\d+\\.\\d+\\.\\d+).*', '\\1') | version_compare(docker_version_min, '<')
- name: Checking if 'MountFlags' in /lib/systemd/system/docker.service is set to 'shared'
command: cat /lib/systemd/system/docker.service
register: result
changed_when: false
failed_when: result.stdout.find('MountFlags=shared') == -1
when:
- (inventory_hostname in groups['neutron-dhcp-agent']
or inventory_hostname in groups['neutron-l3-agent']
or inventory_hostname in groups['neutron-metadata-agent'])
- ansible_os_family == 'RedHat'
or (ansible_distribution == 'Ubuntu' and ansible_distribution_version > '14.04')
- name: Checking if '/run' mount flag is set to 'shared'
command: awk '$5 == "/run" {print $7}' /proc/self/mountinfo
register: result
changed_when: false
failed_when: result.stdout.find('shared') == -1
when:
- (inventory_hostname in groups['neutron-dhcp-agent']
or inventory_hostname in groups['neutron-l3-agent']
or inventory_hostname in groups['neutron-metadata-agent'])
- ansible_distribution == 'Ubuntu' and ansible_distribution_version == '14.04'
- name: Checking empty passwords in passwords.yml. Run kolla-genpwd if this task fails
local_action: command grep '^[^#].*:\s*$' "{{ CONFIG_DIR }}/passwords.yml"
register: result
changed_when: false
failed_when: result.stdout | regex_replace('(.*nova_ssh_key.*)', '') | search(":")