-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplaybook.yaml
108 lines (90 loc) · 2.23 KB
/
playbook.yaml
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
---
- hosts: all
vars_files:
- vars.yaml
tasks:
- name: update && upgrade
apt:
update_cache: yes
upgrade: yes
autoclean: yes
autoremove: yes
- name: install apt packages
apt:
name:
- 'apt-transport-https'
- 'ca-certificates'
- 'curl'
- 'gnupg'
- 'htop'
- 'python3-pip'
- 'software-properties-common'
- 'unzip'
state: present
update_cache: yes
- name: check reboot required
stat:
path: /var/run/reboot-required
register: reboot_required_file
- name: reboot
when: reboot_required_file.stat.exists
reboot:
reboot_timeout: 600
#----------------------------------------------------------------------------------------------------------------------#
- hosts: cdb
vars_files:
- vars.yaml
tasks:
- name: couchdb group
group:
name: couchdb
state: present
- name: coucdb user
user:
name: couchdb
group: couchdb
shell: /sbin/nologin
append: yes
state: present
create_home: no
- name: couch apt key
apt_key:
keyserver: keyserver.ubuntu.com
id: 8756C4F765C9AC3CB6B85D62379CE192D401AB61
- name: couch apt repo
apt_repository:
repo: deb https://apache.bintray.com/couchdb-deb focal main
state: present
filename: couch
- name: install couch
apt:
name: couchdb
state: present
update_cache: yes
- name: couch vm.args
template:
src: couch/vm.args
dest: /opt/couchdb/etc/vm.args
owner: couchdb
group: couchdb
mode: '0644'
- name: couch config.ini
template:
src: couch/config.ini
dest: /opt/couchdb/etc/local.ini
owner: couchdb
group: couchdb
mode: '0644'
- name: upload couch systemd unit
copy:
src: couch/couchdb.service
dest: /etc/systemd/system
owner: root
group: root
mode: '0644'
- name: enable couchdb service
systemd:
name: couchdb.service
daemon_reload: yes
enabled: yes
state: started