diff --git a/inventory/group_vars/utility_all.yml b/inventory/group_vars/utility_all.yml index e94baabb7e..f08aab7212 100644 --- a/inventory/group_vars/utility_all.yml +++ b/inventory/group_vars/utility_all.yml @@ -31,12 +31,24 @@ utility_distro_packages: - git - bash-completion -utility_distro_openstack_clients_packages: - - python-keystoneclient - - python-neutronclient - - python-novaclient - - python-cinderclient - - python-openstackclient +# Packages installed into the utility container for distro installs +# NOTE(jrosser) this can be simplified when all supported +# distros use python3 +utility_distro_openstack_clients_python_version: "{{ (ansible_distribution == 'CentOS') | ternary('2', '3') }}" + +_utility_distro_openstack_clients_packages: + 2: + - python-keystoneclient + - python-neutronclient + - python-novaclient + - python-cinderclient + - python-openstackclient + 3: + - python3-keystoneclient + - python3-neutronclient + - python3-novaclient + - python3-cinderclient + - python3-openstackclient # Python packages to be installed into the utility container utility_pip_packages: diff --git a/playbooks/utility-install.yml b/playbooks/utility-install.yml index 9c1197e9d1..0a4416dfc3 100644 --- a/playbooks/utility-install.yml +++ b/playbooks/utility-install.yml @@ -63,7 +63,7 @@ post_tasks: - name: Add OpenStack client to distro packages set_fact: - utility_distro_packages: "{{ (utility_distro_packages | default([])) + utility_distro_openstack_clients_packages }}" + utility_distro_packages: "{{ (utility_distro_packages | default([])) + _utility_distro_openstack_clients_packages[utility_distro_openstack_clients_python_version|int] }}" when: install_method == "distro" - name: Install distro packages