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