-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
115 lines (92 loc) · 2.7 KB
/
playbook.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
---
- hosts: all
tasks:
- apt:
update_cache: yes
name: "{{ item }}"
loop:
- git
- python3-pip
- python-pip
- make
- ntp
- apt-transport-https
- python-pkg-resources
- rsync
- python-setuptools
- python3-setuptools
- pip:
name: docker-compose
- name: Docker ppa key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Docker ppa
apt_repository:
repo: 'deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable'
- name: Docker
apt:
name: docker-ce
- name: docker-compose
get_url:
url: https://github.com/docker/compose/releases/download/1.21.2/docker-compose-Linux-x86_64
dest: /usr/bin/docker-compose
mode: u=rwx,g=xr,o=rx
- name: Posix users which can use docker
user:
name: ubuntu
groups:
- docker
- name: Configure firewall
ufw:
state: enabled
policy: allow
- name: allows ssh
ufw:
rule: limit
port: ssh
proto: tcp
- name: Allow access to port 22
ufw:
rule: allow
port: 22
- name: Allow access to port 8080
ufw:
rule: allow
port: 8080
- copy:
src: docker-compose.yml
dest: /home/ubuntu/docker-compose.yml
- name: Copy RDF data
synchronize:
src: data
dest: /home/ubuntu/virtuoso
- name: Copy PL/SQL scripts
synchronize:
src: src
dest: /home/ubuntu/virtuoso
- docker_service:
project_src: /home/ubuntu
state: absent
- docker_service:
project_src: /home/ubuntu
register: output
- debug:
var: output
- name: Wait for Virtuoso listening on port 1111
wait_for:
host: 0.0.0.0
port: 1111
delay: 10
- name: Install Virtuoso (VAD) packages
shell: docker exec -w /tmp/share/src ubuntu_virtuoso_1 isql 1111 dba dba errors=stdout install_pkgs.sql
- name: Set data load path
shell: sed -i.org "s:__DATA_DIR__:data:" import_rdf.sql
args:
chdir: /home/ubuntu/virtuoso/src
- name: Import RDF data
shell: docker exec -w /tmp/share/src ubuntu_virtuoso_1 isql 1111 dba dba errors=stdout import_rdf.sql
- name: Sponge RDF metadata from FAIR Data Point
shell: docker exec -w /tmp/share/src ubuntu_virtuoso_1 isql 1111 dba dba errors=stdout fdp_sponge.sql
- name: Create full-text index on RDF data
shell: docker exec -w /tmp/share/src ubuntu_virtuoso_1 isql 1111 dba dba errors=stdout post_install.sql