-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.yml
More file actions
96 lines (81 loc) · 2.3 KB
/
main.yml
File metadata and controls
96 lines (81 loc) · 2.3 KB
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
- hosts: all
vars:
- mysql_password: 326_jenkins_326
- jenkins_rsa_pubkey: "{{ lookup('file', 'jenkins_rsa.pub') }}"
- email: csc326ta18@gmail.com
- email_password: fillin
pre_tasks:
- name: update apt-get cache
command: apt-get update
become: yes
roles:
- {role: geerlingguy.java, become: yes}
- role: geerlingguy.mysql
mysql_root_password: "{{mysql_password}}"
mysql_user_password: "{{mysql_password}}"
mysql_bind_address: 127.0.0.1
become: yes
tasks:
- name: Ensure group "jenkins" exists
group:
name: jenkins
state: present
become: yes
- name: Add the user 'jenkins' to group 'jenkins'
user:
name: jenkins
comment: Jenkins user
group: jenkins
become: yes
- name: Get jenkins executor url
get_url:
url: https://csc326-jenkins.csc.ncsu.edu/jenkins/jnlpJars/slave.jar/
dest: /home/jenkins
validate_certs: False
become_user: jenkins
become: yes
- name: Set authorized key
authorized_key:
user: jenkins
state: present
key: "{{jenkins_rsa_pubkey}}"
become: yes
# Useful for local debugging
- name: ensure config dir exists
file:
path: ~/settings
state: directory
- name: copy db template
template:
src: templates/db.properties.template
dest: ~/settings/db.properties
- name: copy email template
template:
src: templates/email.properties.template
dest: ~/settings/email.properties
# Keep copy for jenkins user.
- name: copy settings for jenkins user too.
shell: cp -r {{ ansible_env.HOME}}/settings/ /home/jenkins/
# become_user: jenkins
become: yes
- name: Install maven
apt:
update_cache: yes
package: maven
become: yes
- name: create symlink for maven
file:
src: /usr/share/maven
dest: /opt/maven
state: link
become: yes
- name: Install chrome
apt:
update_cache: yes
deb: https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
become: yes
- name: Install security module for chrome
apt:
update_cache: yes
package: libnss3
become: yes