Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions roles/dhcp-server/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,20 @@

- name: restart network-manager
command: "/bin/systemctl restart NetworkManager.service"

- name: reboot
when: ansible_connection != 'local'
command: shutdown -r now "Reboot triggered by Ansible"
async: 0
poll: 0
ignore_errors: true

- name: wait for reboot
when: ansible_connection != 'local'
local_action:
module: wait_for
host: "{{ inventory_hostname }}"
port: "{{ ansible_port | default(22) }}"
delay: 1
timeout: 300
sudo: false
3 changes: 3 additions & 0 deletions roles/dhcp-server/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
template:
src: templates/76-netnames.rules.j2
dest: /etc/udev/rules.d/76-netnames.rules
notify:
- reboot
- wait for reboot

- name: configure network interfaces (static)
template:
Expand Down