-
Notifications
You must be signed in to change notification settings - Fork 1
/
notes
61 lines (47 loc) · 1.32 KB
/
notes
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
/opt/couchdb/etc/local.ini
revise sections:
[chttpd]
port = 5984
# bind_address = 192.168.10.30
bind_address = 0.0.0.0
[admins]
# set password
admin = secret
couchdb_admins_admin_secret: strongPassword
couchdb_chttpd_port: 5984
couchdb_chttpd_bind_address: 0.0.0.0
- name: Ensure "port is in section "[chttpd]" in specified file
ini_file:
path: /opt/couchdb/etc/local.ini
section: chttpd
option: port
value: {{ couchdb_chttpd_port }}
- name: Ensure "bind_address is in section "[chttpd]" in specified file
ini_file:
path: /opt/couchdb/etc/local.ini
section: chttpd
option: bind_address
value: {{ couchdb_chttpd_bind_address }}
- name: Ensure "admin = strongPassword is in section "[admins]" in specified file
ini_file:
path: /opt/couchdb/etc/local.ini
section: admins
option: admin
value: {{ couchdb_admins_admin_secret }}
https://docs.ansible.com/ansible/latest/modules/ini_file_module.html
Examples:
- name: Ensure "fav=lemonade is in section "[drinks]" in specified file
ini_file:
path: /etc/conf
section: drinks
option: fav
value: lemonade
mode: '0600'
backup: yes
- name: Ensure "temperature=cold is in section "[drinks]" in specified file
ini_file:
path: /etc/anotherconf
section: drinks
option: temperature
value: cold
backup: yes