main.yml 6.01 KB
Newer Older
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
1
2
---

3
- name: Install avro from ar project
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
4
  tags: ar-packages
5
  yum: name=avro state=present enablerepo={{ enabled_argo_repo }}
6

7
8
9
- name: Install python-pip
  tags: ar-packages
  yum: name=python-pip state=present
10

11
- name: Install pymongo fixed version
12
  tags: ar-packages
13
  pip: name=pymongo state=present version=3.2.1
14

15
16
17
18
- name: Install egi consumer package from ar project
  tags: 
    - ar-packages
    - consumer_config
19
  yum: name=argo-egi-consumer state=latest enablerepo={{ enabled_argo_repo }}
20
  notify: restart all consumers
21

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
- name: Create consumer configuration directories
  file: path=/etc/argo-{{ item.key | lower }}-consumer
        state=directory
        owner=root group=root mode=0755
  with_dict: tenants
  notify: restart all consumers

- name: Copy metric avro specification for each tenant
  tags: 
    - consumer_config
  template: src=metric_data.avsc.j2
            dest=/etc/argo-{{ item.key | lower }}-consumer/metric_data.avsc
            owner=root group=root mode=0644
  with_dict: tenants
  notify: restart all consumers

- name: Create consumer output directories per tenant
39
  tags: consumer_config
40
41
42
43
44
45
46
47
  file: path=/var/lib/argo-{{ item.key | lower }}-consumer
        state=directory
        owner=arstats group=arstats mode=0755
  with_dict: tenants

- name: Consumer configuration
  tags: 
    - consumer_config
48
  template: src=consumer.conf.j2
49
            dest=/etc/argo-{{ item.key | lower }}-consumer/consumer.conf
50
            owner=root group=root mode=0644
51
52
53
  with_dict: tenants
  notify: restart all consumers

54
55
# TODO: Make following task tenant unaware
- name: Copy out init scripts for non egi consumers
56
57
58
59
60
61
  tags: 
    - consumer_config
  template: src=consumer.init.j2
            dest=/etc/init.d/argo-{{ item.key | lower }}-consumer
            owner=root group=root mode=0755
  with_dict: tenants
62
63
  when: item.key|lower != "egi"
  notify: restart all non egi consumers
64

65
# TODO: Make following task tenant unaware
66
67
68
69
70
71
- name: Create copies of python wrappers for non egi consumers
  tags: 
    - consumer_config
  file: path=/usr/bin/argo-{{ item.key | lower }}-wrapper-consumer.py
        state=link src=/usr/bin/argo-egi-consumer.py
  with_dict: tenants
72
  when: item.key|lower != "egi"
73
74
75
76
77
78

- name: Enable and start consumer services
  tags: 
    - consumer_config
  service: name=argo-{{ item.key | lower }}-consumer enabled=on state=started
  with_dict: tenants
79

80
- name: Install argo-egi-connectors from ar project
81
82
83
  tags: 
    - ar-packages
    - connectors
84
  yum: name=argo-egi-connectors state=latest enablerepo={{ enabled_argo_repo }}
85

86
- name: Configure connectors
87
88
89
  tags: 
    - connectors_config
    - connectors
90
  template: src=customer.conf.j2
91
            dest=/etc/argo-egi-connectors/{{ item.key | lower }}-customer.conf
92
93
            owner=root group=root mode=0644
            backup=yes
94
  with_dict: tenants
95

96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
- name: POEM configuration
  tags:
    - connectors_config
    - poem_config
  template: src=poem-connector.conf.j2
            dest=/etc/argo-egi-connectors/poem-connector.conf
            owner=root group=root mode=0644
            backup=yes

- name: Configure poem connector per tenant cron job
  tags: 
    - connectors_config
    - connectors
    - poem_cron
  cron: cron_file=poem_{{ item.key | lower }}
        name=poem_{{ item.key | lower }}
        minute=2
        hour=0
        user=root
115
        job="/usr/libexec/argo-egi-connectors/poem-connector.py {% if item.value.prefilter is not defined %} -np {% endif %} -c /etc/argo-egi-connectors/{{ item.key | lower }}-customer.conf"
116
117
118
        state=present
  with_dict: tenants

Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
119
- name: Configure topology connector per tenant cron job
120
121
122
123
124
125
126
127
128
129
130
131
132
  tags: 
    - connectors_config
    - connectors
    - topology_cron
  cron: cron_file=topology_{{ item.key | lower }}
        name=topology_{{ item.key | lower }}
        minute=7
        hour=0
        user=root
        job="/usr/libexec/argo-egi-connectors/topology-gocdb-connector.py -c /etc/argo-egi-connectors/{{ item.key | lower }}-customer.conf"
        state=present
  with_dict: tenants

133
134
135
136
137
138
139
140
141
142
143
144
145
146
- name: Configure weights connector per tenant cron job
  tags: 
    - connectors_config
    - connectors
    - weights_cron
  cron: cron_file=weights_{{ item.key | lower }}
        name=weights_{{ item.key | lower }}
        minute=5
        hour=0
        user=root
        job="/usr/libexec/argo-egi-connectors/weights-gstat-connector.py -c /etc/argo-egi-connectors/{{ item.key | lower }}-customer.conf"
        state=present
  with_dict: tenants

147
148
- name: Install ar-compute from ar project
  tags: ar-packages
149
  yum: name=ar-compute state=latest enablerepo={{ enabled_argo_repo }}
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
150

151
152
153
154
155
156
- name: Copy out compute engine configuration file
  tags: ce_config
  template: src=ar-compute-engine.conf.j2
            dest=/etc/ar-compute-engine.conf
            owner=root group=root mode=0644
            backup=yes
157

Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
158
159
160
161
162
163
164
165
- name: Configure ar-compute job cycle daily cron 
  tags: compute_config
  cron: cron_file=ar_job_cycle_daily
        user=root
        name=job_cycle_daily
        state=present
        minute=0
        hour=0
166
        job="/usr/libexec/ar-compute/bin/job_cycle.py -d $(/bin/date --utc --date '-1 day' +\%Y-\%m-\%d)"
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
167
168
169
170
171
172
173
174

- name: Configure ar-compute job cycle hourly cron 
  tags: compute_config
  cron: cron_file=ar_job_cycle_hourly
        user=root
        name=ar_job_cycle_hourly
        state=present
        minute=55
175
        hour=*/2
176
        job="/usr/libexec/ar-compute/bin/job_cycle.py -d $(/bin/date --utc  +\%Y-\%m-\%d)"
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
177

178
179
180
181
182
183
184
185
186
187
- name: Add ar-compute poller hourly cron for tenant EGI
  tags: compute_crons
  cron: cron_file=ar_poller_hourly_egi
        name=ar_poller_hourly_egi
        minute=25
        hour=*
        user=root
        job="/usr/libexec/ar-compute/bin/poller_ar.py -t EGI"
        state=present

188
189
- name: Install ar-data-retention from ar project
  tags: ar-data-retention
190
  yum: name=ar-data-retention state=latest enablerepo={{ enabled_argo_repo }}
191
192
193
194
195
196
197

- name: Parametrize data retention policies
  tags: data_retention
  template: src=ar-data-retention.conf.j2
            dest=/etc/ar-data-retention/ar-data-retention.conf
            owner=root group=root mode=0644