This repository has been archived on 2023-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
homeserver-ansible/tasks/connection.yml
2022-02-27 16:05:34 -05:00

29 lines
623 B
YAML

- name: Install NetworkManager
community.general.pacman:
name:
- networkmanager
- name: Enable NetworkManager
service:
name: NetworkManager
enabled: yes
state: started
- name: Disable existing eth0 connection
community.general.nmcli:
conn_name: eth0
state: absent
register: networkmanager_config
- name: Set static IP address
community.general.nmcli:
dns4: "{{ dns_forward }}"
dns4_ignore_auto: yes
ip4: "{{ local_ip }}"
method4: manual
state: present
conn_name: wired
ifname: "{{ interface }}"
type: ethernet
when: networkmanager_config.changed