Include MAC-Address into the NetworkManager keyfile

This commit is contained in:
Sandwich 2024-10-31 00:13:23 +01:00
parent ec55701f00
commit af82baf1d8
3 changed files with 10 additions and 2 deletions

View File

@ -179,6 +179,7 @@ rhel8:
- open-vm-tools
- shim
- telnet
- vim
- zstd
rhel9:
@ -193,6 +194,7 @@ rhel9:
- open-vm-tools
- shim
- telnet
- vim
- zstd
rocky:

View File

@ -204,6 +204,11 @@
changed_when: net_inf.rc == 0
register: net_inf
- name: Register MAC Address of the Network Interface
ansible.builtin.shell: ip link show "{{ net_inf.stdout }}" | awk '/link\/ether/ {print $2}' | tr '[:lower:]' '[:upper:]'
register: net_mac
changed_when: net_mac.rc == 0
- name: Copy NetworkManager keyfile
ansible.builtin.template:
src: network.j2

View File

@ -5,6 +5,7 @@ type=ethernet
interface-name={{ net_inf.stdout }}
[ethernet]
mac-address={{ net_mac.stdout }}
[ipv4]
address={{ vm_ip }},{{ vm_gw }}
@ -12,7 +13,7 @@ dns={{ vm_dns }}
method=manual
[ipv6]
addr-gen-mode=default
addr-gen-mode=stable-privacy
method=disabled
[proxy]
[proxy]