-
Notifications
You must be signed in to change notification settings - Fork 4
/
playbook.yaml
105 lines (86 loc) · 3.26 KB
/
playbook.yaml
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
---
- hosts: default
gather_facts: false
vars:
bamboo: atlassian-bamboo
bamboover: 5.4
dlpath: software/bamboo/downloads/binary
tmp: /var/tmp
installto: /opt
datahome: /srv/bamboo-data
svcuser: bamboo
dbuser: bamboouser
dbpass: bamb00p4ss
tasks:
- name: Ensure libselinux-python installed
yum: name=libselinux-python state=present
- name: Ensure EPEL RPM installed
yum:
name=http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
state=present
# You don't need this - it's because I can't type anything other than 'l'
- name: Ensure aliases.sh present
copy: src=files/aliases.sh dest=/etc/profile.d/aliases.sh
owner=root group=root mode=0644
- name: Ensure Java and MySQL packages are installed
yum: name={{ item }} state=installed
with_items:
- mysql-server
- java-1.7.0-openjdk
- mysql-connector-java
- MySQL-python
- git
- name: Ensure mysql server running
service: name=mysqld state=started enabled=yes
- name: Fetch Bamboo install
get_url:
url=http://www.atlassian.com/{{ dlpath }}/{{ bamboo }}-{{ bamboover }}.tar.gz
dest={{ tmp }}/bamboo.tgz
register: fetch
tags: install
- name: Ensure bamboo group exists
group: name={{ svcuser }} state=present
- name: Ensure bamboo user exists
user: name={{ svcuser }} group={{ svcuser }} state=present
- name: Extract Bamboo installation
shell: tar xvf {{ tmp }}/bamboo.tgz -C {{ installto }} --transform='s#\(atlassian\)-#\1/#'
when: fetch.changed
tags: install
- name: Ensure bamboo user owns bamboo dir
file: path={{ installto }}/atlassian/bamboo-{{ bamboover }}
owner={{ svcuser }} group={{ svcuser }} state=directory recurse=yes
tags: install
- name: Set Bamboo data dir
lineinfile:
dest={{ installto }}/atlassian/bamboo-{{ bamboover }}/atlassian-bamboo/WEB-INF/classes/bamboo-init.properties
regexp="^bamboo.home"
line="bamboo.home={{ datahome }}"
tags: install
- name: Ensure service user can write to data dir
file: path={{ datahome }} owner={{ svcuser }} group={{ svcuser }} state=directory
- name: Ensure mysql-jdbc connector symlinked
file:
src=/usr/share/java/mysql-connector-java.jar
path={{ installto }}/atlassian/bamboo-{{ bamboover }}/lib/mysql-connector-java.jar
state=link
tags: install
- name: Ensure Bamboo database exists
mysql_db: name=bamboo encoding=utf8 collation=utf8_bin
- name: Ensure Bambo data user exists
mysql_user:
name={{ dbuser }}
password={{ dbpass }}
priv=bamboo.*:ALL
state=present
- name: Ensure Bamboo service exists
template: src=templates/bamboo.init.j2 dest=/etc/init.d/bamboo
owner=root group=root mode=0755
tags: install
- name: Ensure Bamboo logs symlink exists
file: src={{ installto }}/atlassian/bamboo-{{ bamboover }}/logs
path=/var/log/bamboo
state=link
tags: install
- name: Ensure Bamboo service is set to run
service: name=bamboo state=started enabled=yes
# vim: set ts=2 sw=2: