-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yml
112 lines (101 loc) · 2.56 KB
/
main.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
---
- hosts: serviceding.in.devtal.de
vars_files:
- vars/http.yml
tasks:
- name: install update script
copy:
src: "statespace_update"
dest: "/usr/local/bin/statespace_update"
force: yes
mode: 0755
- name: create update user
user:
name: statespace
group: nogroup
system: yes
createhome: no
home: /tmp
- name: install update wgetrc
template:
src: "statespace-wgetrc.j2"
dest: "/usr/local/etc/statespace-wgetrc"
force: yes
owner: statespace
group: root
mode: 0460
- name: edit crontab
lineinfile:
dest: /etc/crontab
line: "{{item}}"
state: present
with_items:
- "*/5 *\t* * *\tstatespace\t/usr/local/bin/statespace_update 192.168.1.4"
- "0 */2\t* * *\tstatespace\t/usr/local/bin/statespace_update 192.168.1.4 -f"
- hosts: moon.devtal.de
vars_files:
- vars/http.yml
tasks:
- name: install htpasswd ansible module requirement passlib
pip:
name: passlib
state: present
extra_args: --user
- htpasswd:
path: /home/thoto/public_html/statespace/.htpasswd
name: monika
password: "{{http_pass}}"
owner: thoto
group: www-data
mode: 0640
- name: copy htaccess
copy:
src: "htaccess"
dest: "/home/thoto/public_html/statespace/.htaccess"
force: yes
owner: thoto
group: www-data
mode: 0640
- name: ensure state.txt present and has correct permissions
file:
dest: "/home/thoto/public_html/statespace/state.txt"
state: file
owner: thoto
group: www-data
mode: 0660
- name: copy library
copy:
src: "spaceopen2.inc.php"
dest: "{{item}}"
force: yes
owner: thoto
group: www-data
mode: 0755
with_items:
- "/home/thoto/public_html/statespace/spaceopen2.inc.php"
- "/var/www/devtal.de/htdocs/blog/wp-content/plugins/spaceopenstatus/spaceopen2.inc.php"
- name: copy PHP frontend files
copy:
src: "{{item}}"
dest: "/home/thoto/public_html/statespace/{{item}}"
force: yes
owner: thoto
group: www-data
mode: 0755
with_items:
- "change.php"
- "state.php"
- "index.php"
- name: copy images
copy:
src: "{{item}}"
dest: "/home/thoto/public_html/statespace/{{item}}"
force: yes
mode: 0644
with_items:
- "dt-offen.png"
- "dt-geschlossen.png"
- name: remove html index file
file:
dest: "/home/thoto/public_html/statespace/index.html"
state: absent