![Alex Schultz](/assets/img/avatar_default.png)
The previous declaration where we installed the puppet-agent was after we revoked sudo access. We need this to be part of the node setup so we need to move it out of the build run and to the node setup playbooks. Depends-On: I2fb0301631eb69bd1e37467229bcf3dc4ab532bb Change-Id: Id68ee1b443a4172d0c1d6d58a04908c52a566623
63 lines
1.7 KiB
YAML
63 lines
1.7 KiB
YAML
- hosts: all
|
|
tasks:
|
|
- name: Ensure legacy workspace directory
|
|
file:
|
|
path: "{{ ansible_user_dir }}/workspace"
|
|
state: directory
|
|
|
|
- name: Clean-up system state (RedHat)
|
|
yum:
|
|
name: "{{ item }}"
|
|
state: absent
|
|
become: true
|
|
when: ansible_os_family == 'RedHat'
|
|
with_items:
|
|
- rdo-release
|
|
- centos-release-openstack-*
|
|
- centos-release-ceph-*
|
|
|
|
- name: Install Ruby dependencies (RedHat)
|
|
yum:
|
|
name: "{{ item }}"
|
|
become: true
|
|
when: ansible_os_family == 'RedHat'
|
|
with_items:
|
|
- "@Development tools"
|
|
- libxml2-devel
|
|
- libxslt-devel
|
|
- ruby-devel
|
|
- zlib-devel
|
|
|
|
- name: Install Ruby dependencies (Debian)
|
|
apt:
|
|
name: "{{ item }}"
|
|
become: true
|
|
when: ansible_os_family == 'Debian'
|
|
with_items:
|
|
- libxml2-dev
|
|
- libxslt-dev
|
|
- ruby-dev
|
|
- zlib1g-dev
|
|
|
|
- name: Install puppetlabs puppet-agent
|
|
shell:
|
|
cmd: |
|
|
set -e
|
|
set -x
|
|
if [ -f /usr/bin/yum ]; then
|
|
yum install -y https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm
|
|
yum install -y puppet-agent
|
|
elif [ -f /usr/bin/apt-get ]; then
|
|
wget https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb -O /tmp/puppet.deb
|
|
dpkg -i /tmp/puppet.deb
|
|
apt-get update
|
|
apt-get install puppet-agent
|
|
rm -rf /tmp/puppet.deb
|
|
fi
|
|
executable: /bin/bash
|
|
chdir: '{{ ansible_user_dir }}/workspace'
|
|
environment: '{{ zuul | zuul_legacy_vars }}'
|
|
become: true
|
|
when:
|
|
- use_puppetlabs
|