forked from tgrall/couchbase-ansible-playbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
couchbase.yml
39 lines (28 loc) · 1.5 KB
/
couchbase.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
---
#
# Install Couchbase cluster from a single command
#
- name: Couchbase Installation
hosts: all
user: root
tasks:
- name: download Couchbase package
get_url: url=http://packages.couchbase.com/releases/2.1.0/couchbase-server-enterprise_x86_64_2.1.0.deb dest=~/.
- name: Install dependencies
apt: pkg=libssl0.9.8 state=present
- name: Install Couchbase .deb file on all machines
shell: dpkg -i ~/couchbase-server-enterprise_x86_64_2.0.1.deb
- name: Initialize the cluster and add the nodes to the cluster
hosts: couchbase-main
user: root
tasks:
- name: Configure main node
shell: /opt/couchbase/bin/couchbase-cli cluster-init -c 127.0.0.1:8091 --cluster-init-username=${admin_user} --cluster-init-password=${admin_password} --cluster-init-port=8091 --cluster-init-ramsize=${cluster_ram_quota}
- name: Create shell script for configuring main node
action: template src=couchbase-add-node.j2 dest=/tmp/addnodes.sh mode=750
- name: Launch config script
action: shell /tmp/addnodes.sh
- name: Rebalance the cluster
shell: /opt/couchbase/bin/couchbase-cli rebalance -c 127.0.0.1:8091 -u ${admin_user} -p ${admin_password}
- name: create bucket ${bucket_name} with ${num_replicas} replicas
shell: /opt/couchbase/bin/couchbase-cli bucket-create -c 127.0.0.1:8091 --bucket=${bucket_name} --bucket-type=couchbase --bucket-port=11211 --bucket-ramsize=${bucket_ram_quota} --bucket-replica=${num_replicas} -u ${admin_user} -p ${admin_password}