diff --git a/roles/linux/dashboards/tasks/main.yml b/roles/linux/dashboards/tasks/main.yml index 57de979..bb58d0f 100644 --- a/roles/linux/dashboards/tasks/main.yml +++ b/roles/linux/dashboards/tasks/main.yml @@ -8,6 +8,8 @@ selinux: state: disabled when: (ansible_distribution != "Ubuntu") and (ansible_distribution != "Amazon") + register: result + failed_when: result.msg | default('ok', True) is not search('(^ok$|libselinux-python|Unable to find file /etc/selinux/config|(SELinux state changed))') - name: Populate the nodes to /etc/hosts import_tasks: etchosts.yml diff --git a/roles/linux/opensearch/tasks/main.yml b/roles/linux/opensearch/tasks/main.yml index 3fe556e..8b4d292 100644 --- a/roles/linux/opensearch/tasks/main.yml +++ b/roles/linux/opensearch/tasks/main.yml @@ -8,6 +8,8 @@ selinux: state: disabled when: (ansible_distribution != "Ubuntu") and (ansible_distribution != "Amazon") + register: result + failed_when: result.msg | default('ok', True) is not search('(^ok$|libselinux-python|Unable to find file /etc/selinux/config|(SELinux state changed))') - name: Populate the nodes to /etc/hosts import_tasks: etchosts.yml