kayobe/ansible/group_vars/all/globals
Mark Goddard 2648f48746 Make setup module arguments configurable
Ansible facts can have a large impact on the performance of the Ansible
control host. This patch introduces some control over which facts are
gathered (kayobe_ansible_setup_gather_subset) and which facts are stored
(kayobe_ansible_setup_filter). By default we do not change the default
values of these arguments to the setup module. The flexibility of these
arguments is limited, but they do provide enough for a large performance
improvement in a typical moderate to large OpenStack cloud.

In particular, the large complex dict fact for each interface has a
large effect, and on an OpenStack controller or hypervisor there may be
many virtual interfaces. We can use the kayobe_ansible_setup_filter
variable to help:

    kayobe_ansible_setup_filter: 'ansible_[!qt]*'

This causes Ansible to collect but not store facts matching that
pattern, which includes the virtual interface facts. Currently we are
not referencing other facts matching the pattern within Kayobe.
Note that including the 'ansible_' prefix causes meta facts module_setup
and gather_subset to be filtered, but this seems to be the only way to
get a good match on the interface facts. To work around this, we use
ansible_facts rather than module_setup to detect whether facts exist in
the cache.

The exact improvement will vary, but has been reported to be as large as
18x on systems with many virtual interfaces.

This change also introduces a new command to gather facts for Kayobe &
Kolla Ansible on demand, 'kayobe overcloud facts gather'. This can be
used to populate a fact cache.

Depends-On: https://review.opendev.org/c/openstack/kolla-ansible/+/794610
Story: 2007993
Task: 42586

Change-Id: I5ce3c734433e1682ee942867505468c57440e689
2021-09-27 09:31:09 +00:00

65 lines
2.5 KiB
Plaintext

---
# Kayobe global configuration.
###############################################################################
# Local path configuration (Ansible control host).
# Path to Kayobe configuration directory on Ansible control host.
kayobe_config_path: "{{ lookup('env', 'KAYOBE_CONFIG_PATH') | default('/etc/kayobe', true) }}"
# Name of Kayobe environment to use. Default is $KAYOBE_ENVIRONMENT, or an
# empty string if $KAYOBE_ENVIRONMENT is not set. Can also be set via the
# --environment argument when invoking kayobe.
kayobe_environment: "{{ lookup('env', 'KAYOBE_ENVIRONMENT') }}"
# Path to Kayobe configuration directory on Ansible control host with an
# environment path appended if kayobe_environment is set.
kayobe_env_config_path: "{{ kayobe_config_path ~ ('/environments/' ~ kayobe_environment if kayobe_environment else '') }}"
###############################################################################
# Remote path configuration (seed, seed-hypervisor and overcloud hosts).
# Base path for kayobe state on remote hosts.
base_path: "/opt/kayobe"
# Path in which to store configuration on remote hosts.
config_path: "{{ base_path ~ '/etc' }}"
# Path in which to cache downloaded images on remote hosts.
image_cache_path: "{{ base_path ~ '/images' }}"
# Path on which to checkout source code repositories on remote hosts.
source_checkout_path: "{{ base_path ~ '/src' }}"
# Path on which to create python virtualenvs on remote hosts.
virtualenv_path: "{{ base_path ~ '/venvs' }}"
###############################################################################
# User configuration.
# User with which to access remote hosts. This user will be created if it does
# not exist.
kayobe_ansible_user: "stack"
###############################################################################
# OS distribution.
# OS distribution name. Valid options are "centos", "ubuntu". Default is
# "centos".
os_distribution: "centos"
# OS release. Valid options are "8-stream" when os_distribution is "centos", or
# "focal" when os_distribution is "ubuntu".
os_release: "{{ '8-stream' if os_distribution == 'centos' else 'focal' }}"
###############################################################################
# Ansible configuration.
# Filter to apply to the setup module when gathering facts. Default is to not
# specify a filter.
kayobe_ansible_setup_filter: "{{ omit }}"
# Gather subset to apply to the setup module when gathering facts. Default is
# to not specify a gather subset.
kayobe_ansible_setup_gather_subset: "{{ omit }}"