-
Notifications
You must be signed in to change notification settings - Fork 31
/
config.yml
59 lines (54 loc) · 1.89 KB
/
config.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
---
- name: Tomcat | Delete pre-installed folders in webapps
file:
path: "{{ tomcat_webapps_path }}/{{ item.key }}/"
state: absent
with_dict: "{{ tomcat_pre_installed_folders_deployed }}"
when: 'not item.value.deployed'
- name: Tomcat | Copy tomcat config
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0640
owner: "{{ tomcat_user }}"
group: "{{ tomcat_group }}"
with_items:
- { src: "tomcat-users.xml.j2", dest: "{{ tomcat_conf_path }}/tomcat-users.xml" }
- { src: "server.xml.j2", dest: "{{ tomcat_conf_path }}/server.xml" }
- { src: "setenv.sh.j2", dest: "{{ tomcat_bin_path }}/setenv.sh" }
- { src: "logging.properties.j2", dest: "{{ tomcat_conf_path }}/logging.properties" }
notify: restart tomcat
- name: Tomcat | Ensure extra tomcat config file and template paths exists
file:
path: "{{ tomcat_conf_path }}/{{ item.path }}"
state: directory
owner: "{{ tomcat_user }}"
group: "{{ tomcat_group }}"
mode: 0640
with_filetree:
- "{{ tomcat_extra_conf_path }}/"
- "{{ tomcat_extra_conf_template_path }}/"
when: item.state == "directory"
notify: restart tomcat
- name: Tomcat | Copy extra tomcat config files (provided by playbooks)
copy:
src: "{{ item.src }}"
dest: "{{ tomcat_conf_path }}/{{ item.path }}"
owner: "{{ tomcat_user }}"
group: "{{ tomcat_group }}"
mode: 0640
with_filetree:
- "{{ tomcat_extra_conf_path }}/"
when: item.state == "file"
notify: restart tomcat
- name: Tomcat | Copy extra tomcat config templates (provided by playbooks)
template:
src: "{{ item.src }}"
dest: "{{ tomcat_conf_path }}/{{ item.path | splitext | first }}" # This is to remove .j2 extension
owner: "{{ tomcat_user }}"
group: "{{ tomcat_group }}"
mode: 0640
with_filetree:
- "{{ tomcat_extra_conf_template_path }}/"
when: item.state == "file"
notify: restart tomcat