-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvagrant.yml
More file actions
129 lines (112 loc) · 2.55 KB
/
Copy pathvagrant.yml
File metadata and controls
129 lines (112 loc) · 2.55 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
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
---
# ubuntu/xenial64
- hosts: all
become: yes
vars:
- user: ubuntu
- name: thugd
- autostart: false
tasks:
- name: hostname
hostname:
name: "{{name}}"
- name: /etc/hosts - hostname
replace:
dest: "/etc/hosts"
regexp: "127.0.0.1.*"
replace: "127.0.0.1 localhost {{name}}"
- name: prompt
lineinfile:
dest: "~/.profile"
line: "PS1='\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ '"
become: "{{user}}"
- name: create files
file:
state: touch
dest: "{{item}}"
with_items:
- .Xauthority
- .hushlogin
become: "{{user}}"
- name: docker apt-key
apt_key:
keyserver: hkp://ha.pool.sks-keyservers.net:80
id: 58118E89F3A912897C070ADBF76221572C52609D
state: present
- name: docker apt-repo
apt_repository:
repo: "deb https://apt.dockerproject.org/repo ubuntu-xenial main"
state: present
- name: update system
apt:
update_cache: yes
cache_valid_time: 86400
upgrade: full
- name: remove packages
apt:
name: "{{item}}"
state: absent
with_items:
- augeas-lenses
- bundler
- chef
- chef-zero
- erubis
- facter
- puppet-common
- ruby
- ruby1.9.1-dev
- name: system packages
apt:
name: "{{item}}"
state: latest
with_items:
- docker-engine
- git
- iftop
- lsof
- mongodb
- nmap
- python-pip
- python3
- python3-pip
- tcpdump
- tmux
- tree
- vim
- xsel
- name: mongodb bind_ip
replace:
dest: /etc/mongodb.conf
regexp: "^bind_ip.*"
replace: "bind_ip = 0.0.0.0"
register: mongodb
- name: mongodb service
service:
name: mongodb
state: restarted
when: mongodb.changed
- name: python packages
pip:
name: "{{item}}"
state: latest
executable: pip3
requirements: /thugd/requirements.txt
- name: update facts
setup:
gather_subset: network
- name: /etc/hosts - rabbitmq
lineinfile:
dest: "/etc/hosts"
line: "{{item}}"
state: present
with_items:
- "{{ansible_docker0['ipv4']['address']}} rabbitmq mongodb"
- name: docker-compose up
docker_service:
project_name: "thugd"
project_src: "/thugd"
scale:
thuglet: 3
state: present
when: autostart