Revert - Putting this in its own playbook instead
This commit is contained in:
24
linux/dhclient.yml
Normal file
24
linux/dhclient.yml
Normal 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
|
Reference in New Issue
Block a user