Revert - Putting this in its own playbook instead

This commit is contained in:
2024-04-28 19:40:29 -05:00
parent f7da5656ee
commit 2ab5e67b65
2 changed files with 35 additions and 16 deletions

24
linux/dhclient.yml Normal file
View File

@ -0,0 +1,24 @@
---
## Configures dhclient to use the MAC address of the system instead of Client ID, removes all previous leases, and restarts the networking service.
- hosts: all
gather_facts: yes
become: yes
tasks:
- name: Configure dhclient to use the MAC address of the system instead of Client ID.
blockinfile:
state: present
insertafter: EOF
dest: /etc/dhcp/dhclient.conf
marker: "# Changed by ansible playbook: Use MAC address instead of DHCP Client ID"
content: |
send dhcp-client-identifier = hardware;
- name: Remove any dhclient leases in /var/lib/dhcp.
shell:
cmd: rm /var/lib/dhcp/*
removes: /var/lib/dhcp/*
- name: Restart networking service.
service:
name: networking
state: restarted