-
Notifications
You must be signed in to change notification settings - Fork 1
/
couchdb.yml
85 lines (75 loc) · 2.07 KB
/
couchdb.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
- name: CouchDB
hosts: arch
vars:
build: /tmp/couchdb-build
exe: '{{prefix}}/bin/couchdb'
git: '{{gitbuild}}/couchdb'
prefix: /opt/couchdb
version: 1.6.1
tasks:
- name: Check library breakage
# Remove binary if it exists and libs have missing dependenc(y|ies)
shell: |
test -e {{exe}} || exit 0
find {{prefix}} -name priv |
xargs -iDIR find DIR -name '*.so' |
xargs -r ldd |
grep '=> not found' || exit 0
rm -v {{exe}}
exit 1
register: library
changed_when: library.rc != 0
failed_when: false
check_mode: no
- name: CouchDB prereqs
become: true
pacman: name={{item}}
with_items:
- autoconf-archive
- js185
- name: CouchDB service user
become: true
user: name=couchdb
home={{prefix}}
createhome=no
system=yes
- name: CouchDB source
git: repo=gh:apache/couchdb
dest={{git}}
version={{version}}
update=no
remote=apache
- name: CouchDB install
shell: |
set -e
rm -rf {{build}}
mkdir {{build}}
git archive {{version}} | tar -C {{build}} -x
cd {{build}}
sh ./bootstrap
eval "$(VERMAN_EVAL=1 verman erlang use 17.5.1)"
./configure --prefix={{prefix}} --disable-docs
grep -rl _BSD_SOURCE . | xargs sed -i 's/_BSD_SOURCE/_DEFAULT_SOURCE/g'
touch THANKS
make
make install
args:
chdir: '{{git}}'
creates: '{{exe}}'
warn: no
notify: set couchdb permissions
- name: CouchDB service file
become: true
copy: src=files/couchdb.service
dest=/etc/systemd/system/couchdb.service
notify: reload systemd
- meta: flush_handlers
- name: CouchDB service
become: true
service: name=couchdb state=started enabled=yes
handlers:
- name: set couchdb permissions
command: set-all-facl u:couchdb -R {{prefix}}
- name: reload systemd
become: true
command: systemctl daemon-reload