fix: Don't try add network config no RHEL 🐛
Some checks failed
CI / lint (push) Failing after 1m6s
CI / Molecule Test (almalinux8) (push) Has been skipped
CI / Molecule Test (almalinux9) (push) Has been skipped
CI / release (push) Has been skipped

This commit is contained in:
2024-04-24 14:44:00 +12:00
parent 517ac07529
commit 463dfdf732

View File

@@ -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