
After the switch to newer ansible collection, the enrollment workflow started running automated cleaning (before that, it would use the old API version resulting in immediate "available"). However, the static DHCP configuration only happened in the inspect and deploy workflows, which are run after enrollment. This change extracts a new small role for the DHCP config and includes it in all 3 workflows that use DHCP. While here, make sure that dnsmasq_dhcp_hostsdir is respected. Change-Id: Idf6f24dde11d600698d45a218812cba8134fb73f
39 lines
1.3 KiB
YAML
39 lines
1.3 KiB
YAML
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
---
|
|
- name: "Setup DHCP for nodes."
|
|
template:
|
|
src: dhcp-host.j2
|
|
dest: "{{ dnsmasq_dhcp_hostsdir }}/{{ inventory_hostname }}"
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
when: inventory_dhcp | bool
|
|
become: yes
|
|
|
|
- name: "Setup DNS address for nodes."
|
|
template:
|
|
src: dns-address.j2
|
|
dest: "{{ dnsmasq_host_record_prefix }}{{ inventory_hostname }}"
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
when: inventory_dns | bool
|
|
become: yes
|
|
|
|
- name: "Sending dnsmasq HUP"
|
|
# Note(TheJulia): We need to actually to send a hup signal directly as
|
|
# Ansible's reloaded state does not pass through to the init script.
|
|
command: killall -HUP dnsmasq
|
|
become: yes
|
|
when: inventory_dhcp | bool or inventory_dns | bool
|