system/tasks/dhcpcd.yml

30 lines
628 B
YAML
Raw Normal View History

2021-11-14 16:13:49 +00:00
---
2022-12-10 17:51:03 +00:00
- name: Ensure dhcpcd is instaled
ansible.builtin.package:
2022-10-09 15:45:35 +00:00
name: dhcpcd
state: present
2023-08-24 19:21:19 +00:00
become: true
2022-12-10 17:51:03 +00:00
- name: Change hostname setting
ansible.builtin.lineinfile:
2021-11-14 16:13:49 +00:00
dest: /etc/dhcpcd.conf
regexp: "^#hostname"
line: "hostname"
2021-11-17 16:24:38 +00:00
state: present
2022-05-31 12:32:33 +00:00
become: true
- name: start and enable dhcpcd
ansible.builtin.service:
name: dhcpcd
state: started
enabled: true
become: true
when: ansible_os_family == "Debian"
- name: stop and disable networking
ansible.builtin.service:
name: networking
state: stopped
enabled: false
become: true
when: ansible_os_family == "Debian"