Skip to content

Commit

Permalink
Merge pull request openstack-k8s-operators#478 from gibizer/nova-host…
Browse files Browse the repository at this point in the history
…-specific-config

[edpm_nova]Configure my_ip to ctlplane_ip for nova-compute
  • Loading branch information
openshift-merge-bot[bot] authored Nov 9, 2023
2 parents 31459d5 + 819977e commit 24462ed
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions roles/edpm_nova/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ platforms:
- compute
provisioner:
name: ansible
inventory:
hosts:
all:
hosts:
compute-1:
ctlplane_ip: 10.0.0.3

verifier:
name: ansible
scenario:
Expand Down
6 changes: 6 additions & 0 deletions roles/edpm_nova/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
- "Copying /var/lib/kolla/config_files/02-nova-log.conf to /etc/nova/nova.conf.d/02-nova-log.conf"
- "Copying /var/lib/kolla/config_files/ssh-config to /var/lib/nova/.ssh/config"
- "Copying /var/lib/kolla/config_files/ssh-privatekey to /var/lib/nova/.ssh/ssh-privatekey"
- "Copying /var/lib/kolla/config_files/02-nova-host-specific.conf to /etc/nova/nova.conf.d/02-nova-host-specific.conf"

- name: Assert that my_ip is rendered into the host specific config
ansible.builtin.assert:
that:
- "'10.0.0.3' in lookup('ansible.builtin.file', '/var/lib/openstack/config/nova/02-nova-host-specific.conf')"

- name: Check if user exists
ansible.builtin.getent:
Expand Down
12 changes: 12 additions & 0 deletions roles/edpm_nova/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@
- {"src": "config.json.j2", "dest": "config.json"}
- {"src": "nova-blank.conf", "dest": "nova-blank.conf"}
- {"src": "ssh-config", "dest": "ssh-config"}
# NOTE(gibi): This is unfortunate as we would like to avoid config
# generation in ansible. This config is only needed to specify the IP
# address of the node nova-compute should use. Right now this is hardcoded
# to use the ctlplane_ip. In the future we might want to support
# configuring which network nova-compute uses when connecting between
# compute nodes. However that needs careful syncing between IPs in the
# known_hosts file and IPs in the TLS certificates.
# NOTE(gibi): There is an upstream nova blueprint that will allow us to
# remove this host specific configuration in the future (not earlier than
# openstack Caracal)
# https://blueprints.launchpad.net/nova/+spec/libvirt-migrate-with-hostname-instead-of-ip
- {"src": "02-nova-host-specific.conf.j2", "dest": "02-nova-host-specific.conf"}
notify:
- Restart nova

Expand Down
2 changes: 2 additions & 0 deletions roles/edpm_nova/templates/02-nova-host-specific.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[DEFAULT]
my_ip = {{ ctlplane_ip }}

0 comments on commit 24462ed

Please sign in to comment.