updated subtasks
This commit is contained in:
@@ -1,28 +1,23 @@
|
|||||||
---
|
---
|
||||||
- name: Set dnsmasq host reservation
|
- name: Ensure dnsmasq is installed
|
||||||
hosts: all
|
ansible.builtin.apt:
|
||||||
become: true
|
name: dnsmasq
|
||||||
|
state: present
|
||||||
|
when: ansible_os_family == "Debian"
|
||||||
|
|
||||||
tasks:
|
- name: Ensure dnsmasq is installed
|
||||||
- name: Ensure dnsmasq is installed
|
ansible.builtin.dnf:
|
||||||
ansible.builtin.apt:
|
name: dnsmasq
|
||||||
name: dnsmasq
|
state: present
|
||||||
state: present
|
when: ansible_os_family == "RedHat"
|
||||||
when: ansible_os_family == "Debian"
|
|
||||||
|
|
||||||
- name: Ensure dnsmasq is installed
|
- name: Add host reservation to dnsmasq
|
||||||
ansible.builtin.dnf:
|
ansible.builtin.lineinfile:
|
||||||
name: dnsmasq
|
path: /etc/dnsmasq.d/hosts.conf
|
||||||
state: present
|
line: "dhcp-host={{ mac_address }},{{ ip_address }},{{ hostname }}"
|
||||||
when: ansible_os_family == "RedHat"
|
state: present
|
||||||
|
|
||||||
- name: Add host reservation to dnsmasq
|
- name: Restart dnsmasq service
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.service:
|
||||||
path: /etc/dnsmasq.d/hosts.conf
|
name: dnsmasq
|
||||||
line: "dhcp-host={{ mac_address }},{{ ip_address }},{{ hostname }}"
|
state: restarted
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Restart dnsmasq service
|
|
||||||
ansible.builtin.service:
|
|
||||||
name: dnsmasq
|
|
||||||
state: restarted
|
|
||||||
|
|||||||
@@ -3,7 +3,11 @@
|
|||||||
hosts: 127.0.0.1
|
hosts: 127.0.0.1
|
||||||
connection: local
|
connection: local
|
||||||
gather_facts: true
|
gather_facts: true
|
||||||
include_vars: vars.yml
|
vars_files: vars.yml
|
||||||
|
|
||||||
|
vars_prompt:
|
||||||
|
- name: freeipa_password
|
||||||
|
prompt: FreeIPA password for admin user
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Deploy DNS entries for cluster via Terraform
|
- name: Deploy DNS entries for cluster via Terraform
|
||||||
@@ -16,4 +20,3 @@
|
|||||||
|
|
||||||
- ansible.builtin.include_tasks:
|
- ansible.builtin.include_tasks:
|
||||||
file: 02-dhcp/ip-reservations.yml
|
file: 02-dhcp/ip-reservations.yml
|
||||||
include_vars: vars.yml
|
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
vars_prompt:
|
|
||||||
- name: freeipa_password
|
|
||||||
prompt: FreeIPA password for admin user
|
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
mac_address: "98:b7:85:1e:c6:f1"
|
mac_address: "98:b7:85:1e:c6:f1"
|
||||||
|
|||||||
Reference in New Issue
Block a user