Use dnf and python3 on platforms where these are default
Roles do not need to make any assumptions about having some facts already gathered, thus at start they should assure they gather any missiong facts that are used inside the role. Change-Id: I49fd1a0c070d96aecb880164acde490c9e7c95ef Story: https://tree.taiga.io/project/tripleo-ci-board/task/153 Depends-On: https://review.openstack.org/#/c/615489/
This commit is contained in:
@@ -1,35 +1,64 @@
|
||||
---
|
||||
|
||||
# needed to avoid potential failure when role is used without gather
|
||||
- name: gather facts used by role
|
||||
setup:
|
||||
gather_subset: "!min,user_dir,python,processor"
|
||||
when: >
|
||||
ansible_user_dir is not defined or
|
||||
ansible_python is not defined or
|
||||
ansible_processor_vcpus is not defined
|
||||
|
||||
- name: set python_cmd
|
||||
set_fact:
|
||||
python_cmd: "python{{ ansible_python.version.major }}"
|
||||
cacheable: true
|
||||
when: python_cmd is not defined
|
||||
|
||||
- name: Ensure DLRN package dependencies
|
||||
become: yes
|
||||
package: name={{ item }} state=present
|
||||
with_items:
|
||||
- createrepo
|
||||
- gcc
|
||||
- git
|
||||
- libffi-devel
|
||||
- mock
|
||||
- openssl-devel
|
||||
- rpm-build
|
||||
- sqlite
|
||||
- redhat-rpm-config
|
||||
- rpmdevtools
|
||||
- libselinux-python
|
||||
package:
|
||||
state: present
|
||||
name:
|
||||
- createrepo
|
||||
- gcc
|
||||
- git
|
||||
- libffi-devel
|
||||
- mock
|
||||
- openssl-devel
|
||||
- redhat-rpm-config
|
||||
- rpm-build
|
||||
- rpmdevtools
|
||||
- sqlite
|
||||
- >
|
||||
{% if ansible_python.version.major == 3 %}
|
||||
python3-libselinux
|
||||
{% else %}
|
||||
libselinux-python
|
||||
{% endif %}
|
||||
|
||||
- name: Check if virtualenv is in the system
|
||||
shell: command -v virtualenv >/dev/null 2>&1
|
||||
shell: "{{ python_cmd }} -m virtualenv --version"
|
||||
register: virtualenv_exist
|
||||
ignore_errors: yes
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- when: virtualenv_exist.rc == 1
|
||||
- when: virtualenv_exist.rc != 0
|
||||
name: Install virtualenv
|
||||
package:
|
||||
name: python-virtualenv
|
||||
state: present
|
||||
name: >
|
||||
{% if ansible_python.version.major == 3 %}
|
||||
python3-virtualenv
|
||||
{% else %}
|
||||
python-virtualenv
|
||||
{% endif %}
|
||||
|
||||
- name: Create mock group
|
||||
become: yes
|
||||
group: name=mock state=present
|
||||
group:
|
||||
name: mock
|
||||
state: present
|
||||
|
||||
- name: Add user to mock group
|
||||
become: yes
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
ignore_errors: true
|
||||
block:
|
||||
- name: Ensure required rpms for logging are installed
|
||||
yum: name={{ item }} state=present
|
||||
with_items:
|
||||
- gzip
|
||||
- rsync
|
||||
- tar
|
||||
package:
|
||||
state: present
|
||||
name:
|
||||
- gzip
|
||||
- rsync
|
||||
- tar
|
||||
|
||||
- name: Prepare directory with extra logs
|
||||
file: dest=/var/log/extra state=directory
|
||||
@@ -15,8 +16,8 @@
|
||||
- name: rpm -qa
|
||||
shell: rpm -qa | sort -f >/var/log/extra/rpm-list.txt
|
||||
|
||||
- name: yum list installed
|
||||
shell: yum list installed >/var/log/extra/yum-list-installed.txt
|
||||
- name: package list installed
|
||||
shell: "{{ ansible_pkg_mgr }} list installed >/var/log/extra/package-list-installed.txt"
|
||||
|
||||
- name: Collecting /proc/cpuinfo|meminfo|swaps
|
||||
shell: "cat /proc/{{item}} &> /var/log/extra/{{item}}.txt"
|
||||
@@ -177,7 +178,9 @@
|
||||
grep -v ansible-command /var/log/messages | grep oom-killer > /var/log/extra/oom-killers.txt
|
||||
|
||||
- name: Ensure sos package is installed when collect sosreport(s)
|
||||
yum: name=sos state=present
|
||||
package:
|
||||
name: sos
|
||||
state: present
|
||||
when: artcl_collect_sosreport|bool
|
||||
|
||||
- name: Collect sosreport
|
||||
@@ -233,7 +236,7 @@
|
||||
CONTAINER_CONT_INFO_CMDS=(
|
||||
"${engine} top $cont auxw"
|
||||
"${engine} exec $cont top -bwn1"
|
||||
"${engine} exec $cont yum list installed"
|
||||
"${engine} exec $cont bash -c \"\$(command -v dnf || command -v yum) list installed\""
|
||||
"${engine} inspect $cont"
|
||||
);
|
||||
for cmd in "${CONTAINER_CONT_INFO_CMDS[@]}"; do
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
---
|
||||
- name: gather facts used by role
|
||||
setup:
|
||||
gather_subset: "!min,pkg_mgr"
|
||||
when: ansible_pkg_mgr is not defined
|
||||
|
||||
- name: Collect logs
|
||||
include: collect.yml
|
||||
when: artcl_collect|bool
|
||||
|
||||
@@ -15,7 +15,7 @@ ip -6 route
|
||||
free -h
|
||||
top -n 1 -b -o RES
|
||||
rpm -qa | sort
|
||||
yum repolist -v
|
||||
{{ ansible_pkg_mgr }} repolist -v
|
||||
sudo os-collect-config --print
|
||||
which pcs &> /dev/null && sudo pcs status --full
|
||||
which pcs &> /dev/null && sudo pcs constraint show --full
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
---
|
||||
# tasks file for ansible-role-tripleo-overcloud-prep-containers
|
||||
- name: gather facts needed by role
|
||||
setup:
|
||||
gather_subset: "!min,user_dir,python"
|
||||
when: >
|
||||
ansible_user_dir is not defined or
|
||||
ansible_python is not defined
|
||||
|
||||
- name: set python_cmd
|
||||
set_fact:
|
||||
python_cmd: "python{{ ansible_python.version.major }}"
|
||||
cacheable: true
|
||||
when: python_cmd is not defined
|
||||
|
||||
- include: create-scripts.yml
|
||||
tags:
|
||||
- undercloud-scripts
|
||||
|
||||
@@ -1,21 +1,37 @@
|
||||
---
|
||||
- when: update_containers|bool
|
||||
block:
|
||||
- name: check if python setup tool is installed
|
||||
shell: command -v easy-install >/dev/null 2>&1
|
||||
register: easy_install_exists
|
||||
ignore_errors: yes
|
||||
|
||||
- when: easy_install_exists.rc == 1
|
||||
name: Install python setuptools
|
||||
package:
|
||||
name: python-setuptools
|
||||
state: latest
|
||||
become: true
|
||||
- name: ensure_pip on py2 systems
|
||||
when: ansible_python.version.major == 2
|
||||
block:
|
||||
|
||||
- name: easy-install pip
|
||||
command: easy_install pip
|
||||
become: true
|
||||
- command: "{{ python_cmd }} -m pip --version"
|
||||
register: have_pip
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- when: have_pip.rc != 0
|
||||
become: true
|
||||
block:
|
||||
|
||||
- name: check if python setup tool is installed
|
||||
shell: "{{ python_cmd }} -m easy_install --version"
|
||||
register: easy_install_exists
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: Install python setuptools (easy_install)
|
||||
when: easy_install_exists.rc != 0
|
||||
package:
|
||||
state: latest
|
||||
name:
|
||||
- python2-setuptools
|
||||
# python2-setuptools deprecates python-setuptools the former
|
||||
# one being too old to be usable. included in openstack distro.
|
||||
|
||||
- name: easy-install pip
|
||||
command: "{{ python_cmd }} -m easy_install pip"
|
||||
|
||||
- name: Update pip
|
||||
pip:
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
- name: gather facts used by role
|
||||
setup:
|
||||
gather_subset: "!min,distribution"
|
||||
when: ansible_distribution is not defined
|
||||
|
||||
- include: novajoin_prep.yml
|
||||
when: enable_tls_everywhere|bool and prepare_novajoin|bool
|
||||
tags:
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
when: undercloud_undercloud_hostname is not defined or ( undercloud_undercloud_hostname is defined and undercloud_undercloud_hostname == "" )
|
||||
|
||||
- name: Install novajoin package installation script
|
||||
copy:
|
||||
src: install_novajoin.sh
|
||||
template:
|
||||
src: install_novajoin.sh.j2
|
||||
dest: "{{ working_dir }}/install_novajoin.sh"
|
||||
mode: 0755
|
||||
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
## * Install python-novajoin
|
||||
## ::
|
||||
|
||||
sudo yum install -y python-novajoin
|
||||
sudo {{ ansible_pkg_mgr }} install -y python-novajoin
|
||||
|
||||
### --stop_docs
|
||||
@@ -1,5 +1,10 @@
|
||||
---
|
||||
|
||||
- name: gather ansible_pkg_mgr
|
||||
setup:
|
||||
gather_subset: "!min,pkg_mgr"
|
||||
when: ansible_pkg_mgr is not defined
|
||||
|
||||
- name: Install package installation script
|
||||
template:
|
||||
src: install_packages.sh.j2
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
## * Install python-tripleoclient
|
||||
## ::
|
||||
|
||||
sudo yum install -y {{ undercloud_rpm_dependencies }}
|
||||
sudo $(command -v dnf || command -v yum) install -y {{ undercloud_rpm_dependencies }}
|
||||
|
||||
### --stop_docs
|
||||
|
||||
@@ -1,4 +1,24 @@
|
||||
---
|
||||
- name: gather facts used by role
|
||||
setup:
|
||||
gather_subset: "!min,python,processor"
|
||||
when: >
|
||||
python_version is not defined or
|
||||
ansible_processor_vcpus is not defined
|
||||
|
||||
- name: gather ansible_python_version
|
||||
setup:
|
||||
gather_subset: "!min,python_version,python"
|
||||
when: >
|
||||
ansible_python_version is not defined or
|
||||
ansible_python is not defined
|
||||
|
||||
- name: set python_cmd
|
||||
set_fact:
|
||||
python_cmd: "python{{ ansible_python.version.major }}"
|
||||
cacheable: true
|
||||
when: python_cmd is not defined
|
||||
|
||||
- include: tempest-venv.yml
|
||||
when: tempest_config|bool and tempest_format == 'venv'
|
||||
tags:
|
||||
|
||||
@@ -20,24 +20,30 @@
|
||||
version: '{{ tempest_conf_version }}'
|
||||
when: release != 'newton'
|
||||
|
||||
|
||||
- name: Check if virtualenv is in the system
|
||||
shell: command -v virtualenv >/dev/null 2>&1
|
||||
shell: "{{ python_cmd }} -m virtualenv --version"
|
||||
register: virtualenv_exist
|
||||
ignore_errors: yes
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
|
||||
- when: virtualenv_exist.rc == 1
|
||||
- when: virtualenv_exist.rc != 0
|
||||
name: Install virtualenv
|
||||
package:
|
||||
name: python-virtualenv
|
||||
state: present
|
||||
name: >
|
||||
{% if ansible_python.version.major == 3 %}
|
||||
python3-virtualenv
|
||||
{% else %}
|
||||
python-virtualenv
|
||||
{% endif %}
|
||||
|
||||
- name: Install packages required for create venv
|
||||
package: name={{ item }} state=present
|
||||
with_items:
|
||||
- libffi-devel
|
||||
- openssl-devel
|
||||
- gcc
|
||||
package:
|
||||
state: present
|
||||
name:
|
||||
- gcc
|
||||
- libffi-devel
|
||||
- openssl-devel
|
||||
|
||||
- name: Set tempest init command
|
||||
set_fact:
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
- name: gather facts used by role
|
||||
setup:
|
||||
gather_subset: "!min,pkg_mgr"
|
||||
when: ansible_pkg_mgr is not defined
|
||||
|
||||
- name: Reinstall the undercloud to check idempotency
|
||||
shell: >
|
||||
set -o pipefail &&
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
script_return_value=0
|
||||
|
||||
## * Install deps for subunit results
|
||||
sudo yum install -y python-os-testr
|
||||
sudo {{ ansible_pkg_mgr }} install -y python-os-testr
|
||||
|
||||
## * Set the uri of TripleO UI based on SSL usage
|
||||
## ::
|
||||
|
||||
Reference in New Issue
Block a user