This project contains Ansible playbooks and configuration of infrastructure on an existing OpenStack cloud for the OpenStack system. (Supported up to Yoga release.)
Ensure that Ansible is installed, either via the system package manager or pip. If required, use a virtualenv to avoid interference with the system python packages. For example:
$ virtualenv venv $ source venv/bin/activate $ python -m pip install --upgrade pip $ pip install -r requirements.txt
Install Ansible role and collection dependencies from Ansible Galaxy:
Configuration should be added to etc/openstack-config/openstack-config.yml.
Examples are provided in the examples directory.
First, ensure that OpenStack authentication environment variables are set, typically by sourcing an OpenStack environment file. If a Kayobe environment was already configured, you can use the following command:
$ source ${KOLLA_CONFIG_PATH}/public-openrc.sh
If any Ansible variable is encrypted with Ansible Vault, make sure the
ANSIBLE_VAULT_PASSWORD_FILE environment variable is set:
$ export ANSIBLE_VAULT_PASSWORD_FILE=<path-to-vault-password-file>
To configure OpenStack infrastructure:
$ tools/openstack-config
To run a specific playbook:
$ tools/openstack-config -p </path/to/playbook>
To specify additional arguments to ansible-playbook, separate them with a
double hyphen (--):
$ tools/openstack-config -- <arguments>
For example, a vault secret stored as a file can be passed as an extra configuration parameter:
$ tools/openstack-config -- --vault-password-file config-secret.vault
To generate a new set of Magnum cluster templates and corresponding Glance image definitions which utilise the latest stable upstream release tag, set the following variables in etc/openstack-config.yml
magnum_default_master_flavor_name: # Chosen flavor on target cloud
magnum_default_worker_flavor_name: # Chosen flavor on target cloud
magnum_external_net_name: # External network
magnum_loadbalancer_provider: # Octavia provider (e.g. 'ovn')then run the provided playbook with
$ tools/openstack-config -p ansible/generate-magnum-capi-templates.ymlThis will create a generated-magnum-snippets directory in the repo root with
a timestamped sub-directory containing an images.yml file and a templates.yml
file. The contents of these two files can then be added to any existing images and
cluster templates in etc/openstack-config.yml. When deploying the updated config,
be sure to run the openstack-images.yml playbook before running the
openstack-container-clusters.yml playbook, otherwise the Magnum API will return
an error referencing an invalid cluster type with image None. This is handled
automatically if running the full openstack.yml playbook.