Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronise yoga with upstream #103

Merged
merged 1 commit into from
Mar 6, 2023
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
4 changes: 2 additions & 2 deletions ansible/group_vars/all/bifrost
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ kolla_bifrost_dib_os_element: "{{ os_distribution }}"
kolla_bifrost_dib_os_release: "{{ os_release }}"

# List of default DIB elements. Default is ["disable-selinux",
# "enable-serial-console", "vm"] when os_distribution is "centos", or
# "enable-serial-console", "vm"] when os_distribution is "centos" or "rocky",
# ["enable-serial-console", "vm"] otherwise.
kolla_bifrost_dib_elements_default:
- "{% if os_distribution == 'centos' %}disable-selinux{% endif %}"
- "{% if os_distribution in ['centos', 'rocky'] %}disable-selinux{% endif %}"
- "enable-serial-console"
- "vm"

Expand Down
8 changes: 4 additions & 4 deletions ansible/group_vars/all/dnf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ dnf_config: {}
# Whether or not to use a local Yum mirror. Default value is 'false'.
dnf_use_local_mirror: false

# Mirror FQDN for Yum CentOS repos. Default value is 'mirror.centos.org'.
dnf_centos_mirror_host: 'mirror.centos.org'
# Mirror FQDN for DNF CentOS repos. Default value is 'mirror.stream.centos.org'.
dnf_centos_mirror_host: 'mirror.{% if ansible_facts.distribution_major_version == "9" %}stream.{% endif %}centos.org'

# Mirror directory for Yum CentOS repos. Default value is 'centos'.
dnf_centos_mirror_directory: 'centos'
# Mirror directory for DNF CentOS repos. Default value is ''.
dnf_centos_mirror_directory: '{% if ansible_facts.distribution_major_version == "8" %}centos{% endif %}'

# Mirror FQDN for Yum Rocky repos. Default value is 'dl.rockylinux.org'.
dnf_rocky_mirror_host: 'dl.rockylinux.org'
Expand Down
14 changes: 9 additions & 5 deletions ansible/group_vars/all/infra-vms
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,20 @@ infra_vm_root_format: qcow2
# Base image for the infra VM root volume. Default is
# "https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img"
# when os_distribution is "ubuntu", or
# https://dl.rockylinux.org/pub/rocky/8/images/Rocky-8-GenericCloud.latest.x86_64.qcow2
# when os_distribution is "rocky",
# https://dl.rockylinux.org/pub/rocky/8/images/x86_64/Rocky-8-GenericCloud.latest.x86_64.qcow2
# when os_distribution is "rocky" and os_release is "8"
# or
# https://dl.rockylinux.org/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2
# when os_distribution is "rocky" and os_release is "9"
# "https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-20220913.0.x86_64.qcow2"
# otherwise.
infra_vm_root_image: >-
{%- if os_distribution == 'ubuntu' %}
https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img
{%- elif os_distribution == 'rocky' %}
https://dl.rockylinux.org/pub/rocky/8/images/Rocky-8-GenericCloud.latest.x86_64.qcow2
{%- elif os_distribution == 'rocky' and os_release == '8' %}
https://dl.rockylinux.org/pub/rocky/8/images/x86_64/Rocky-8-GenericCloud.latest.x86_64.qcow2
{%- elif os_distribution == 'rocky' and os_release == '9' %}
https://dl.rockylinux.org/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2
{%- else -%}
https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-20220913.0.x86_64.qcow2
{%- endif %}
Expand All @@ -74,7 +78,7 @@ infra_vm_hypervisor: "{{ groups['seed-hypervisor'] | first }}"
infra_vm_wait_connection_ssh_extra_args: '-o StrictHostKeyChecking=no'

# OS family. Needed for config drive generation.
infra_vm_os_family: "{{ 'RedHat' if os_distribution == 'centos' else 'Debian' }}"
infra_vm_os_family: "{{ 'RedHat' if os_distribution in ['centos', 'rocky'] else 'Debian' }}"

###############################################################################
# Infrastructure VM node configuration.
Expand Down
6 changes: 3 additions & 3 deletions ansible/group_vars/all/kolla
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ kolla_node_custom_config_path: "{{ kolla_config_path }}/config"
# Kolla configuration.

# Kolla base container image distribution. Options are "centos", "debian",
# "ubuntu". Default is
# {{ 'centos' if os_distribution == 'rocky' else os_distribution }}.
kolla_base_distro: "{{ 'centos' if os_distribution == 'rocky' else os_distribution }}"
# "rocky", "ubuntu". Default is
# {{ 'centos' if (os_distribution == 'rocky' and os_release == '8') else os_distribution }}.
kolla_base_distro: "{{ 'centos' if (os_distribution == 'rocky' and os_release == '8') else os_distribution }}"

# Kolla container image type: binary or source.
kolla_install_type: "source"
Expand Down
3 changes: 2 additions & 1 deletion ansible/group_vars/all/overcloud-dib
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,5 @@ overcloud_dib_git_elements: >-
# Upper constraints file for installing packages in the virtual environment
# used for building overcloud host disk images. Default is {{
# pip_upper_constraints_file }}.
overcloud_dib_upper_constraints_file: "{{ pip_upper_constraints_file }}"
# NOTE(bbezak): Rocky9 needs newer DIB than in yoga upper constraints
overcloud_dib_upper_constraints_file: "{{ '' if os_distribution == 'rocky' and os_release == '9' else pip_upper_constraints_file }}"
14 changes: 9 additions & 5 deletions ansible/group_vars/all/seed-vm
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,21 @@ seed_vm_root_format: qcow2

# Base image for the seed VM root volume. Default is
# "https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img"
# when os_distribution is "ubuntu",
# https://dl.rockylinux.org/pub/rocky/8/images/Rocky-8-GenericCloud.latest.x86_64.qcow2
# when os_distribution is "rocky",
# when os_distribution is "ubuntu", or
# https://dl.rockylinux.org/pub/rocky/8/images/x86_64/Rocky-8-GenericCloud.latest.x86_64.qcow2
# when os_distribution is "rocky" and os_release is "8"
# or
# https://dl.rockylinux.org/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2
# when os_distribution is "rocky" and os_release is "9"
# "https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-20220913.0.x86_64.qcow2"
# otherwise.
seed_vm_root_image: >-
{%- if os_distribution == 'ubuntu' %}
https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img
{%- elif os_distribution == 'rocky' %}
https://dl.rockylinux.org/pub/rocky/8/images/Rocky-8-GenericCloud.latest.x86_64.qcow2
{%- elif os_distribution == 'rocky' and os_release == '8' %}
https://dl.rockylinux.org/pub/rocky/8/images/x86_64/Rocky-8-GenericCloud.latest.x86_64.qcow2
{%- elif os_distribution == 'rocky' and os_release == '9' %}
https://dl.rockylinux.org/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2
{%- else -%}
https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-20220913.0.x86_64.qcow2
{%- endif %}
Expand Down
11 changes: 6 additions & 5 deletions ansible/kayobe-target-venv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
when: not ansible_facts
register: gather_facts

- name: Ensure the Python virtualenv package is installed
- name: Ensure the Python venv package is installed on Debian family systems
package:
name: python3-virtualenv
name: python3-venv
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 }}"
cache_valid_time: "{{ apt_cache_valid_time }}"
update_cache: "True"
become: True
when: ansible_facts.os_family == 'Debian'

- name: Ensure global virtualenv directory exists
file:
Expand Down Expand Up @@ -61,7 +62,7 @@
# Site packages are required for using the dnf module, which is not
# available via PyPI.
virtualenv_site_packages: True
virtualenv_python: "python3.{{ ansible_facts.python.version.minor }}"
virtualenv_command: "python3.{{ ansible_facts.python.version.minor }} -m venv"

- name: Ensure kayobe virtualenv has SELinux bindings installed
pip:
Expand Down
11 changes: 6 additions & 5 deletions ansible/kolla-target-venv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
gather_subset: "{{ kayobe_ansible_setup_gather_subset }}"
when: not ansible_facts

- name: Ensure the Python virtualenv package is installed
- name: Ensure the Python venv package is installed on Debian family systems
package:
name: python3-virtualenv
name: python3-venv
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 }}"
cache_valid_time: "{{ apt_cache_valid_time }}"
update_cache: "True"
become: True
when: ansible_facts.os_family == 'Debian'

- name: Ensure kolla-ansible virtualenv has the latest version of pip installed
pip:
Expand All @@ -41,7 +42,7 @@
# Site packages are required for using the dnf python module, which
# is not available via PyPI.
virtualenv_site_packages: True
virtualenv_python: "python3.{{ ansible_facts.python.version.minor }}"
virtualenv_command: "python3.{{ ansible_facts.python.version.minor }} -m venv"
become: True

- name: Ensure kolla-ansible virtualenv has docker SDK for python installed
Expand Down
14 changes: 10 additions & 4 deletions ansible/roles/dnf/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ dnf_config: {}
# Whether or not to use a local DNF mirror.
dnf_use_local_mirror: false

# Mirror FQDN for DNF repos.
dnf_centos_mirror_host: 'mirror.centos.org'
# Mirror FQDN for DNF CentOS repos. Default value is 'mirror.stream.centos.org'.
dnf_centos_mirror_host: 'mirror.{% if ansible_facts.distribution_major_version == "9" %}stream.{% endif %}centos.org'

# Mirror directory for DNF CentOS repos.
dnf_centos_mirror_directory: 'centos'
# Mirror directory for DNF CentOS repos. Default value is ''.
dnf_centos_mirror_directory: '{% if ansible_facts.distribution_major_version == "8" %}centos{% endif %}'

# Mirror FQDN for DNF Rocky repos. Default value is 'dl.rockylinux.org'.
dnf_rocky_mirror_host: 'dl.rockylinux.org'

# Mirror directory for DNF Rocky repos. Default value is 'pub/rocky'.
dnf_rocky_mirror_directory: 'pub/rocky'

# Mirror FQDN for DNF EPEL repos.
dnf_epel_mirror_host: 'download.fedoraproject.org'
Expand Down
14 changes: 7 additions & 7 deletions ansible/roles/dnf/tasks/local-mirror.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Copy CentOS repo templates
vars:
repo_file_prefix: "{{ 'CentOS-Stream' if ansible_facts.distribution == 'CentOS' else 'Rocky' }}"
repo_file_prefix: "{{ ansible_facts.distribution }}{% if ansible_facts.distribution == 'CentOS'%}-Stream{% endif %}"
template:
src: "{{ item }}.j2"
dest: /etc/yum.repos.d/{{ item }}
Expand All @@ -23,7 +23,7 @@
- CentOS-AppStream.repo
- CentOS-Base.repo
- CentOS-Extras.repo
when: ansible_facts.distribution == 'CentOS'
when: ansible_facts.distribution == 'CentOS' and ansible_facts.distribution_major_version == '8'

- name: Update cache
dnf:
Expand All @@ -42,16 +42,16 @@

- name: Copy EPEL repo templates
template:
src: "{{ item }}.j2"
dest: /etc/yum.repos.d/{{ item }}
src: "{{ item.file }}.j2"
dest: /etc/yum.repos.d/{{ item.file }}
owner: root
group: root
mode: 0664
become: True
loop:
- epel.repo
- epel-modular.repo
when: dnf_install_epel | bool
- { file: 'epel.repo', enabled: true }
- { file: 'epel-modular.repo', enabled: "{{ ansible_facts.distribution_major_version == '8' }}" }
when: dnf_install_epel | bool and item.enabled | bool

- name: Update cache
dnf:
Expand Down
4 changes: 4 additions & 0 deletions ansible/roles/dnf/templates/CentOS-Stream-Extras.repo.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@

[extras]
name=CentOS Stream $releasever - Extras
{% if ansible_facts.distribution_major_version == '8' %}
baseurl=http://{{ dnf_centos_mirror_host }}/{{ dnf_centos_mirror_directory }}/$stream/extras/$basearch/os/
{% else %}
baseurl=http://{{ dnf_centos_mirror_host }}/{{ dnf_centos_mirror_directory }}/SIGs/$stream/extras/$basearch/extras-common/
{% endif %}
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
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 @@ -50,7 +50,7 @@
name: "{{ item.name }}"
state: latest
virtualenv: "{{ kolla_ansible_venv }}"
virtualenv_python: "{{ kolla_ansible_venv_python }}"
virtualenv_command: "{{ kolla_ansible_venv_python }} -m venv"
with_items:
- { name: pip }

Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/kolla-ansible/vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ kolla_ansible_package_dependencies:
- libssl-dev
- python3-dev
- python3-pip
- python3-virtualenv
- python3-venv
2 changes: 1 addition & 1 deletion ansible/roles/kolla/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
name: "{{ item.name }}"
state: latest
virtualenv: "{{ kolla_venv }}"
virtualenv_python: "python3.{{ ansible_facts.python.version.minor }}"
virtualenv_command: "python3.{{ ansible_facts.python.version.minor }} -m venv"
with_items:
- { name: pip }

Expand Down
1 change: 1 addition & 0 deletions ansible/roles/kolla/vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ kolla_package_dependencies:
- libssl-dev
- python3-dev
- python3-pip
- python3-venv
1 change: 1 addition & 0 deletions ansible/roles/network-redhat/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- nm_result is failed
# Ugh, Ansible's service module doesn't handle uninstalled services.
- "'Could not find the requested service' not in nm_result.msg"
when: ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version == "8"

- import_role:
name: ahuffman.resolv
Expand Down
45 changes: 4 additions & 41 deletions ansible/roles/veth/tasks/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,6 @@
---
- name: Ensure veth sysconfig network control scripts exist
copy:
src: "{{ item }}"
dest: "{{ network_scripts_dir }}/{{ item }}"
owner: root
group: root
mode: 0755
with_items:
- "ifup-veth"
- "ifdown-veth"
become: True
register: ctl_result
- include_tasks: network-scripts.yml
when: ansible_facts.distribution_major_version | int < 9

- name: Ensure veth sysconfig network interface files exist
template:
src: ifcfg-veth.j2
dest: "{{ network_scripts_dir }}/ifcfg-{{ item.device }}"
owner: root
group: root
mode: 0644
with_items: "{{ veth_interfaces }}"
become: True
register: veth_result

- name: Ensure veth peer sysconfig network interface files exist
template:
src: ifcfg-peer.j2
dest: "{{ network_scripts_dir }}/ifcfg-{{ item.peer_device }}"
owner: root
group: root
mode: 0644
with_items: "{{ veth_interfaces }}"
become: True
register: peer_result

- name: Bounce veth interfaces
shell: ifdown {{ item[0].item.device }} ; ifup {{ item[0].item.device }}
with_together:
- "{{ veth_result.results }}"
- "{{ peer_result.results }}"
when: ctl_result is changed or item[0] is changed or item[1] is changed
become: True
- include_tasks: network-manager.yml
when: ansible_facts.distribution_major_version | int >= 9
45 changes: 45 additions & 0 deletions ansible/roles/veth/tasks/network-manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
- name: Ensure veth network manager connections file exists
template:
src: veth-nmconnection.j2
dest: "/etc/NetworkManager/system-connections/{{ item.device }}.nmconnection"
owner: root
group: root
mode: 0600
with_items: "{{ veth_interfaces }}"
become: True
register: veth_result

- name: Ensure veth peer network manager connections file exists
template:
src: peer-nmconnection.j2
dest: "/etc/NetworkManager/system-connections/{{ item.peer_device }}.nmconnection"
owner: root
group: root
mode: 0600
with_items: "{{ veth_interfaces }}"
become: True
register: peer_result

# NOTE(bbezak) For some reason adding veth pair via loading files to nmcli needs
# peer device to be loaded first. If not, can't start interface.
# "Error: Connection activation failed: p-br0-ovs failed to create resources:
# Failed to create veth interface 'p-br0-ovs' for 'p-br0-ovs': exists"
- name: Add veth interfaces to network manager
shell: |
nmcli connection load /etc/NetworkManager/system-connections/{{ item[0].item.peer_device }}.nmconnection &&
nmcli connection load /etc/NetworkManager/system-connections/{{ item[0].item.device }}.nmconnection
with_together:
- "{{ veth_result.results }}"
- "{{ peer_result.results }}"
when: item[0] is changed or item[1] is changed
become: True

- name: Start veth interfaces with network manager
shell: |
nmcli connection up {{ item[0].item.device }} &&
nmcli connection up {{ item[0].item.peer_device }}
with_together:
- "{{ veth_result.results }}"
- "{{ peer_result.results }}"
when: item[0] is changed or item[1] is changed
become: True
Loading