Skip to content

Commit

Permalink
Start geo-replication session and post creation steps
Browse files Browse the repository at this point in the history
  • Loading branch information
salamza committed May 2, 2017
1 parent 8ccf08d commit 53b6e13
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# GlusterFS-playbook
Scalable Ansible Playbook to install GlusterFS on bare-metal Debian Jessie server farm.

Geo-replication playbook requires two host group, gluster_masters and gluster_slaves.
21 changes: 14 additions & 7 deletions georep.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Configure non-root GlusterFS geo-replication on Debian clusters
- name: Configure GlusterFS geo-replication (non-root) on Debian clusters
hosts: gluster_cluster

vars_files:
Expand All @@ -16,13 +16,13 @@
comment: "GlusterFS Geo-replication User"
group: {{ gluster_georep_user }}
state: present
when: inventory_hostname in groups['gluster_slave_cluster']
when: inventory_hostname in groups['gluster_slaves']

- include: georep-pre3.9.yml
when: glusterfs_version.stdout.find("3.8") != -1
when: (glusterfs_version.stdout.find("3.8") != -1) and (inventory_hostname in groups['gluster_slaves'])

- include: georep-post3.9.yml
when: glusterfs_version.stdout.find("3.10") != -1
when: (glusterfs_version.stdout.find("3.10") != -1) and (inventory_hostname in groups['gluster_slaves'])


- name: Set up the environment for Geo-replication
Expand All @@ -36,18 +36,25 @@

- name: Create secret pem pub file for glusterfs < 3.9
shell: "gluster system:: execute gsec_create"
when: glusterfs_version.stdout.find("3.8") != -1 and inventory_hostname == {{ gluster_master_node }}
when: (glusterfs_version.stdout.find("3.8") != -1) and (inventory_hostname == {{ gluster_master_node }})
run_once: true

- name: Create secret pem pub file for glusterfs > 3.9
shell: "gluster-georep-sshkey generate"
when: glusterfs_version.stdout.find("3.10") != -1 and inventory_hostname == {{ gluster_master_node }}
when: (glusterfs_version.stdout.find("3.10") != -1) and (inventory_hostname == {{ gluster_master_node }})
run_once: true

- name: Create geo-replication session
shell: "gluster volume geo-replication {{ gluster_master_volume }} {{ gluster_georep_user }}@{{ gluster_slave_node }}::{{ gluster_slave_volume }} create push-pem"
when: inventory_hostname == {{ gluster_master_node }}
run_once: true

- name: post-creation pem keys
shell: "/usr/libexec/glusterfs/set_geo_rep_pem_keys.sh {{ gluster_georep_user }} {{ gluster_master_volume }} {{ gluster_slave_volume }}"
when: inventory_hostname == {{ gluster_slave_node }}
run_once: true


- name: Start Geo-replication session
shell: "gluster volume geo-replication {{ gluster_master_volume }} {{ gluster_georep_user }}@{{ gluster_slave_node }}::{{ gluster_slave_volume }} start force"
when: inventory_hostname == {{ gluster_master_node }}
run_once: true

0 comments on commit 53b6e13

Please sign in to comment.