Common: Network setup
This commit is contained in:
parent
f746583d52
commit
550a50326a
@ -48,6 +48,25 @@
|
||||
state: absent
|
||||
path: /etc/ssh/ssh_config.d/40-ssh-key-dir.conf
|
||||
|
||||
- name: Setup Networks
|
||||
hosts: network_config
|
||||
become: true
|
||||
become_user: root
|
||||
tasks:
|
||||
- name: Setup wired interface
|
||||
ansible.builtin.template:
|
||||
src: "connection.nmconnection.j2"
|
||||
dest: "/etc/NetworkManager/system-connections/Wired Connection 1.nmconnection"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0600'
|
||||
notify: Reload Network
|
||||
handlers:
|
||||
- name: Reload Network
|
||||
ansible.builtin.systemd:
|
||||
name: NetworkManager.service
|
||||
state: restarted
|
||||
|
||||
|
||||
- name: Backup
|
||||
hosts: backup
|
||||
|
19
coreos-config/plays/templates/connection.nmconnection.j2
Normal file
19
coreos-config/plays/templates/connection.nmconnection.j2
Normal file
@ -0,0 +1,19 @@
|
||||
[connection]
|
||||
id=Wired connection 1
|
||||
uuid=18c78ff6-605e-33c6-89b3-24bb1630d2b2
|
||||
type=ethernet
|
||||
autoconnect-priority=-999
|
||||
interface-name={{ network_interface | mandatory }}
|
||||
timestamp=1693314040
|
||||
|
||||
[ethernet]
|
||||
|
||||
[ipv4]
|
||||
ignore-auto-dns=true
|
||||
method=auto
|
||||
|
||||
[ipv6]
|
||||
addr-gen-mode=default
|
||||
address1={{ network_ipv6_addr | mandatory }}/64,fe80::1
|
||||
ignore-auto-dns=true
|
||||
method=manual
|
Loading…
Reference in New Issue
Block a user