-
Notifications
You must be signed in to change notification settings - Fork 0
/
provisioning.yml
executable file
·107 lines (89 loc) · 2.54 KB
/
provisioning.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
---
- hosts: all
become: yes
vars:
WIKIJS_VERSION: '2.5.159'
NODEJS_VERSION: '14'
tasks:
- name: instalando dependências
apt:
name:
- socat
- bash-completion
- apt-transport-https
- build-essential
- unzip
- libpq-dev
- python3-pip
- acl
state: present
- name: baixando setup do NodeJS
shell: curl -sL https://deb.nodesource.com/setup_{{ NODEJS_VERSION }}.x | sudo -E bash -
- name: instalando NodeJs
apt:
name: nodejs
state: present
- name: atualizando o NPM
shell: npm install -g npm@latest
- name: baixando arquivo de instalação do Wiki.js
get_url:
url: https://github.com/Requarks/wiki/releases/download/{{ WIKIJS_VERSION }}/wiki-js.tar.gz
dest: /tmp/
- name: criando diretório do Wiki.js
file:
path: /var/wiki
state: directory
- name: descompactando o arquivo de instalação
unarchive:
src: /tmp/wiki-js.tar.gz
dest: /var/wiki/
remote_src: yes
mode: 755
- name: renomeando config do Wiki.js
shell: mv /var/wiki/config.sample.yml /var/wiki/config.yml
- name: instalando Postgres
apt:
name:
- postgresql
- postgresql-contrib
- python3-psycopg2
state: latest
- name: startando serviço do Postgres
service: name=postgresql state=restarted enabled=yes
- name: criando db Postgres
become: true
become_user: postgres
postgresql_db: name='wiki'
state=present
- name: criando user Postgres
become: true
become_user: postgres
postgresql_user: db='wiki'
name=wikijs
state=present
password=wikijsrocks
priv=ALL
state=present
- name: criando config de serviço
copy:
src: 'files/wiki.service'
dest: /etc/systemd/system/wiki.service
- name: aplicando permissão
file:
dest: /var/wiki
owner: vagrant
group: vagrant
mode: u=rwX,g=rX,o=rX
recurse: yes
- name: realizando reload do systemd
systemd:
daemon_reload: yes
- name: startando serviço do Wiki.js
systemd:
state: started
name: wiki
- name: habilitando serviço do Wiki.js
systemd:
name: wiki
enabled: yes
masked: no