-
Notifications
You must be signed in to change notification settings - Fork 1
/
traffic-control-dev.yml
87 lines (71 loc) · 3.15 KB
/
traffic-control-dev.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
---
# file: traffic-control-dev.yml
- hosts: traffic-control-dev
become: yes
vars:
#jdk_url: http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.rpm
#jdk_url: http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.rpm
jdk_url: http://download.oracle.com/otn-pub/java/jdk/8u102-b14/jdk-8u102-linux-x64.rpm
download_folder: /vagrant/{{ ansible_distribution_major_version }}/.cache/download
maven_url: http://ftp.wayne.edu/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tasks:
- name: Create RPM cache directory
file: name={{ item }} state=directory
with_items:
- /vagrant/{{ ansible_distribution_major_version }}/.cache
- /vagrant/{{ ansible_distribution_major_version }}/.cache/download
- name: Change Yum Cache directory
ini_file: dest=/etc/yum.conf section=main option=cachedir value='/vagrant/{{ ansible_distribution_major_version }}/.cache'
- name: Enable Yum to keep files after installation
ini_file: dest=/etc/yum.conf section=main option=keepcache value=1
- name: Installation of base packages
yum: name={{ item }} state=present
with_items:
- epel-release
- centos-release-scl
- rpm-build
- git
- libselinux-python
- perl-CPAN
- perl-YAML
- perl-devel
- gcc
- name: Install Git 1.9 from SCL
yum: name=git19 state=present
- name: Install GoLang
yum: name=golang state=present
- name: Create some directories for GO
file: name={{ item }} state=directory owner=vagrant group=vagrant
with_items:
- /home/vagrant/go
- name: Configure GOPATH
lineinfile:
dest: "/home/vagrant/.bashrc"
line: "export GOPATH=/home/vagrant/go"
# - name: Download Oracle Java JDK
# get_url: src=http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.rpm
# dest=/vagrant/.cache/jdk-7u67-linux-x64.rpm
# headers="Cookie:oraclelicense=accept-securebackup-cookie"
# #creates=/vagrant/.cache/jdk-7u67-linux-x64.rpm
- name: Download Oracle Java SDK
command: "wget -q -O {{ jdk_url|basename }} --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' {{ jdk_url }}"
args:
chdir: "{{ download_folder }}"
creates: "{{ jdk_url|basename }}"
#creates={{ download_folder }}/{{ jdk_url|basename }}"
- name: Install Oracle Java JDK
yum: name="{{ download_folder }}/{{ jdk_url|basename }}" state=present
- name: Download Apache Maven
get_url: url={{ maven_url }} dest={{ download_folder}}/{{ maven_url|basename }}
# Ansible 1.9 bug...
# - name: Extract Apache Maven
# unarchive: src={{ download_folder }}/{{ maven_url|basename }} dest=/opt
- name: Extract Apache Maven
command: tar xvfz {{ download_folder }}/{{ maven_url|basename }}
args:
chdir: /opt
creates: /opt/apache-maven-3.3.9/README.txt
- name: Add Maven to path
lineinfile:
dest: /home/vagrant/.bashrc
line: export PATH=/opt/apache-maven-3.3.9/bin:$PATH