blob: 961107ce7b9081d8b8ed2b781320b99108be637d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
- name: install common slave packages (dnf)
dnf: name={{ item }} state=installed
with_items: "{{ slave_packages_common }}"
when: ansible_distribution_major_version|int > 21
tags:
- jenkins
- jenkins/slave
- packages
- name: install common slave packages (yum)
yum: name={{ item }} state=installed
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=installed
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)
yum: name={{ item }} state=installed
with_items: "{{ slave_packages_centos }}"
when: ansible_distribution_major_version|int < 8
tags:
- jenkins
- jenkins/slave
- packages
- name: install el7 specific slave packages
yum: name={{ item }} state=installed
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=installed
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=installed
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=installed
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
|