Collection of scripts and manifests for module testing
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
puppet-openstack-integration/playbooks/prepare-node-common.yaml

121 lines
3.0 KiB

- hosts: all
tasks:
- name: Ensure legacy workspace directory
file:
path: "{{ ansible_user_dir }}/workspace"
state: directory
- block:
- name: Clean-up system state (CentOS/RHEL)
dnf:
name: "{{ item }}"
state: absent
become: true
ignore_errors: true
with_items:
- rdo-release
- centos-release-openstack-*
- centos-release-ceph-*
- name: Install Ruby dependencies (CentOS/RHEL)
dnf:
name: "{{ item }}"
become: true
with_items:
- "@Development tools"
- libxml2-devel
- libxslt-devel
- ruby-devel
- zlib-devel
- name: Install yum (CentOS/RHEL)
dnf:
name: yum
become: true
when:
- ansible_os_family == 'RedHat'
- block:
- name: install required packages (CentOS/RHEL>=9)
dnf:
name: "{{ item }}"
state: present
become: true
ignore_errors: true
with_items:
- rubygem-rexml
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version >= "9"
- name: Install Ruby dependencies (Ubuntu)
apt:
name: "{{ item }}"
become: true
when:
- ansible_os_family == 'Debian'
- ansible_distribution == "Ubuntu"
with_items:
- libxml2-dev
- libxslt-dev
- ruby-dev
- zlib1g-dev
- python3-pip
- name: Install Ruby dependencies (Debian)
apt:
name: "{{ item }}"
become: true
when:
- ansible_os_family == 'Debian'
- ansible_distribution == "Debian"
with_items:
- libicu-dev
- libxml2-dev
- libxslt1-dev
- ruby-dev
- zlib1g-dev
- python3-pip
- block:
- name: Set up puppetlabs repo (CentOS/RHEL)
yum:
name: "https://yum.puppetlabs.com/puppet{{ puppet }}-release-el-{{ ansible_distribution_major_version }}.noarch.rpm"
become: true
- name: Install puppetlabs puppet-agent (CentOS/RHEL)
yum:
name: puppet-agent
become: true
when:
- use_puppetlabs is defined
- use_puppetlabs|bool
- ansible_os_family == 'RedHat'
- block:
- name: Set up puppetlabs repo (Ubuntu and Debian)
apt:
name: "https://apt.puppetlabs.com/puppet{{ puppet }}-release-{{ ansible_distribution_release }}.deb"
become: true
- name: Install puppetlabs puppet-agent (Ubuntu and Debian)
apt:
name: puppet-agent
become: true
when:
- use_puppetlabs is defined
- use_puppetlabs|bool
- ansible_os_family == 'Debian'
- block:
- name: Workaround for lp bug 1962506 (CentOS/RHEL 9)
shell:
cmd: |
dnf config-manager --save --setopt exclude=flexiblas*3.0.4-7*
become: true
when:
- ansible_os_family == 'RedHat'
- ansible_distribution_major_version == "9"