Преглед изворни кода

migration: Use python3 packages when needed

The patch changes names of installed packages by yum module based on
what Python version of interpreter is available on given node.

Closes-bug: #1839834

Change-Id: I5a2409d80ebd19904909bd62fb7c11ae0cbfde30
(cherry picked from commit 985f3805da)
changes/35/677935/1
Jakub Libosvar пре 3 месеци
родитељ
комит
c4367485a1
2 измењених фајлова са 19 додато и 5 уклоњено
  1. 12
    4
      migration/infrared/tripleo-ovn-migration/main.yml
  2. 7
    1
      migration/migrate-to-ovn.yml

+ 12
- 4
migration/infrared/tripleo-ovn-migration/main.yml Прегледај датотеку

@@ -2,16 +2,24 @@
- name: Install migration tool
hosts: undercloud
become: true
vars:
python_major_version: "{{ ansible_facts.python_version.split('.')[0] }}"
tasks:
- name: Install python virtualenv
- name: Install python 2 virtualenv and networking ovn migration tool
yum:
name: python-virtualenv
name:
- python-virtualenv
- python-networking-ovn-migration-tool
state: present
when: python_major_version | int == 2

- name: Install python networking ovn migration tool
- name: Install python 3 virtualenv and networking ovn migration tool
yum:
name: python-networking-ovn-migration-tool
name:
- python3-virtualenv
- python3-networking-ovn-migration-tool
state: present
when: python_major_version | int == 3

- name: Set host_key_checking to False in ansible.cfg
ini_file:

+ 7
- 1
migration/migrate-to-ovn.yml Прегледај датотеку

@@ -94,10 +94,16 @@
command: "ovn-sbctl set-connection ptcp:6642:{{ ovn_db_ip }}"
when: ovn_central is defined
changed_when: False
- name: Ensure the Neutron ML2 plugin is installed on neutron-api hosts.
- name: Ensure the Neutron ML2 plugin Python 2 is installed on neutron-api hosts.
yum:
name: python-networking-ovn
state: present
when: ansible_facts.python_version.split('.')[0] | int == 2
- name: Ensure the Neutron ML2 plugin Python 3 is installed on neutron-api hosts.
yum:
name: python-networking-ovn
state: present
when: ansible_facts.python_version.split('.')[0] | int == 3
- name: Update Neutron configuration files
ini_file: dest={{ item.dest }} section={{ item.section }} option={{ item.option }} value={{ item.value }}
with_items:

Loading…
Откажи
Сачувај