Skip to content

Add hooks for fixing hostname bug in Multinode for Caracal upgrade job #1257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 11, 2024
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
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
2 changes: 1 addition & 1 deletion etc/kayobe/environments/ci-multinode/inventory/groups
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
controllers

[fix-hostname:children]
storage
overcloud
3 changes: 3 additions & 0 deletions etc/kayobe/environments/ci-multinode/reboot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
# Ensure that the reboot playbook is always executed using the boostrap user
reboot_with_bootstrap_user: true