/[pdpsoft]/trunk/novalocal-test-delegserver/DS/roles/delegserver/tasks/oa4mp-server.yml
ViewVC logotype

Contents of /trunk/novalocal-test-delegserver/DS/roles/delegserver/tasks/oa4mp-server.yml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3086 - (show annotations) (download) (as text)
Mon Aug 15 14:24:28 2016 UTC (6 years, 1 month ago) by tamasb
File MIME type: text/x-yaml
File size: 3753 byte(s)
make backups of tomcate config files 

and change ownership of oa2-cli to root

1 ---
2
3 # make sure directory structure is in place
4
5 - name: server directory exists
6 file:
7 path: "{{ oa4mp_server_dir }}"
8 state: directory
9 owner: "{{ tomcat_user }}"
10 group: "{{ tomcat_user }}"
11
12 - name: server conf dir exists
13 file:
14 path: "{{ oa4mp_server_conf_dir }}"
15 state: directory
16 owner: "{{ tomcat_user }}"
17 group: "{{ tomcat_user }}"
18
19
20 - name: server log exists
21 file:
22 path: "{{ oa4mp_server_log_dir }}"
23 state: directory
24 owner: "{{ tomcat_user }}"
25 group: "{{ tomcat_user }}"
26
27 - name: server storage exists
28 file:
29 path: "{{ oa4mp_server_storage_dir }}"
30 state: directory
31 owner: "{{ tomcat_user }}"
32 group: "{{ tomcat_user }}"
33
34 - name: server tools exists
35 file:
36 path: "{{ oa4mp_server_tools_dir }}"
37 state: directory
38 owner: "{{ tomcat_user }}"
39 group: "{{ tomcat_user }}"
40
41 - name: server certificates exists
42 file:
43 path: "{{ oa4mp_server_certificates_dir }}"
44 state: directory
45 owner: "{{ tomcat_user }}"
46 group: "{{ tomcat_user }}"
47
48 # place configuration
49
50 - name: server config file
51 template:
52 src: server-cfg.xml.j2
53 dest: "{{ oa4mp_server_conf_file }}"
54 owner: "{{ tomcat_user }}"
55 group: "{{ tomcat_user }}"
56 mode: 0600
57 backup: yes
58
59 # copy tools for client approval
60
61 - name: copy client approval jar
62 copy:
63 src: oa2-cli.jar
64 dest: "{{ oa4mp_server_tools_dir }}"
65 owner: root
66 group: root
67 mode: 0644
68
69 - name: copy client approval jar
70 template:
71 src: oa2-cli.j2
72 dest: "{{ oa4mp_server_tools_dir }}/oa2-cli"
73 owner: root
74 group: root
75 mode: 0744
76
77 # place trust and key stores
78
79 #- name: look for private credentials archive
80 # stat:
81 # path: "{{ private_creds_archive }}"
82 # register: priv_creds
83
84 #- name: create private credential temp dir
85 # file:
86 # path: "{{ private_creds_dir }}"
87 # state: directory
88 # owner: root
89 # when: priv_creds.stat.exists
90
91 #- name: unpack private credentials
92 # unarchive:
93 # src: "{{ private_creds_archive }}"
94 # dest: "{{ private_creds_dir }}"
95 # copy: no
96 # when: priv_creds.stat.exists
97
98 - name: copy private trusted certificates
99 shell: "cp -f {{ private_certificates }}/* {{ oa4mp_server_certificates_dir }}"
100 # when: priv_creds.stat.exists
101
102 - name: set private trusted certificates attributes
103 file:
104 path: "{{ oa4mp_server_certificates_dir }}"
105 state: directory
106 owner: "{{ tomcat_user }}"
107 group: "{{ tomcat_user }}"
108 # when: priv_creds.stat.exists
109
110 - name: add hostcert to keystore
111 command: openssl pkcs12 -export -in "{{ private_hostcert }}" -inkey "{{ private_hostkey }}" -out "{{ oa4mp_server_keystore }}" -name hostcred -CApath "{{ private_certificates }}" -chain -passout "pass:{{ oa4mp_server_keystore_pw }}"
112 # when: priv_creds.stat.exists
113
114 - name: add the right permission to the key store
115 file:
116 path: "{{ oa4mp_server_keystore }}"
117 owner: "{{ tomcat_user }}"
118 group: "{{ tomcat_user }}"
119 mode: 0400
120 # when: priv_creds.stat.exists
121
122 #- name: remove private credentials archive
123 # file:
124 # path: "{{ item }}"
125 # state: absent
126 # with_items:
127 # - "{{ private_creds_archive }}"
128 # - "{{ private_creds_dir }}"
129 # when: priv_creds.stat.exists
130
131 # deploy war file
132
133 - name: stop tomcat for the war switch
134 service:
135 name: "{{ tomcat_service }}"
136 state: stopped
137
138 - name: delete old deployment
139 file:
140 path: "{{item}}"
141 state: absent
142 with_items:
143 - "{{ catalina_home }}/webapps/{{ oa4mp_server }}"
144 - "{{ catalina_home }}/webapps/{{ oa4mp_server }}.war"
145
146 - name: copy war
147 copy:
148 src: "{{ oa4mp_server }}.war"
149 dest: "{{ catalina_home }}/webapps/{{ oa4mp_server }}.war"
150 owner: "{{ tomcat_user }}"
151 group: "{{ tomcat_user }}"
152 mode: 0644
153 notify: restart tomcat

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28