From 463dfdf7328d0d7720bf2fc50aa937abc8073992 Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Wed, 24 Apr 2024 14:44:00 +1200 Subject: [PATCH] =?UTF-8?q?fix:=20Don't=20try=20add=20network=20config=20n?= =?UTF-8?q?o=20RHEL=20=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/networking.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tasks/networking.yml b/tasks/networking.yml index 7f34a64..63ff30f 100644 --- a/tasks/networking.yml +++ b/tasks/networking.yml @@ -3,7 +3,7 @@ debug: msg: "Virtualization is: {{ ansible_virtualization_type }}" -- name: Ensure DNS and SSH common config +- name: Ensure Network Setup (RedHat only) template: src: "{{ network_config.src }}" dest: "{{ network_config.dest }}" @@ -16,8 +16,25 @@ mode: u+rw, a+r, } + when: > + ansible_virtualization_type != "docker" + and ansible_virtualization_type != "container" + and ansible_os_family == "RedHat" + loop_control: + loop_var: network_config + tags: dns + +- name: Ensure Resolvers Configured + template: + src: "{{ network_config.src }}" + dest: "{{ network_config.dest }}" + mode: "{{ network_config.mode }}" + backup: yes + with_items: - { src: etc.resolv.conf.j2, dest: /etc/resolv.conf, mode: u+rw, a+r } - when: ansible_virtualization_type != "docker" and ansible_virtualization_type != "container" + when: > + ansible_virtualization_type != "docker" + and ansible_virtualization_type != "container" loop_control: loop_var: network_config tags: dns