author | ymh <ymh.work@gmail.com> |
Mon, 17 Sep 2018 18:32:48 +0200 | |
changeset 8 | 24a3d661309f |
parent 5 | b26c9c44dd84 |
permissions | -rw-r--r-- |
0
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
--- |
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
# |
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
# all actions |
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
# |
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
- hosts: all |
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
become: true |
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
tasks: |
5
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
8 |
- name: set eth1 interface |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
9 |
blockinfile: |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
10 |
path: /etc/network/interfaces |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
11 |
block: | |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
12 |
auto eth1 |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
13 |
iface eth1 inet static |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
14 |
address 172.16.1.7 |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
15 |
netmask 255.255.255.0 |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
16 |
register: eth1_added |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
17 |
- name: restart network service |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
18 |
service: |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
19 |
name: networking |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
20 |
state: restarted |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
21 |
when: eth1_added.changed |
0
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
22 |
- name: install deps |
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
23 |
apk: |
5
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
24 |
name: python-dev,python3-dev,py-virtualenv,nginx,supervisor,build-base,musl-dev,gcc,linux-headers,libffi,libffi-dev, shadow@community |
0
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
25 |
update_cache: yes |
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
26 |
- name: create etc supervisor.d folder |
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
27 |
file: |
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
28 |
path: /etc/supervisor.d |
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
29 |
state: directory |
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
30 |
- name: starts supervisord |
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
31 |
service: |
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
32 |
name: supervisord |
5f4fcbc80b37
Create new repository to host all dashboard developments
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
33 |
state: started |
5
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
34 |
- name: Set authorized key for user vagrant copying it from current user |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
35 |
authorized_key: |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
36 |
user: vagrant |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
37 |
state: present |
b26c9c44dd84
correct deploy scripts and deploy tests
ymh <ymh.work@gmail.com>
parents:
2
diff
changeset
|
38 |
key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}" |