-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
166 lines (155 loc) · 8.22 KB
/
playbook.yml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#!/usr/bin/env ansible-playbook
- name: Gather prerequisites
hosts: all
gather_facts: True
tasks:
- name: create groups based on distribution
group_by: key={{ ansible_distribution }}
- name: Install Version Control Systems
hosts: Ubuntu
sudo: True
tasks:
- name: Install Git
apt: name=git state=latest update_cache=true cache_valid_time=600
- name: Install Utilities
hosts: Ubuntu
sudo: True
tasks:
- name: Install sshpass for some of the Docker scripting
apt: name=sshpass state=latest update_cache=true cache_valid_time=600
- name: Install JDK
hosts: Ubuntu
sudo: True
tasks:
- name: Download Java 8 JDK
command: wget --quiet --output-document=/root/jdk-8.tar.gz --no-check-certificate --no-cookies --header "Cookie:oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u60-b27/jdk-8u60-linux-x64.tar.gz
- name: Create destination directory
file: path=/usr/lib/jvm owner=root group=root state=directory mode=755
- name: unpack the archive
unarchive: src=/root/jdk-8.tar.gz dest=/usr/lib/jvm copy=no owner=root group=root mode=755 creates=/usr/lib/jvm/jdk1.8.0_60/COPYRIGHT
- name: soft-link the JDK to a normalized location
file: src=/usr/lib/jvm/jdk1.8.0_60 dest=/usr/lib/jvm/oracle-jdk-8 owner=root group=root state=link
- name: Export JDK_HOME
lineinfile: dest=/etc/environment line='JDK_HOME=/usr/lib/jvm/oracle-jdk-8'
- name: Export JAVA_HOME
lineinfile: dest=/etc/environment line='JAVA_HOME=/usr/lib/jvm/oracle-jdk-8'
- name: Export JAVA_CMD
lineinfile: dest=/etc/environment line='JAVA_CMD=/usr/lib/jvm/oracle-jdk-8/bin/java'
- name: Install The Software Development Kit Manager
hosts: Ubuntu
sudo: True
tasks:
- debug: msg="ansible_env.SUDO_USER = {{ ansible_env.SUDO_USER }}"
- debug: msg="ansible_env.SUDO_UID = {{ ansible_env.SUDO_UID }}"
- debug: msg="ansible_env.SUDO_GID = {{ ansible_env.SUDO_GID }}"
- debug: msg="ansible_env.USER = {{ ansible_env.USER }}"
- debug: msg="ansible_env.USERNAME = {{ ansible_env.USERNAME }}"
- debug: msg="ansible_env.LOGNAME = {{ ansible_env.LOGNAME }}"
- debug: msg="ansible_env.HOME = {{ ansible_env.HOME }}"
- debug: msg="ansible_user_id = {{ ansible_user_id }}"
- name: Install cURL
apt: name=curl state=latest
- name: Copy GVM installation script to a safe place
copy: src=scripts/install-gvm.sh dest=/tmp/install-gvm.sh owner=vagrant group=vagrant mode=755 backup=no
- name: Install GVM
shell: sudo --user vagrant --set-home --non-interactive --login /tmp/install-gvm.sh --
- name: Create destination director
file: path=/home/vagrant/.gvm/etc owner=vagrant group=vagrant state=directory mode=755
- name: Copy GVM configuration file
copy: src=files/gvm.config dest=/home/vagrant/.gvm/etc/config owner=vagrant group=vagrant mode=644 backup=no
- name: Set permissions on the home directory
file: path=/home/vagrant owner=vagrant group=vagrant recurse=true state=directory
- name: Apache Ant bits
hosts: Ubuntu
sudo: False
tasks:
- debug: msg="ansible_env.SUDO_USER = {{ ansible_env.SUDO_USER }}"
- debug: msg="ansible_env.SUDO_UID = {{ ansible_env.SUDO_UID }}"
- debug: msg="ansible_env.SUDO_GID = {{ ansible_env.SUDO_GID }}"
- debug: msg="ansible_env.USER = {{ ansible_env.USER }}"
- debug: msg="ansible_env.USERNAME = {{ ansible_env.USERNAME }}"
- debug: msg="ansible_env.LOGNAME = {{ ansible_env.LOGNAME }}"
- debug: msg="ansible_env.HOME = {{ ansible_env.HOME }}"
- debug: msg="ansible_user_id = {{ ansible_user_id }}"
- name: Create Software directory
file: path=/home/vagrant/Software owner=vagrant group=vagrant state=directory mode=755
- name: Create Downloads directory
file: path=/home/vagrant/Downloads owner=vagrant group=vagrant state=directory mode=755
- name: Download Ant
get_url: url=http://mirrors.ibiblio.org/apache/ant/binaries/apache-ant-1.9.7-bin.tar.gz dest=/home/vagrant/Downloads/ant.tar.gz mode=444
- name: Unpack Ant
unarchive: src=/home/vagrant/Downloads/ant.tar.gz dest=/home/vagrant/Software copy=no owner=vagrant group=vagrant creates=/home/vagrant/Software/apache-ant-1.9.7/README
- name: Soft-link Ant
file: src=/home/vagrant/Software/apache-ant-1.9.7 path=/home/vagrant/Software/ant state=link
- name: Export ANT_HOME
lineinfile: dest=/etc/environment line='ANT_HOME=/home/vagrant/Software/ant'
- name: Set permissions on the home directory
file: path=/home/vagrant owner=vagrant group=vagrant recurse=true state=directory
- name: Apache Maven bits
hosts: Ubuntu
sudo: False
tasks:
- name: Create Software directory
file: path=/home/vagrant/Software owner=vagrant group=vagrant state=directory mode=755
- name: Create Downloads directory
file: path=/home/vagrant/Downloads owner=vagrant group=vagrant state=directory mode=755
- name: Download Maven
get_url: url=http://mirrors.m247.ro/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz dest=/home/vagrant/Downloads/maven.tar.gz mode=444
- name: Unpack Maven
unarchive: src=/home/vagrant/Downloads/maven.tar.gz dest=/home/vagrant/Software copy=no owner=vagrant group=vagrant creates=/home/vagrant/Software/apache-maven-3.3.9/NOTICE
- name: Soft-link Maven
file: src=/home/vagrant/Software/apache-maven-3.3.9 path=/home/vagrant/Software/maven state=link
- name: Export M2_HOME
lineinfile: dest=/etc/environment line='M2_HOME=/home/vagrant/Software/maven'
- name: Set permissions on the home directory
file: path=/home/vagrant owner=vagrant group=vagrant recurse=true state=directory
- name: Jetbrains IntelliJ IDEA
hosts: Ubuntu
sudo: False
tasks:
- name: Create Software directory
file: path=/home/vagrant/Software owner=vagrant group=vagrant state=directory mode=755
- name: Create Downloads directory
file: path=/home/vagrant/Downloads owner=vagrant group=vagrant state=directory mode=755
- name: Download IntelliJ IDEA
get_url: url=http://download.jetbrains.com/idea/ideaIU-14.1.5.tar.gz dest=/home/vagrant/Downloads/idea.tar.gz mode=444
- name: Unpack IntelliJ IDEA
unarchive: src=/home/vagrant/Downloads/idea.tar.gz dest=/home/vagrant/Software copy=no owner=vagrant group=vagrant creates=/home/vagrant/Software/idea-IU-141.2735.5/build.txt
- name: Soft-link IntelliJ
file: src=/home/vagrant/Software/idea-IU-141.2735.5 path=/home/vagrant/Software/idea state=link
- name: Create Desktop directory
file: path=/home/vagrant/Desktop owner=vagrant group=vagrant state=directory mode=755
- name: Copy desktop IntelliJ file
copy: src=files/InjelliJ.desktop dest=/home/vagrant/Desktop/InjelliJ.desktop owner=vagrant group=vagrant backup=no mode=755
- name: Export IDEA_JDK
lineinfile: dest=/etc/environment line='IDEA_JDK=/usr/lib/jvm/oracle-jdk-8'
- name: Set permissions on the home directory
file: path=/home/vagrant owner=vagrant group=vagrant recurse=true state=directory
- name: MySQL Tools
hosts: Ubuntu
sudo: True
tasks:
- name: Install MySQL client
apt: name=mysql-client state=latest
- name: Install MySQL Workbench
apt: name=mysql-workbench state=latest
- name: Create Source Folders
hosts: Ubuntu
sudo: False
tasks:
- name: Create GitHub directory
file: path=/home/vagrant/GitHub owner=vagrant group=vagrant state=directory mode=755
- name: Create Bitbucket directory
file: path=/home/vagrant/Bitbucket owner=vagrant group=vagrant state=directory mode=755
- name: Create Stash directory
file: path=/home/vagrant/Stash owner=vagrant group=vagrant state=directory mode=755
- name: Add host names for Dockered services
hosts: Ubuntu
sudo: True
tasks:
- lineinfile: dest=/etc/hosts line='127.0.0.1 mongo'
- lineinfile: dest=/etc/hosts line='127.0.0.1 mongodb'
- lineinfile: dest=/etc/hosts line='127.0.0.1 redis'
- lineinfile: dest=/etc/hosts line='127.0.0.1 mysql'
- lineinfile: dest=/etc/hosts line='127.0.0.1 postgresql'
- lineinfile: dest=/etc/hosts line='127.0.0.1 rabbitmq'