-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_git_nodemasters.yml
82 lines (73 loc) · 2.37 KB
/
update_git_nodemasters.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
- hosts: nodemasters
become: true
gather_facts: true
tasks:
- name: "Ensure Git Repository on Master is up to date"
git:
# repo: https://github.com/lmu/lmu.ansible.playbooks.git
repo: [email protected]:lmu/lmu.ansible.playbooks.git
dest: /opt/lmu.ansible.playbooks
update: yes
clone: no
recursive: yes
track_submodules: yes
become: True
become_user: fachadmin
environment:
http_proxy: "{{ lookup('env', 'http_proxy') }}"
https_proxy: "{{ lookup('env', 'https_proxy') }}"
ignore_errors: yes
- name: "Ensure playbook directories has correct owner and group"
file:
path="/opt/lmu.ansible.playbooks"
state=directory
owner="fachadmin"
group="ansible"
mode="u=rwX,g=rwX,o=rX"
recurse=yes
- name: "Ensure Inventory-Enabled"
file:
dest="/opt/lmu.ansible.playbooks/inventory-enabled/{{ item }}"
src="/opt/lmu.ansible.playbooks/inventory-avaliable/{{ item }}"
state=link
owner="fachadmin"
group="ansible"
with_items:
- nodemasters
- plone
- solr
- webproxies
- name: "Ensure Inventory"
file:
dest="/opt/lmu.ansible.playbooks/inventory"
src="/opt/lmu.ansible.playbooks/inventory-enabled"
state=link
owner="fachadmin"
group="ansible"
- name: "Ensure inventory / cmdb directories has correct file modes"
file:
path="{{ item }}"
state=directory
owner="fachadmin"
group="ansible"
mode="u=rwx,g=rwx,o=rx"
with_items:
- "/opt/lmu.ansible.playbooks/inventory-avaliable"
- "/opt/lmu.ansible.playbooks/inventory-enabled"
- "/opt/lmu.ansible.playbooks/unchecked-out"
- "/opt/lmu.ansible.playbooks/checked-out"
- "/opt/lmu.ansible.playbooks/cmdb"
ignore_errors: yes
- name: "Ensure inventory / cmdb files has correct file modes"
file:
path="{{ item }}"
state=file
owner="fachadmin"
group="ansible"
mode="u=rw,g=rw,o=r"
with_fileglob:
- "/opt/lmu.ansible.playbooks/inventory-avaliable/*"
- "/opt/lmu.ansible.playbooks/unchecked-out/*"
- "/opt/lmu.ansible.playbooks/checked-out/*"
- "/opt/lmu.ansible.playbooks/cmdb/*"
ignore_errors: yes