Files
openstack-ansible/doc/source/user/source-overrides/index.rst
Dmitriy Rabotyagov 9fca8555df Move repo_packages to group_vars
At the moment it's not possible to apply different versions of
services to the different groups due to playbook vars having
prescedence over group_vars. However, it can be quite important
to  such use cases, for example for phased rollouts of newer versions.

This will also reduce amount of unnecessary variables that are included
for each host, since only required git details will be loaded.

Closes-Bug: #2007296
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_rally/+/881954
Change-Id: Icaa3a958926d9f9aa6cb649bd9f3da9449dd7490
2023-05-18 08:49:51 +00:00

2.4 KiB

Source overriding examples

There are situations where a deployer want to override sources with its own fork.

This chapter gives case-by-case examples on how to override the default sources.

Overriding Ansible version

Overriding the default Ansible version is not recommended, as each branch of OpenStack-Ansible has been built with the a specific Ansible version in mind, and many Ansible changes are neither backwards nor forward compatible.

The bootstrap-ansible.sh script installs Ansible, and uses a variable ANSIBLE_PACKAGE to describe which version to install.

For example to install ansible version 2.5.0:

$ export ANSIBLE_PACKAGE="ansible==2.5.0"

Installing directly from git is also supported. For example, from the tip of Ansible development branch:

$ export ANSIBLE_PACKAGE="git+https://github.com/ansible/ansible@devel#egg=ansible"

Overriding the roles

Overriding the role file has been explained in the reference guide, on the extend_osa_roles section.

Overriding other upstream projects source code

All the upstream repositories used are defined in the openstack-ansible integrated repository, in the inventory/group_vars/<service_group>/source_git.yml file.

For example, if you want to override glance repository with your own, you need to define the following:

glance_git_repo: https://<your git repo>
glance_git_install_branch: <your git branch or commit SHA>
glance_git_project_group: glance_all

Please note, for this glance example, that you do not need to edit the inventory/group_vars/glance_all/source_git.yml file.

Instead, the usual overrides mechanism can take place, and you can define these 3 variables in a user_*.yml file. See also the user-overrides page.

Note

These variables behave a little differently than standard ansible precedence, because they are also consumed by a custom lookup plugin.

The py_pkgs lookup will ignore all _git variables unless the _git_repo variable is present.

So even if you only want to override the _git_install_branch for a repository, you should also define the _git_repo variable in your user variables.