-
Notifications
You must be signed in to change notification settings - Fork 7
/
playenv.yaml
58 lines (42 loc) · 1.91 KB
/
playenv.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
# Sets the Play environment in the server
# Run with: ansible-playbook -i hosts.ini playenv.yaml -u ubuntu --sudo
---
- hosts: ec2Instance
vars:
- ubuntu_release: quantal
- user: ubuntu
- group: $user
- repo_url: git://github.com/kaiinkinen/pvm.git
- repo_remote: origin
- repo_version: master
- pvm: /home/ubuntu/pvm
- play_version: 2.1.1
tasks:
- name: Install Unzip
action: apt pkg=unzip state=latest install_recommends=yes
- name: Install Git
action: apt pkg=git state=latest install_recommends=yes
- name: Install Authbind
action: apt pkg=authbind state=latest install_recommends=yes
- name: Configure Authbind
action: copy content="" dest=/etc/authbind/byport/80 owner=$user group=$group mode=0500
- name: Remove old PVM checkouts
action: file path=${pvm} state=absent
- name: Checkout PVM from Git
action: git repo=$repo_url dest=$pvm remote=$repo_remote version=$repo_version
- name: Turn PVM into bash script
action: lineinfile dest=${pvm}/pvm.sh regexp="^# Play Version Manager" line="#!/bin/bash" state=present
- name: Set PVM environment and install Play $play_version
action: raw . ${pvm}/pvm.sh && pvm install $play_version && pvm use $play_version
- name: Set $user as PVM owner
action: file path=${pvm} owner=$user group=$group recurse=yes state=directory
- name: Add Java repository to sources
action: apt_repository repo='ppa:webupd8team/java'
- name: Autoaccept license for Java
action: shell echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
- name: Update APT package cache
action: apt update_cache=yes
- name: Install Java 7
action: apt pkg=oracle-java7-installer state=latest install_recommends=yes
- name: Set Java 7 Env
action: apt pkg=oracle-java7-set-default state=latest install_recommends=yes