30 lines
628 B
YAML
30 lines
628 B
YAML
---
|
|
- name: Ensure dhcpcd is instaled
|
|
ansible.builtin.package:
|
|
name: dhcpcd
|
|
state: present
|
|
become: true
|
|
- name: Change hostname setting
|
|
ansible.builtin.lineinfile:
|
|
dest: /etc/dhcpcd.conf
|
|
regexp: "^#hostname"
|
|
line: "hostname"
|
|
state: present
|
|
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"
|