ansible/roles/jenkins/slave/tasks/main.yml
Patrick Uiterwijk 039b08354a Yum allowed state=installed. Lets use state=present consistently
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
2017-10-08 22:31:03 +00:00

110 lines
2.8 KiB
YAML

- name: install common slave packages (dnf)
dnf: name={{ item }} state=present
with_items: "{{ slave_packages_common }}"
when: ansible_distribution_major_version|int > 21
tags:
- jenkins
- jenkins/slave
- packages
- name: install common slave packages (yum)
package: name={{ item }} state=present
with_items: "{{ slave_packages_common }}"
when: ansible_distribution_major_version|int < 22
tags:
- jenkins
- jenkins/slave
- packages
- name: install distro-specific slave packages (fedora, dnf)
dnf: name={{ item }} state=present
with_items: "{{ slave_packages_fedora }}"
when: ansible_distribution_major_version|int > 21
tags:
- jenkins
- jenkins/slave
- packages
- name: install distro-specific slave packages (centos, yum)
package: name={{ item }} state=present
with_items: "{{ slave_packages_centos }}"
when: ansible_distribution_major_version|int < 8
tags:
- jenkins
- jenkins/slave
- packages
- name: install el7 specific slave packages
package: name={{ item }} state=present
with_items: "{{ el7_only }}"
when: ansible_distribution_major_version|int == 7
tags:
- jenkins
- jenkins/slave
- packages
- name: install f25 specific slave packages
dnf: name={{ item }} state=present
with_items: "{{ f25_only }}"
when: ansible_distribution_major_version|int == 25
tags:
- jenkins
- jenkins/slave
- packages
- name: install f24 specific slave packages
dnf: name={{ item }} state=present
with_items: "{{ f24_only }}"
when: ansible_distribution_major_version|int == 24
tags:
- jenkins
- jenkins/slave
- packages
- name: create jenkins user
user: name=jenkins state=present createhome=yes system=no groups=mock
tags:
- jenkins
- jenkins/slave
- config
- name: add jenkins ssh public key to authorized keys
authorized_key: user=jenkins key="{{ item }}"
with_file:
- "{{ private }}/files/jenkins/ssh/jenkins_master.pub"
tags:
- jenkins
- jenkins/slave
- config
# Haveged is not needed per se, but very useful for builds that require lots of entropy
# Hello, Ipsilon
- name: install haveged
dnf: name=haveged state=present
when: is_fedora is defined and ansible_distribution_major_version|int > 21
tags:
- jenkins
- jenkins/slave
- packages
- name: enable haveged service to start on boot
service: name=haveged state=started enabled=true
when: is_fedora is defined and ansible_distribution_major_version|int > 21
tags:
- jenkins
- jenkins/slave
- service
- name: create workspace directory
file: state=directory path=/srv/jenkins owner=jenkins group=jenkins
tags:
- jenkins
- jenkins/slave
- config
- name: set /etc/hosts with local ip for loopback tests.
template: src=hosts dest=/etc/hosts owner=root group=root
tags:
- jenkins
- jenkins/slave
- config