From b3deb05555472944f536025ecac38595231f8c17 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Mon, 11 Dec 2023 12:56:20 -0500 Subject: [PATCH] update logic for container checks --- galaxy.yml | 2 +- roles/etc_hosts/tasks/main.yml | 4 +--- roles/resolv_conf/tasks/main.yml | 4 +--- roles/snmpd_conf/handlers/main.yml | 4 +--- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/galaxy.yml b/galaxy.yml index 1dbe642..fe1d270 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -8,7 +8,7 @@ namespace: jchristianh name: baseos # The version of the collection. Must be compatible with semantic versioning -version: 1.0.16 +version: 1.0.17 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md diff --git a/roles/etc_hosts/tasks/main.yml b/roles/etc_hosts/tasks/main.yml index b74f3c2..a6b8e47 100644 --- a/roles/etc_hosts/tasks/main.yml +++ b/roles/etc_hosts/tasks/main.yml @@ -3,9 +3,7 @@ set_fact: __etc_hosts_file: "{{ __etc_hosts_file }}.docker" when: - - ansible_virtualization_type == "docker" or - ansible_virtualization_type == "podman" or - ansible_virtualization_type == "container" + - ansible_virtualization_type | regex_search("docker|podman|container") - name: Deploy {{ __etc_hosts_file }} diff --git a/roles/resolv_conf/tasks/main.yml b/roles/resolv_conf/tasks/main.yml index d210f0c..9b2116b 100644 --- a/roles/resolv_conf/tasks/main.yml +++ b/roles/resolv_conf/tasks/main.yml @@ -3,9 +3,7 @@ ansible.builtin.set_fact: __resolv_conf_file: "{{ __resolv_conf_file_docker }}" when: - - ansible_virtualization_type == "docker" or - ansible_virtualization_type == "podman" or - ansible_virtualization_type == "container" + - ansible_virtualization_type | regex_search("docker|podman|container") - name: Deploy {{ __resolv_conf_file }} diff --git a/roles/snmpd_conf/handlers/main.yml b/roles/snmpd_conf/handlers/main.yml index bb06dac..b56c767 100644 --- a/roles/snmpd_conf/handlers/main.yml +++ b/roles/snmpd_conf/handlers/main.yml @@ -4,6 +4,4 @@ name : snmpd state: restarted when: - - ansible_virtualization_type == "docker" or - ansible_virtualization_type == "podman" or - ansible_virtualization_type == "container" + - ansible_virtualization_type | regex_search("docker|podman|container")