diff options
| -rw-r--r-- | .ansible-lint | 1 | ||||
| -rw-r--r-- | ansible/roles/nova-cell/tasks/precheck.yml | 3 | ||||
| -rw-r--r-- | ansible/roles/prechecks/tasks/port_checks.yml | 15 |
3 files changed, 11 insertions, 8 deletions
diff --git a/.ansible-lint b/.ansible-lint index 1ec2012fe..9c1597a67 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -31,7 +31,6 @@ skip_list: # role name check matching ^*$ - role-name # TODO(frickler): Discuss these in detail, skipping for now to unblock things - - no-free-form - name[play] - var-naming[no-role-prefix] - risky-file-permissions diff --git a/ansible/roles/nova-cell/tasks/precheck.yml b/ansible/roles/nova-cell/tasks/precheck.yml index b0b510a5b..01dfb3290 100644 --- a/ansible/roles/nova-cell/tasks/precheck.yml +++ b/ansible/roles/nova-cell/tasks/precheck.yml @@ -111,7 +111,8 @@ - name: Checking that host libvirt is not running vars: service: "{{ nova_cell_services['nova-libvirt'] }}" - stat: path=/var/run/libvirt/libvirt-sock + stat: + path: "/var/run/libvirt/libvirt-sock" register: result failed_when: result.stat.exists when: diff --git a/ansible/roles/prechecks/tasks/port_checks.yml b/ansible/roles/prechecks/tasks/port_checks.yml index 576baa6d2..6fdff37a8 100644 --- a/ansible/roles/prechecks/tasks/port_checks.yml +++ b/ansible/roles/prechecks/tasks/port_checks.yml @@ -1,13 +1,16 @@ --- - name: Checking the api_interface is present - fail: "msg='Please check the api_interface property - interface {{ api_interface }} not found'" - when: api_interface not in ansible_facts.interfaces + ansible.builtin.assert: + that: api_interface in ansible_facts.interfaces + fail_msg: "Please check the api_interface property - interface {{ api_interface }} not found" - name: Checking the api_interface is active - fail: "msg='Please check the api_interface settings - interface {{ api_interface }} is not active'" - when: not hostvars[inventory_hostname].ansible_facts[api_interface | replace('-', '_')]['active'] + ansible.builtin.assert: + that: hostvars[inventory_hostname].ansible_facts[api_interface | replace('-', '_')]['active'] + fail_msg: "Please check the api_interface settings - interface {{ api_interface }} is not active" # kolla_address handles relevant address check - name: Checking the api_interface ip address configuration - fail: "msg='Please check the api_interface settings - interface {{ api_interface }} ip address problem'" - when: api_interface_address is not defined + ansible.builtin.assert: + that: api_interface_address is defined + fail_msg: "Please check the api_interface settings - interface {{ api_interface }} ip address problem" |
