-
Notifications
You must be signed in to change notification settings - Fork 1
/
ezpaarse.yml
139 lines (116 loc) · 3.35 KB
/
ezpaarse.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
- name: Ezpaarse install and config
remote_user: ulsprovision
hosts: EZpaarse
become: yes
tasks:
- name: disable selinux
ansible.posix.selinux:
state: disabled
- name: Install Docker
yum:
name: docker
state: latest
- name: Install docker-compose
yum:
name: docker-compose
state: latest
- name: Create Ezpaarse directory
file:
path: /usr/local/ezpaarse
state: directory
- name: get Ezpaarse docker-compose.yml
get_url:
url: https://raw.githubusercontent.com/ezpaarse-project/ezpaarse/master/docker-compose.yml
dest: /usr/local/ezpaarse/docker-compose.yml
- name: start Docker service
service:
name: docker
state: started
enabled: yes
- name: Start Docker
shell:
cmd: "docker-compose up -d"
chdir: /usr/local/ezpaarse
- name: Copy Pitt Exclusions
ansible.builtin.copy:
src: resources/ezpaarse/domains.pitt.txt
dest: /usr/local/ezpaarse/exclusions/
- name: Import variables
include_vars:
file: "hostvars/{{inventory_hostname}}.ezpaarse-uda4.yml"
name: ezpvars
- name: Create a service user
user:
name: 'ezpdata'
shell: /sbin/nologin
state: present
- name: set up email for ezpdata
lineinfile:
path: /etc/aliases
state: present
insertafter: '^support:'
line: 'ezpdata: root'
- name: Create a data directory
file:
path: "{{ezpvars.EZPFILESDIR}}"
state: directory
group: ulssysdev
owner: 'ezpdata'
mode: '2770'
- name: Create data subdirectories
file:
path: "{{ezpvars.EZPFILESDIR}}/{{item}}"
state: directory
group: ulssysdev
owner: 'ezpdata'
mode: '2770'
with_items:
- downloads
- parsed
- pending
- name: Create an application directory
file:
path: /usr/local/ezpaarse-loader
state: directory
group: ulssysdev
owner: root
mode: '2775'
- name: Clone from git
git:
repo: https://github.com/ulsdevteam/ezpaarse-loader.git
dest: /usr/local/ezpaarse-loader
force: yes
- name: Set environment variables
lineinfile:
dest: /usr/local/ezpaarse-loader/common.env
state: present
create: yes
line: 'export {{ item.key }}={{ item.value }}'
with_items: '{{ ezpvars | dict2items }}'
- name: Grant write access
file:
path: /usr/local/ezpaarse-loader
recurse: yes
mode: 'g+w'
- name: Schedule cron download
cron:
name: 'Download EZPROXY logs'
hour: '5'
minute: '35'
job: '/usr/local/bin/cronic /usr/local/ezpaarse-loader/download.sh'
become: yes
become_user: 'ezpdata'
- name: Schedule cron processing
cron:
name: 'Parse EZPROXY logs'
hour: '6'
minute: '35'
job: '/usr/local/bin/cronic /usr/local/ezpaarse-loader/parse.sh'
become: yes
become_user: 'ezpdata'
- name: set up email for root
lineinfile:
path: /etc/aliases
state: present
regexp: '^ezpdata:'
line: 'ezpdata: root'