-
Notifications
You must be signed in to change notification settings - Fork 10
/
update.yml
220 lines (183 loc) · 8.85 KB
/
update.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
---
- hosts: all
pre_tasks:
- name: 'Verify Ansible meets AAF Installer version requirments.'
assert:
that: "ansible_version.full is version_compare('2.6', '>=')"
msg: "You must update Ansible to at least 2.6 to use this version of the AAF IdP Installer."
- hosts: idp-servers
vars:
installer:
root: "{{ install_base }}/shibboleth-idp-installer"
path: "{{ install_base }}/shibboleth-idp-installer/build"
repository: "{{ install_base }}/shibboleth-idp-installer/repository"
tasks:
- name: 'Create directory for credentials'
file:
name: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/credentials'
owner: root
group: root
mode: 0644
state: directory
- name: 'Backup IdP 3.x credentails only if they have not been backed up'
copy:
src: '{{ install_base }}/shibboleth/shibboleth-idp/current/credentials/{{ item }}'
dest: 'assets/{{ inventory_hostname }}/idp/credentials'
owner: root
group: root
mode: 0644
force: no
with_items:
- idp-backchannel.crt
- idp-backchannel.p12
- idp-encryption.crt
- idp-encryption.key
- idp-signing.crt
- idp-signing.key
- idp-backchannel.p12
- sealer.jks
- sealer.kver
- name: 'Create directories that may be missing'
file:
name: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/{{item}}'
owner: root
group: root
mode: 0644
state: directory
with_items:
- 'views'
- 'views/intercept'
- 'messages'
- 'webapp'
- 'webapp/css'
- 'webapp/images'
- 'webapp/js'
- name: 'Move file - authn-messages.properties if it exists in its old location'
stat:
path: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/authn-messages.properties'
register: file_exists
- copy:
src: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/authn-messages.properties'
dest: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/messages/authn-messages.properties'
when: file_exists.stat.exists == True
- file:
path='{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/authn-messages.properties'
state=absent
- name: 'Move file - consent-messages.properties if it exists in its old location'
stat:
path: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/consent-messages.properties'
register: file_exists
- copy:
src: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/consent-messages.properties'
dest: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/messages/consent-messages.properties'
when: file_exists.stat.exists == True
- file:
path='{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/consent-messages.properties'
state=absent
- name: 'Move file - error-messages.properties if it exists in its old location'
stat:
path: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/error-messages.properties'
register: file_exists
- copy:
src: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/error-messages.properties'
dest: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/messages/error-messages.properties'
when: file_exists.stat.exists == True
- file:
path='{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/error-messages.properties'
state=absent
- name: 'Move file - views/attribute-release.vm if it exists in its old location'
stat:
path: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/views/attribute-release.vm'
register: file_exists
- copy:
src: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/views/attribute-release.vm'
dest: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/views/intercept/attribute-release.vm'
when: file_exists.stat.exists == True
- file:
path='{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/views/attribute-release.vm'
state=absent
- name: 'Move file - css/consent.css if it exists in its old location'
stat:
path: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/css/consent.css'
register: file_exists
- copy:
src: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/css/consent.css'
dest: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/webapp/css/consent.css'
when: file_exists.stat.exists == True
- file:
path='{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/css/consent.css'
state=absent
- name: 'Move file - css/main.css if it exists in its old location'
stat:
path: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/css/main.css'
register: file_exists
- copy:
src: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/css/main.css'
dest: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/webapp/css/main.css'
when: file_exists.stat.exists == True
- file:
path='{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/css/main.css'
state=absent
- name: 'Move file - images/logo.png if it exists in its old location'
stat:
path: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/images/logo.png'
register: file_exists
- copy:
src: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/images/logo.png'
dest: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/webapp/images/logo.png'
when: file_exists.stat.exists == True
- file:
path='{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/images/logo.png'
state=absent
- name: 'Move file - images/logo-mobile.png if it exists in its old location'
stat:
path: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/images/logo-mobile.png'
register: file_exists
- copy:
src: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/images/logo-mobile.png'
dest: '{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/webapp/images/logo-mobile.png'
when: file_exists.stat.exists == True
- file:
path='{{ installer.repository }}/assets/{{inventory_hostname}}/idp/branding/images/logo-mobile.png'
state=absent
- name: 'Copy example files to assets only if they do not exist'
copy:
src: '{{ installer.repository }}/assets/idp.example.edu.dist/'
dest: '{{ installer.repository }}/assets/{{inventory_hostname}}'
force: no
- name: 'Add server_patch to host_vars if it does not exist'
lineinfile:
path: '{{ installer.repository }}/host_vars/{{inventory_hostname}}'
line: "\n# Run yum -update on every execution of update_idp.sh\nserver_patch: \"true\""
insertafter: EOF
when: server_patch is not defined
- name: 'Add firewall to host_vars if it does not exist'
lineinfile:
path: '{{ installer.repository }}/host_vars/{{inventory_hostname}}'
line: "\n# Installed Firewall\nfirewall: \"firewalld\""
insertafter: EOF
when: firewall is not defined
- name: 'Add enable_backchannel to host_vars if it does not exist'
lineinfile:
path: '{{ installer.repository }}/host_vars/{{inventory_hostname}}'
line: "\n# Enable back channel\nenable_backchannel: \"false\""
insertafter: EOF
when: enable_backchannel is not defined
- name: 'Add edugain_metadata_url to host_vars if it does not exist'
lineinfile:
path: '{{ installer.repository }}/host_vars/{{inventory_hostname}}'
line: "\n# eduGAIN metadata\nedugain_metadata_url: \"https://md.aaf.edu.au/aaf-edugain-metadata.xml\""
insertafter: EOF
when: edugain_metadata_url is not defined
- name: 'Add enable_edugain to host_vars if it does not exist'
lineinfile:
path: '{{ installer.repository }}/host_vars/{{inventory_hostname}}'
line: "\n# Enable eduGAIN\nenable_edugain: \"false\""
insertafter: EOF
when: enable_edugain is not defined
- name: 'Add enable_shibcas to host_vars if it does not exist'
lineinfile:
path: '{{ installer.repository }}/host_vars/{{inventory_hostname}}'
line: "\n# Enable shibCAS\nenable_shibcas: \"false\""
insertafter: EOF
when: enable_shibcas is not defined