Skip to content

Commit

Permalink
Reboot hosts after fix-hostname changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Welsh committed Sep 10, 2024
1 parent c4c531c commit 043644b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions etc/kayobe/ansible/fix-hostname.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@
cmd: hostnamectl set-hostname "{{ inventory_hostname }}"
when: current_hostname.stdout != inventory_hostname
become: true

- name: Reboot hosts
import_playbook: "{{ playbook_dir | realpath }}/reboot.yml"
vars:
reboot_hosts: fix-hostname
when: current_hostname.stdout != inventory_hostname
2 changes: 1 addition & 1 deletion etc/kayobe/ansible/reboot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Reboot the host
hosts: seed-hypervisor:seed:overcloud:infra-vms
hosts: "{{ reboot_hosts | default('seed-hypervisor:seed:overcloud:infra-vms') }}"
serial: "{{ lookup('env', 'ANSIBLE_SERIAL') | default(1, true) }}"
gather_facts: false
vars:
Expand Down

0 comments on commit 043644b

Please sign in to comment.