-
Notifications
You must be signed in to change notification settings - Fork 11
/
package.yml
89 lines (74 loc) · 2.5 KB
/
package.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
---
- hosts: all
vars_prompt:
- name: version
prompt: "CKAN Version (branch or tag)"
private: True
- name: iteration
prompt: "Iteration"
private: True
- name: datapusher
prompt: "Enable DataPusher? [Y/n]"
default: "y"
private: True
tasks:
- name: set regex for CKAN version
set_fact:
re: '\D+\D+(?P<capture>\d+\.\d+)'
- set_fact:
ckanver: "{{ version | regex_search(re, '\\g<capture>') }}"
register: ckanver
- debug:
var: ckanver[0]
# Install Ubuntu apt packages
- name: Install Ubuntu apt Packages
include_tasks: "py3/apt.yml"
- name: make sure nginx is installed
action: apt pkg=nginx state=present update_cache=yes
- name: install fpm requirements
action: command gem install dotenv -v 2.8.1
when: ansible_distribution_version == "20.04"
- name: install fpm
action: command gem install -v 1.15.0 fpm -- creates=/usr/local/bin/fpm
- name: delete old directories
action: file path={{ item }} state=absent
with_items:
- /etc/ckan
- /usr/lib/ckan
- /root/.cache/pip
# Install pip and virtualenv
- name: Install apt Packages
include_tasks: "py3/virtualenv.yml"
# Pull CKAN
- name: pull ckan software
action: git repo=https://github.com/ckan/ckan dest=/usr/lib/ckan/default/src/ckan version={{ version }}
# Clean up CKAN distro
- name: Recursively remove .git directory
file:
path: /usr/lib/ckan/default/src/ckan/.git
state: absent
# Install ckan and dependancies
- name: Install ckan and dependancies
include_tasks: "py3/installckan.yml"
# Install datapusher
- name: Install datapusher
include_tasks: "py3/datapusher.yml"
when: datapusher == 'y'
# Clean up datapusher distro
- name: Recursively remove .git directory
file:
path: /usr/lib/ckan/datapusher/src/datapusher/.git
state: absent
when: datapusher == 'y'
# Install web files and dependancies
- name: Install web and dependancies
include_tasks: "common/web.yml"
# Copy other application files CKAN
- name: Copy other application files for CKAN
include_tasks: "common/app.yml"
# template the after web script
- name: template the after web script
action: template src=common/after_web.j2 dest=/tmp/after_web.sh mode=744
# Build deb package for CKAN
- name: Build deb package for CKAN
include_tasks: "common/build.yml"