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
24 changes: 24 additions & 0 deletions ansible/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
- name: Ensure dependencies are installed
hosts: localhost
gather_facts: true
tags:
- kolla-ansible
- install
- bootstrap
vars:
kolla_ansible_install_epel: "{{ dnf_install_epel }}"
kolla_ansible_custom_requirements_search_paths_static:
- "{{ kayobe_config_path }}"
kolla_ansible_custom_requirements_search_paths: "{{ kolla_ansible_custom_requirements_search_paths_static + kayobe_env_search_paths | default([]) }}"
kolla_ansible_custom_requirements_paths: "{{ kolla_ansible_custom_requirements_search_paths | map('regex_replace', '$', '/kolla/requirements.yml') | list }}"
tasks:
- name: Install Kayobe dependencies
import_role:
name: bootstrap
tasks_from: install.yml

- name: Install kolla-ansible
import_role:
name: kolla-ansible
tasks_from: install.yml
9 changes: 7 additions & 2 deletions ansible/inventory/group_vars/all/dnf
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
---
# Yum configuration. Dict mapping Yum config option names to their values.
# DNF configuration.

###############################################################################
# DNF repository configuration.

# DNF configuration. Dict mapping DNF config option names to their values.
# dnf_config:
# proxy: http://proxy.example.com
dnf_config: {}

# Whether or not to use a local Yum mirror. Default value is 'false'.
# Whether or not to use a local DNF mirror. Default value is 'false'.
dnf_use_local_mirror: false

# Mirror FQDN for DNF CentOS repos. Default value is 'mirror.stream.centos.org'.
Expand Down
4 changes: 2 additions & 2 deletions ansible/inventory/group_vars/all/ipa
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ ipa_benchmarks: >
# List of default kernel parameters for Ironic python agent.
ipa_kernel_options_default: >
{{ ['ipa-collect-lldp=' ~ ('1' if ipa_collect_lldp | bool else '0')] +
['ipa-inspection-collectors=' ~ ipa_collectors | join(',')] +
['ipa-inspection-benchmarks=' ~ ipa_benchmarks | join(',')] }}
(['ipa-inspection-collectors=' ~ ipa_collectors | join(',')] if ipa_collectors else []) +
(['ipa-inspection-benchmarks=' ~ ipa_benchmarks | join(',')] if ipa_benchmarks else []) }}

# List of additional kernel parameters for Ironic python agent.
ipa_kernel_options_extra: []
Expand Down
5 changes: 0 additions & 5 deletions ansible/kolla-ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@
name: kolla-ansible
vars:
kolla_ansible_control_host_become: "{{ kayobe_control_host_become | bool }}"
kolla_ansible_install_epel: "{{ dnf_install_epel }}"
kolla_ansible_custom_requirements_search_paths_static:
- "{{ kayobe_config_path }}"
kolla_ansible_custom_requirements_search_paths: "{{ kolla_ansible_custom_requirements_search_paths_static + kayobe_env_search_paths | default([]) }}"
kolla_ansible_custom_requirements_paths: "{{ kolla_ansible_custom_requirements_search_paths | map('regex_replace', '$', '/kolla/requirements.yml') | list }}"
kolla_external_fqdn_cert: "{{ kolla_config_path }}/certificates/haproxy.pem"
kolla_internal_fqdn_cert: "{{ kolla_config_path }}/certificates/haproxy-internal.pem"
kolla_ansible_passwords_path: "{{ kayobe_env_config_path }}/kolla/passwords.yml"
Expand Down
10 changes: 4 additions & 6 deletions ansible/roles/arista-switch/templates/arista-config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
{{ line }}
{% endfor %}

{% for interface, config in
arista_switch_interface_config.items() %}
interface {{ interface }}
{% for interface, config in arista_switch_interface_config.items() %}
interface {{ interface }}
{% if config.description is defined %}
description {{ config.description }}
description {{ config.description }}
{% endif %}
{% for line in config.config %}
{{ line }}
{{ line }}
{% endfor %}
exit
{% endfor %}
46 changes: 46 additions & 0 deletions ansible/roles/bootstrap/tasks/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
- block:
- name: Testing privilege escalation
raw: "true"
become: true
failed_when: false
changed_when: false
register: privilege_escalation_result

- name: Assert that we can escalate privileges
assert:
that:
- privilege_escalation_result is success
- '"password is required" not in privilege_escalation_result.stderr'
fail_msg: >-
Could not escalate privileges. You can either: set kayobe_control_host_become: true,
set ansible_become_password, or set up passwordless sudo.
when: kayobe_control_host_become | bool

- name: Include OS family-specific variables
include_vars: "{{ ansible_facts.os_family }}.yml"

- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto

- block:
- name: Assert that all packages are installed if not using privilege escalation
assert:
that: missing_packages is falsy
fail_msg: >-
The following packages are missing from your system: {{ missing_packages | join(', ') }} and
privilege escalation is disabled. Please get your system administator to install these packages
or enable kayobe_control_host_become.
when: not kayobe_control_host_become | bool

- name: Ensure required packages are installed
package:
name: "{{ bootstrap_package_dependencies }}"
state: present
cache_valid_time: "{{ apt_cache_valid_time if ansible_facts.os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_facts.os_family == 'Debian' else omit }}"
become: True
when: missing_packages is truthy
vars:
missing_packages: "{{ bootstrap_package_dependencies | difference(ansible_facts.packages.keys()) }}"
46 changes: 0 additions & 46 deletions ansible/roles/bootstrap/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,4 @@
---
- block:
- name: Testing privilege escalation
raw: "true"
become: true
failed_when: false
changed_when: false
register: privilege_escalation_result

- name: Assert that we can escalate privileges
assert:
that:
- privilege_escalation_result is success
- '"password is required" not in privilege_escalation_result.stderr'
fail_msg: >-
Could not escalate privileges. You can either: set kayobe_control_host_become: true,
set ansible_become_password, or set up passwordless sudo.
when: kayobe_control_host_become | bool

- name: Include OS family-specific variables
include_vars: "{{ ansible_facts.os_family }}.yml"

- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto

- block:
- name: Assert that all packages are installed if not using privilege escalation
assert:
that: missing_packages is falsy
fail_msg: >-
The following packages are missing from your system: {{ missing_packages | join(', ') }} and
privilege escalation is disabled. Please get your system administator to install these packages
or enable kayobe_control_host_become.
when: not kayobe_control_host_become | bool

- name: Ensure required packages are installed
package:
name: "{{ bootstrap_package_dependencies }}"
state: present
cache_valid_time: "{{ apt_cache_valid_time if ansible_facts.os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_facts.os_family == 'Debian' else omit }}"
become: True
when: missing_packages is truthy
vars:
missing_packages: "{{ bootstrap_package_dependencies | difference(ansible_facts.packages.keys()) }}"

- name: Check whether an SSH key exists
stat:
path: "{{ bootstrap_ssh_private_key_path }}"
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/dell-switch/templates/dellos10-config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% for interface, config in dell_switch_interface_config.items() %}
interface {{ interface }}
{% if config.description is defined %}
description {{ config.description }}
description "{{ config.description }}"
{% endif %}
{% for line in config.config %}
{{ line }}
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/dell-switch/templates/dellos6-config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% for interface, config in dell_switch_interface_config.items() %}
interface {{ interface }}
{% if config.description is defined %}
description {{ config.description }}
description "{{ config.description }}"
{% endif %}
{% for line in config.config %}
{{ line }}
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/dell-switch/templates/dellos9-config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dell_switch_interface_config.items() %}
{% if 'vlan' not in interface %}
interface {{ interface }}
{% if config.description is defined %}
description {{ config.description }}
description "{{ config.description }}"
{% endif %}
{% for line in config.config %}
{{ line }}
Expand All @@ -25,7 +25,7 @@ dell_switch_interface_config.items() %}
{% if 'vlan' in interface %}
interface {{ interface }}
{% if config.description is defined %}
description {{ config.description }}
description "{{ config.description }}"
{% endif %}
{% for line in config.config %}
{{ line }}
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/kolla-ansible/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
package:
name: "{{ packages }}"
state: present
cache_valid_time: "{{ apt_cache_valid_time if ansible_facts.os_family == 'Debian' else omit }}"
cache_valid_time: "{{ apt_cache_valid_time | default(3600) if ansible_facts.os_family == 'Debian' else omit }}"
update_cache: "{{ True if ansible_facts.os_family == 'Debian' else omit }}"
become: True
when: missing_packages is truthy
Expand Down
6 changes: 0 additions & 6 deletions ansible/roles/kolla-ansible/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
---
# NOTE: Use import_tasks here, since tags are not applied to tasks included via
# include_tasks.
- import_tasks: install.yml
tags:
- install

- import_tasks: config.yml
tags:
- config
12 changes: 11 additions & 1 deletion ansible/roles/kolla-ansible/tests/test-defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
register: tempfile_result

- block:
- name: Install dependencies
include_role:
name: "{{ playbook_dir }}/.."
tasks_from: install.yml
vars:
kolla_ansible_source_path: "{{ temp_path }}/src"
kolla_ansible_ctl_install_type: "source"
kolla_ansible_source_url: "http://github.com/openstack/kolla-ansible"
kolla_ansible_source_version: "{{ openstack_branch }}"
kolla_ansible_venv: "{{ temp_path }}/venv"

- name: Test the kolla-ansible role with default values
include_role:
name: "{{ playbook_dir }}/.."
Expand Down Expand Up @@ -41,7 +52,6 @@
kolla_openstack_logging_debug: False
kolla_globals_paths_extra:
- "{{ tempfile_result.path ~ '/etc/kayobe/' }}"
apt_cache_valid_time: 3600

- name: Verify kolla-ansible installation
shell: ". {{ temp_path }}/venv/bin/activate && kolla-ansible -h"
Expand Down
12 changes: 11 additions & 1 deletion ansible/roles/kolla-ansible/tests/test-extras.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@
bogus backend certificate

- block:
- name: Install dependencies
include_role:
name: "{{ playbook_dir }}/.."
tasks_from: install.yml
vars:
kolla_ansible_source_path: "{{ temp_path }}/src"
kolla_ansible_ctl_install_type: "source"
kolla_ansible_source_url: "http://github.com/openstack/kolla-ansible"
kolla_ansible_source_version: "{{ openstack_branch }}"
kolla_ansible_venv: "{{ temp_path }}/venv"

- name: Test the kolla-ansible role with default values
include_role:
name: ../../kolla-ansible
Expand Down Expand Up @@ -195,7 +206,6 @@
custom-password-1: "custom-password-1"
custom-password-2: "custom-password-2"
kolla_nova_compute_ironic_host: "controller1"
apt_cache_valid_time: 3600

- name: Verify kolla-ansible installation
shell: ". {{ temp_path }}/venv/bin/activate && kolla-ansible -h"
Expand Down
11 changes: 10 additions & 1 deletion ansible/roles/kolla-ansible/tests/test-globals-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
register: tempfile_result

- block:
- name: Install dependencies
include_role:
name: "{{ playbook_dir }}/.."
tasks_from: install.yml
vars:
kolla_ansible_source_path: "{{ temp_path }}/src"
kolla_ansible_ctl_install_type: "source"
kolla_ansible_source_url: "http://github.com/openstack/kolla-ansible"
kolla_ansible_source_version: "{{ openstack_branch }}"
kolla_ansible_venv: "{{ temp_path }}/venv"

- name: Ensure directories exists
file:
Expand Down Expand Up @@ -74,7 +84,6 @@
- "{{ tempfile_result.path ~ '/etc/kayobe/' }}"
- "{{ tempfile_result.path ~ '/etc/kayobe/environments/level1/' }}"
- "{{ tempfile_result.path ~ '/etc/kayobe/environments/level2/' }}"
apt_cache_valid_time: 3600

- name: Verify kolla-ansible installation
shell: ". {{ temp_path }}/venv/bin/activate && kolla-ansible -h"
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/kolla-ansible/tests/test-requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
- block:
- name: Test the kolla-ansible role with extra Python requirements
include_role:
name: ../../kolla-ansible
name: "{{ playbook_dir }}/.."
tasks_from: install.yml
vars:
kolla_ansible_source_path: "{{ temp_path }}/src"
kolla_ansible_ctl_install_type: "source"
Expand Down Expand Up @@ -39,7 +40,6 @@
kolla_openstack_logging_debug: False
kolla_globals_paths_extra:
- "{{ tempfile_result.path ~ '/etc/kayobe/' }}"
apt_cache_valid_time: 3600

- name: List Python packages installed in virtualenv
command: "{{ temp_path }}/venv/bin/pip list"
Expand Down
8 changes: 4 additions & 4 deletions doc/source/configuration/reference/hosts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,10 @@ CentOS/Rocky and EPEL mirrors can be enabled by setting
``dnf_use_local_mirror`` to ``true``. CentOS repository mirrors are configured
via the following variables:

* ``dnf_centos_mirror_host`` (default ``mirror.centos.org``) is the mirror
hostname.
* ``dnf_centos_mirror_directory`` (default ``centos``) is a directory on the
mirror in which repositories may be accessed.
* ``dnf_centos_mirror_host`` (default ``mirror.stream.centos.org``) is the
mirror hostname.
* ``dnf_centos_mirror_directory`` (default ``''``) is a directory on the mirror
in which repositories may be accessed.

Rocky repository mirrors are configured via the following variables:

Expand Down
7 changes: 4 additions & 3 deletions doc/source/configuration/reference/ironic-python-agent.rst
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,10 @@ inspection.
``ipa_benchmarks_default`` and ``ipa_benchmarks_extra``.
``ipa_kernel_options_default``
List of default kernel parameters for Ironic python agent. Default includes
``ipa-collect-lldp``, ``ipa-inspection-collectors`` and
``ipa-inspection-benchmarks``, with arguments taken from
``ipa_collect_lldp``, ``ipa_collectors`` and ``ipa_benchmarks``.
``ipa-collect-lldp``, ``ipa-inspection-collectors`` (if ``ipa_collectors``
is not empty) and ``ipa-inspection-benchmarks`` (if ``ipa_benchmarks`` is
not empty), with arguments taken from ``ipa_collect_lldp``,
``ipa_collectors`` and ``ipa_benchmarks``.
``ipa_kernel_options_extra``
List of additional kernel parameters for Ironic python agent. Default is
none.
Expand Down
6 changes: 6 additions & 0 deletions doc/source/configuration/reference/network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,9 @@ The following attributes are supported:

``ingress_qos_map`` is only supported with
``network_engine: nmstate`` on VLAN interfaces.
``network_engine: default`` on Debian-family distributions
(which uses systemd-networkd). It is not currently supported
with the ``default`` engine on RedHat-family distributions.

VLAN ingress QoS map configuration. This maps VLAN header Priority Code
Point (PCP) to Linux internal packet priority for incoming packets.
Expand All @@ -631,6 +634,9 @@ The following attributes are supported:

``egress_qos_map`` is only supported with
``network_engine: nmstate`` on VLAN interfaces.
``network_engine: default`` on Debian-family distributions
(which uses systemd-networkd). It is not currently supported
with the ``default`` engine on RedHat-family distributions.

VLAN egress QoS map configuration. This maps Linux internal packet
priority to VLAN header Priority Code Point (PCP) for outgoing packets.
Expand Down
Loading