main.yml 4.15 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
12
13
- name: Upgrade pymongo to latest available version
  tags: ar-packages
  pip: name=pymongo state=latest
14

15
16
- name: Install consumer from ar project
  tags: ar-packages
17
  yum: name=argo-egi-consumer state=latest enablerepo={{ enabled_argo_repo }}
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
18
  notify: restart egi consumer
19
20
21
22
23
24
25
26
27
28
29

- name: Consumer configuration
  tags: consumer_config
  template: src=consumer.conf.j2
            dest=/etc/argo-egi-consumer/consumer.conf
            owner=root group=root mode=0644

- name: Enable and start consumer service
  tags: consumer_config
  service: name=argo-egi-consumer enabled=on state=started

30
31
- name: Install argo-egi-connectors from ar project
  tags: ar-packages
32
  yum: name=argo-egi-connectors state=latest enablerepo={{ enabled_argo_repo }}
33

34
35
36
37
38
39
40
- name: Configure EGI connectors
  tags: connectors_config
  copy: src=customer.conf
            dest=/etc/argo-egi-connectors/customer.conf
            owner=root group=root mode=0644
            backup=yes

41
42
- name: Install ar-compute from ar project
  tags: ar-packages
43
  yum: name=ar-compute state=latest enablerepo={{ enabled_argo_repo }}
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

- name: Configure ar-compute stuff 1
  tags: compute_config
  lineinfile: dest=/etc/ar-compute-engine.conf
              regexp="^mongo_host="
              line="mongo_host=127.0.0.1"
              state=present
              backup=yes

- name: Configure ar-compute stuff 2
  tags: compute_config
  lineinfile: dest=/etc/ar-compute-engine.conf
              regexp="^mode="
              line="mode=local"
              state=present
              backup=yes

61
62
63
64
65
66
67
68
- name: Configure ar-compute stuff 3
  tags: compute_config
  lineinfile: dest=/etc/ar-compute-engine.conf
              regexp="^prefilter_clean="
              line="prefilter_clean=false"
              state=present
              backup=yes

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
- name: Configure ar-compute stuff 4
  tags: consumer_config
  lineinfile: dest=/etc/ar-compute-engine.conf
              regexp="^sync_path="
              line="sync_path=/var/lib/argo-connectors"
              state=present
              backup=yes

- name: Configure ar-compute stuff 5
  tags: consumer_config
  lineinfile: dest=/etc/ar-compute-engine.conf
              regexp="^sync_exec="
              line="sync_exec=/usr/libexec/argo-egi-connectors"
              state=present
              backup=yes

Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
85
86
87
88
89
90
91
92
- 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
93
        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
94
95
96
97
98
99
100
101
102

- 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
        hour=*
103
        job="/usr/libexec/ar-compute/bin/job_cycle.py -d $(/bin/date --utc  +\%Y-\%m-\%d)"
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
104

105
106
107
108
109
110
111
112
113
114
- 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

Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
115
116
117
118
- name: Create job directories
  tags: sync_config
  file: path={{ item }} owner=root group=root mode=0755 state=directory
  with_items:
119
120
    - /var/lib/argo-connectors/EGI/Cloudmon
    - /var/lib/argo-connectors/EGI/Critical
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
121
122
123
124
125

- name: Make sure ownerships are OK
  tags: consumer_config
  file: path={{ item }} owner=root group=arstats mode=0775 state=directory
  with_items:
126
    - /var/lib/argo-connectors
127
    - /var/lib/argo-egi-consumer
Paschalis Korosoglou's avatar
Paschalis Korosoglou committed
128

129
130
- name: Install ar-data-retention from ar project
  tags: ar-data-retention
131
  yum: name=ar-data-retention state=latest enablerepo={{ enabled_argo_repo }}
132
133
134
135
136
137
138

- 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