made sure that handlers run prior to hostname change as well as a reboot in which the server is rendered inaccessible
This commit is contained in:
11
init@vps.yml
11
init@vps.yml
@@ -31,6 +31,8 @@
|
||||
ansible.builtin.include_role:
|
||||
name: init-server
|
||||
tasks_from: ssh-users
|
||||
- name: Flush handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
- name: Update hostname
|
||||
become: true
|
||||
ansible.builtin.hostname:
|
||||
@@ -39,7 +41,14 @@
|
||||
become: true
|
||||
ansible.builtin.command:
|
||||
cmd: "hostnamectl set-icon-name computer-server"
|
||||
- name: Notifying user that all processes have finished
|
||||
ansible.builtin.debug:
|
||||
msg: All processes finished. Hit enter to reboot machine.
|
||||
- name: Ensuring user has read prior message regarding upcoming reboot
|
||||
ansible.builtin.pause:
|
||||
- name: Rebooting machine for hostname change
|
||||
become: true
|
||||
ansible.builtin.reboot:
|
||||
msg: "Rebooting machine"
|
||||
msg: "Rebooting machine.."
|
||||
connect_timeout: 0
|
||||
test_command: ~
|
||||
Reference in New Issue
Block a user