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
6 changes: 3 additions & 3 deletions ansible/inventory/group_vars/all/openstack
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
###############################################################################
# OpenStack release configuration.

# Name of the current OpenStack release. Default is "2026.2".
openstack_release: "2026.2"
# Name of the current OpenStack release. Default is "master".
openstack_release: "master"

# Name of the current OpenStack branch. Default is "stable/2026.2".
# Name of the current OpenStack branch. Default is "master".
openstack_branch: >-
{% if openstack_release != 'master' %}stable/{% endif %}{{ openstack_release | lower }}

Expand Down
16 changes: 0 additions & 16 deletions ansible/public-openrc.yml

This file was deleted.

6 changes: 0 additions & 6 deletions ansible/roles/public-openrc/defaults/main.yml

This file was deleted.

12 changes: 0 additions & 12 deletions ansible/roles/public-openrc/tasks/main.yml

This file was deleted.

22 changes: 0 additions & 22 deletions ansible/roles/public-openrc/templates/public-openrc.sh.j2

This file was deleted.

45 changes: 44 additions & 1 deletion dev/functions
Original file line number Diff line number Diff line change
Expand Up @@ -692,13 +692,43 @@ function overcloud_test_inspect {
openstack baremetal node provide "$node" --wait
}

function overcloud_test_wait_for_volume {
# Wait for a volume to become available. Arguments:
# $1: The name of the volume.
set -eu

local volume="$1"
local attempts=30
local status

for i in $(seq 1 $attempts); do
status=$(openstack volume show "$volume" -f value -c status)
if [[ $status = available ]]; then
echo "$volume: Volume is available"
return 0
elif [[ $status = error ]]; then
echo "$volume: Volume is in the error state"
openstack volume show "$volume"
return 1
fi
echo "$volume: Volume is $status - retrying"
sleep 10
done

echo "$volume: Volume did not become available after $attempts attempts"
openstack volume show "$volume"
return 1
}

function overcloud_test {
set -eu

# function arguments
name="$1"
flavor="$2"
network="$3"
# Boot the server from a Cinder volume rather than from the image.
boot_from_volume="${4:-false}"

node_config="{ 'name': '$name', 'flavor': '$flavor', 'network': '$network' }"

Expand All @@ -708,7 +738,14 @@ function overcloud_test {
echo "Performing a simple smoke test with node config: $node_config"

echo "$name: Creating a server"
openstack server create --wait --image cirros --flavor "$flavor" --key-name mykey --network "$network" "$name"
if [[ $boot_from_volume = true ]]; then
echo "$name: Creating a bootable volume from the cirros image"
openstack volume create --image cirros --size 1 "${name}-volume"
overcloud_test_wait_for_volume "${name}-volume"
openstack server create --wait --volume "${name}-volume" --flavor "$flavor" --key-name mykey --network "$network" "$name"
else
openstack server create --wait --image cirros --flavor "$flavor" --key-name mykey --network "$network" "$name"
fi
echo "$name: Server created"
openstack server show "$name"
status=$(openstack server show "$name" -f value -c status)
Expand Down Expand Up @@ -760,6 +797,12 @@ function overcloud_test {

echo "$name: Deleting the Node"
openstack server delete --wait "$name"

if [[ $boot_from_volume = true ]]; then
echo "$name: Deleting the volume"
overcloud_test_wait_for_volume "${name}-volume"
openstack volume delete "${name}-volume"
fi
}

function write_bifrost_clouds_yaml {
Expand Down
16 changes: 16 additions & 0 deletions dev/overcloud-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -eu
set -o pipefail

PARENT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

source "${PARENT}/functions"


function main {
config_init
overcloud_test_init
}

main
4 changes: 4 additions & 0 deletions dev/overcloud-test-vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ source "${PARENT}/functions"
function main {
config_init
overcloud_test vm1 m1.tiny demo-net
if is_cinder_enabled; then
# Boot a server from a Cinder volume to test the block storage backend.
overcloud_test vm2 m1.tiny demo-net true
fi
}

main
4 changes: 2 additions & 2 deletions etc/kayobe/openstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
###############################################################################
# OpenStack release configuration.

# Name of the current OpenStack release. Default is "2026.2".
# Name of the current OpenStack release. Default is "master".
#openstack_release:

# Name of the current OpenStack branch. Default is "stable/2026.2".
# Name of the current OpenStack branch. Default is "master".
#openstack_branch:

###############################################################################
Expand Down
25 changes: 3 additions & 22 deletions kayobe/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ class ControlHostBootstrap(KayobeAnsibleMixin, KollaAnsibleMixin, VaultMixin,
* Downloads and installs Ansible roles from Galaxy.
* Generates an SSH key for the Ansible control host, if one does not exist.
* Installs kolla-ansible on the Ansible control host.
* Generates admin-openrc.sh and public-openrc.sh files when passwords.yml
exists.
* Generates openrc files when passwords.yml exists.
"""

def get_parser(self, prog_name):
Expand Down Expand Up @@ -330,15 +329,9 @@ def take_action(self, parsed_args):

if passwords_exist:
# If we are bootstrapping a control host for an existing
# environment, we should also generate the admin-openrc.sh and
# public-openrc.sh scripts that provide admin credentials.

# environment, we should also generate the openrc scripts that
# provide admin credentials.
self.run_kolla_ansible_overcloud(parsed_args, "post-deploy")
# Create an environment file for accessing the public API as the
# admin user.
playbooks = _build_playbook_list("public-openrc")
self.run_kayobe_playbooks(parsed_args, playbooks,
ignore_limit=True)

if parsed_args.add_known_hosts:
self.app.LOG.debug("Adding to known_hosts")
Expand Down Expand Up @@ -1784,10 +1777,6 @@ def take_action(self, parsed_args):

# Post-deployment configuration.
self.run_kolla_ansible_overcloud(parsed_args, "post-deploy")
# Create an environment file for accessing the public API as the admin
# user.
playbooks = _build_playbook_list("public-openrc")
self.run_kayobe_playbooks(parsed_args, playbooks, ignore_limit=True)


class OvercloudServiceDeployContainers(KollaAnsibleMixin, KayobeAnsibleMixin,
Expand Down Expand Up @@ -1940,10 +1929,6 @@ def take_action(self, parsed_args):

# Post-deployment configuration.
self.run_kolla_ansible_overcloud(parsed_args, "post-deploy")
# Create an environment file for accessing the public API as the admin
# user.
playbooks = _build_playbook_list("public-openrc")
self.run_kayobe_playbooks(parsed_args, playbooks, ignore_limit=True)


class OvercloudServiceStop(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin,
Expand Down Expand Up @@ -2049,10 +2034,6 @@ def take_action(self, parsed_args):

# Post-deployment configuration.
self.run_kolla_ansible_overcloud(parsed_args, "post-deploy")
# Create an environment file for accessing the public API as the admin
# user.
playbooks = _build_playbook_list("public-openrc")
self.run_kayobe_playbooks(parsed_args, playbooks, ignore_limit=True)


class OvercloudServiceDestroy(KollaAnsibleMixin, KayobeAnsibleMixin,
Expand Down
27 changes: 0 additions & 27 deletions kayobe/tests/unit/cli/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,6 @@ def test_control_host_bootstrap_with_passwords(
ignore_limit=True,
check=False,
),
mock.call(
mock.ANY,
[utils.get_data_files_path("ansible", "public-openrc.yml")],
ignore_limit=True
),
]
self.assertListEqual(expected_calls, mock_run.call_args_list)

Expand Down Expand Up @@ -1880,13 +1875,6 @@ def test_overcloud_service_deploy(self, mock_kolla_run, mock_run):
"manage_containers_target_hosts": "overcloud",
},
),
mock.call(
mock.ANY,
[
utils.get_data_files_path("ansible", "public-openrc.yml"),
],
ignore_limit=True,
),
]
self.assertListEqual(expected_calls, mock_run.call_args_list)

Expand Down Expand Up @@ -2047,13 +2035,6 @@ def test_overcloud_service_reconfigure(self, mock_kolla_run, mock_run):
"manage_containers_target_hosts": "overcloud",
},
),
mock.call(
mock.ANY,
[
utils.get_data_files_path("ansible", "public-openrc.yml"),
],
ignore_limit=True,
),
]
self.assertListEqual(expected_calls, mock_run.call_args_list)

Expand Down Expand Up @@ -2182,14 +2163,6 @@ def test_overcloud_service_upgrade(self, mock_kolla_run, mock_run):
"manage_containers_target_hosts": "overcloud",
}
),
mock.call(
mock.ANY,
[
utils.get_data_files_path("ansible",
"public-openrc.yml"),
],
ignore_limit=True,
),
]
self.assertListEqual(expected_calls, mock_run.call_args_list)

Expand Down
4 changes: 2 additions & 2 deletions kayobe/tests/unit/test_vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,6 @@ def test_update_environment_file_env(self, mock_read):
parsed_args = parser.parse_args([])
env = {"ANSIBLE_VAULT_PASSWORD_FILE": "/path/to/file"}
vault.update_environment(parsed_args, env)
self.assertEqual({"KAYOBE_VAULT_PASSWORD": "test-pass",
"ANSIBLE_VAULT_PASSWORD_FILE": "/path/to/file"}, env)
# ANSIBLE_VAULT_PASSWORD_FILE should be removed to avoid conflicts
self.assertEqual({"KAYOBE_VAULT_PASSWORD": "test-pass"}, env)
mock_read.assert_called_once_with("/path/to/file")
3 changes: 3 additions & 0 deletions kayobe/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ def update_environment(parsed_args, env):
if VAULT_PASSWORD_FILE_ENV in os.environ:
vault_password = _read_vault_password_file(
os.environ[VAULT_PASSWORD_FILE_ENV])
# Remove ANSIBLE_VAULT_PASSWORD_FILE from environment to avoid
# conflicts when ansible-vault is called with --vault-password-file
env.pop(VAULT_PASSWORD_FILE_ENV, None)
elif parsed_args.ask_vault_pass:
vault_password = _ask_vault_pass()
elif parsed_args.vault_password_file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@

# NOTE(mgoddard): Create two loopback devices backed by files. These will
# be added to a software RAID volume, then added to an LVM volume group.
- name: Ensure a docker storage backing file exists
command: truncate -s 2G /tmp/docker-storage{{ item }}
- name: Ensure a storage backing file exists
command: truncate -s 2G /tmp/storage{{ item }}
loop: [0, 1]

- name: Ensure the docker storage loopback device is created
command: losetup /dev/loop{{ item }} /tmp/docker-storage{{ item }}
- name: Ensure the storage loopback device is created
command: losetup /dev/loop{{ item }} /tmp/storage{{ item }}
become: true
loop: [0, 1]

Expand Down
7 changes: 7 additions & 0 deletions playbooks/kayobe-overcloud-base/overrides.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ kolla_enable_horizon: false
# Enable Mariabackup for testing database backups
kolla_enable_mariabackup: true

# Enable Cinder with an NFS backend to test block storage.
kolla_enable_cinder: true
kolla_enable_cinder_backend_nfs: true

# Cinder backup defaults to the Ceph driver, and no Ceph cluster is deployed.
kolla_enable_cinder_backup: false

{% if tls_enabled %}
kolla_enable_nova_libvirt_container: false
compute_libvirt_enable_tls: true
Expand Down
Loading
Loading