main.yml 4.54 KB
Newer Older
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
1
2
3
4
5
6
7
8
9
10
11
12
13
---

- name: Install requirements
  yum: name={{ item }} state=present
  with_items:
    - java-1.7.0-openjdk.x86_64
    - wget
    - unzip
  tags: install_requirements

- name: Install CAs metapackage
  yum: name=ca-policy-egi-core state=latest
  tags: install_ca_bundle
14
  notify: restart webui
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
15
16
17
18
19
20
21
22
23
24
25
26

- name: Copy files to setup HOME_LAVOISIER
  copy: src={{ item }} dest=/etc/profile.d/{{ item }}
        owner=root group=root mode=0644
  with_items:
    - lavoisier.sh
    - lavoisier.csh

- name: Create download directory
  file: path={{ lavoisier_home }} state=directory

- name: Download lavoisier zip file
27
28
  get_url: url=https://github.com/ARGOeu/{{ argo_web }}/archive/{{ branch_name }}.zip
           dest={{ lavoisier_home }}/{{ branch_name }}.zip
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
29
30
           mode=0640
  register: download_out
31
  notify: restart webui
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
32
33

- name: Stage old directory if download target has changed
34
  command: mv {{ argo_web }}-{{ branch_name }} {{ argo_web }}-{{ branch_name }}.old
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
35
36
           chdir={{ lavoisier_home }}
  when: download_out is defined and download_out.changed
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
37
  ignore_errors: True
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
38
39

- name: Unzip zip file
40
  command: unzip {{ branch_name }}.zip
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
41
42
43
44
           chdir={{ lavoisier_home }}
  when: download_out is defined and download_out.changed

- name: Configure etc/lavoisier-hidden.properties step 1
45
  lineinfile: dest={{ lavoisier_home }}/{{ argo_web }}-{{ branch_name }}/etc/lavoisier-hidden.properties
46
              line='certificate.password={{ certificate_password }}'
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
47
48
              regexp='^certificate.password'
              state=present
49
  notify: restart webui
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
50
51

- name: Configure etc/lavoisier-hidden.properties step 2
52
  lineinfile: dest={{ lavoisier_home }}/{{ argo_web }}-{{ branch_name }}/etc/lavoisier-hidden.properties
53
              line='certificate.path={{ certificate_path }}'
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
54
55
              regexp='^certificate.path'
              state=present
56
  notify: restart webui
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
57
58

- name: Configure etc/lavoisier-hidden.properties step 3
59
  lineinfile: dest={{ lavoisier_home }}/{{ argo_web }}-{{ branch_name }}/etc/lavoisier-hidden.properties
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
60
61
62
63
              line='cache.baseDirectory={{ cache_directory }}'
              regexp='^cache.baseDirectory='
              state=present
              insertafter='^#cache.baseDirectory'
64
  notify: restart webui
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
65
66

- name: Configure etc/lavoisier-hidden.properties step 4
67
  lineinfile: dest={{ lavoisier_home }}/{{ argo_web }}-{{ branch_name }}/etc/lavoisier-hidden.properties
68
              line='server.baseUrl=http://{{ inventory_hostname }}'
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
69
70
              regexp='^server.baseUrl'
              state=present
71
  notify: restart webui
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
72
73

- name: Configure etc/lavoisier-hidden.properties step 5
74
  lineinfile: dest={{ lavoisier_home }}/{{ argo_web }}-{{ branch_name }}/etc/lavoisier-hidden.properties
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
75
76
77
              line='lavoisier.ssl.trustStore={{ truststore_path }}'
              regexp='^lavoisier.ssl.trustStore='
              state=present
78
  notify: restart webui
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
79
80

- name: Configure etc/lavoisier-hidden.properties step 6
81
  lineinfile: dest={{ lavoisier_home }}/{{ argo_web }}-{{ branch_name }}/etc/lavoisier-hidden.properties
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
82
83
84
              line='lavoisier.ssl.keyStore={{ keystore_path }}'
              regexp='^lavoisier.ssl.keyStore='
              state=present
85
  notify: restart webui
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
86
87

- name: Configure etc/lavoisier-hidden.properties step 7
88
  lineinfile: dest={{ lavoisier_home }}/{{ argo_web }}-{{ branch_name }}/etc/lavoisier-hidden.properties
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
89
90
91
              line='lavoisier.ssl.keyStorePassword={{ keystore_password }}'
              regexp='^lavoisier.ssl.keyStorePassword='
              state=present
92
  notify: restart webui
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
93

94
95
96
97
98
99
100
101
102
103
104
105
106
107
- name: Configure etc/lavoisier-hidden.properties step 8
  lineinfile: dest={{ lavoisier_home }}/{{ argo_web }}-{{ branch_name }}/etc/lavoisier-hidden.properties
              line='argo.api.key={{ argo_api_key }}'
              regexp='^argo.api.key='
              state=present
  notify: restart webui

- name: Configure etc/lavoisier-hidden.properties step 9
  lineinfile: dest={{ lavoisier_home }}/{{ argo_web }}-{{ branch_name }}/etc/lavoisier-hidden.properties
              line='contact.email={{ contact_email }}'
              regexp='^contact.email='
              state=present
  notify: restart webui

Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
108
- name: Configure etc/security/passwords.properties
109
  lineinfile: dest={{ lavoisier_home }}/{{ argo_web }}-{{ branch_name }}/etc/security/passwords.properties
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
110
111
112
              line='admin={{ admin_password_md5 }}'
              regexp='^admin'
              state=present
113
  notify: restart webui
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
114

115
116
- name: Start webui
  command: ./bin/lavoisier.sh start
117
           chdir={{ lavoisier_home }}/{{ argo_web }}-{{ branch_name }}
118
  ignore_errors: True