summaryrefslogtreecommitdiffstats
path: root/roles/glusterfs
diff options
context:
space:
mode:
Diffstat (limited to 'roles/glusterfs')
-rw-r--r--roles/glusterfs/files/gluster-link.service8
-rw-r--r--roles/glusterfs/tasks/common.yml2
-rw-r--r--roles/glusterfs/tasks/create_domain.yml2
-rw-r--r--roles/glusterfs/tasks/create_volume.yml2
-rw-r--r--roles/glusterfs/tasks/main.yml27
-rw-r--r--roles/glusterfs/tasks/mount_domain.yml2
-rw-r--r--roles/glusterfs/tasks/setup-client.yml0
-rw-r--r--roles/glusterfs/tasks/setup-external-server.yml (renamed from roles/glusterfs/tasks/server.yml)5
-rw-r--r--roles/glusterfs/tasks/setup-openshift-server.yml9
-rw-r--r--roles/glusterfs/tasks/volumes.yml4
10 files changed, 47 insertions, 14 deletions
diff --git a/roles/glusterfs/files/gluster-link.service b/roles/glusterfs/files/gluster-link.service
new file mode 100644
index 0000000..ddcea10
--- /dev/null
+++ b/roles/glusterfs/files/gluster-link.service
@@ -0,0 +1,8 @@
+[Unit]
+After=origin-node.service
+
+[Service]
+ExecStart=/usr/bin/ln -sf /run/glusterd/glusterd.socket /run/glusterd.socket
+
+[Install]
+WantedBy=multi-user.target
diff --git a/roles/glusterfs/tasks/common.yml b/roles/glusterfs/tasks/common.yml
index 7675cb9..5e8e3b6 100644
--- a/roles/glusterfs/tasks/common.yml
+++ b/roles/glusterfs/tasks/common.yml
@@ -7,9 +7,7 @@
with_items:
- glusterfs-cli
- glusterfs-fuse
- - glusterfs-libs
- glusterfs-rdma
- - glusterfs
- libsemanage-python
- name: Allow fuse in SELinux configuration
diff --git a/roles/glusterfs/tasks/create_domain.yml b/roles/glusterfs/tasks/create_domain.yml
index b3fc89e..8f8042b 100644
--- a/roles/glusterfs/tasks/create_domain.yml
+++ b/roles/glusterfs/tasks/create_domain.yml
@@ -1,6 +1,6 @@
---
- name: Configure volumes
- include: create_volume.yml
+ include_tasks: create_volume.yml
with_dict: "{{ domain.volumes }}"
vars:
domain_servers: "{{ groups[domain.servers] | map('extract', hostvars, 'ands_storage_hostname') | list }}"
diff --git a/roles/glusterfs/tasks/create_volume.yml b/roles/glusterfs/tasks/create_volume.yml
index 9b955b0..ca4f39a 100644
--- a/roles/glusterfs/tasks/create_volume.yml
+++ b/roles/glusterfs/tasks/create_volume.yml
@@ -1,4 +1,4 @@
---
-- include: "{{ volume.value.type }}/vols{{((domain_servers | length) < 4) | ternary((domain_servers | length), 3) }}.yml"
+- include_tasks: "{{ volume.value.type }}/vols{{((domain_servers | length) < 4) | ternary((domain_servers | length), 3) }}.yml"
vars:
name: "{{ volume.key }}"
diff --git a/roles/glusterfs/tasks/main.yml b/roles/glusterfs/tasks/main.yml
index dbd1aad..d7ee766 100644
--- a/roles/glusterfs/tasks/main.yml
+++ b/roles/glusterfs/tasks/main.yml
@@ -1,13 +1,34 @@
---
-- include: common.yml
+- name: Install GlusterFS Common Software
+ include_tasks: common.yml
when:
- "'software' in glusterfs_subroles"
-- include: server.yml
+- name: Install GlusterFS client
+ include_tasks: setup-client.yml
+ when:
+ - "'software' in glusterfs_subroles"
+ - "'ands_storage_servers' not in group_names"
+
+- name: Install GlusterFS OpenShift Server
+ include_tasks: setup-openshift-server.yml
+ when:
+ - "'software' in glusterfs_subroles"
+ - "'ands_storage_servers' in group_names"
+ - "'glusterfs' in group_names"
+
+- name: Install GlusterFS External Server
+ include_tasks: setup-external-server.yml
when:
- "'software' in glusterfs_subroles"
- "'ands_storage_servers' in group_names"
+ - "'glusterfs' not in group_names"
+
+- name: Configure gluster peers (on first host)
+ shell: gluster peer probe {{item}}
+ run_once: true
+ with_items: "{{ glusterfs_servers }}"
-- include: volumes.yml
+- include_tasks: volumes.yml
when:
- "'volumes' in glusterfs_subroles"
diff --git a/roles/glusterfs/tasks/mount_domain.yml b/roles/glusterfs/tasks/mount_domain.yml
index 94b6677..355ed29 100644
--- a/roles/glusterfs/tasks/mount_domain.yml
+++ b/roles/glusterfs/tasks/mount_domain.yml
@@ -1,6 +1,6 @@
---
- name: Mount volumes
- include: mount_volume.yml
+ include_tasks: mount_volume.yml
with_dict: "{{ domain.volumes }}"
vars:
name: "{{ volume.key }}"
diff --git a/roles/glusterfs/tasks/setup-client.yml b/roles/glusterfs/tasks/setup-client.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/roles/glusterfs/tasks/setup-client.yml
diff --git a/roles/glusterfs/tasks/server.yml b/roles/glusterfs/tasks/setup-external-server.yml
index 328a8c5..cc0b2f1 100644
--- a/roles/glusterfs/tasks/server.yml
+++ b/roles/glusterfs/tasks/setup-external-server.yml
@@ -4,6 +4,7 @@
with_items:
- glusterfs-server
- glusterfs-rdma
+ - glusterfs
- name: Ensure GlusterFS service is running
service: name=glusterd state=started enabled=yes
@@ -25,7 +26,3 @@
- name: Create folder for GlusterFS bricks
file: dest="{{glusterfs_bricks_path}}" owner="root" group="root" mode="0755" state="directory"
-- name: Configure gluster peers (on first host)
- shell: gluster peer probe {{item}}
- run_once: true
- with_items: "{{ glusterfs_servers }}"
diff --git a/roles/glusterfs/tasks/setup-openshift-server.yml b/roles/glusterfs/tasks/setup-openshift-server.yml
new file mode 100644
index 0000000..20ebbf8
--- /dev/null
+++ b/roles/glusterfs/tasks/setup-openshift-server.yml
@@ -0,0 +1,9 @@
+---
+- name: Link control socket
+ file: src="/run/glusterd/glusterd.socket" dest="/run/glusterd.socket" state="link"
+
+- name: Copy systemd unit to recreate link on re-start
+ copy: src="gluster-link.service" dest="/etc/systemd/system/gluster-link.service" owner="root" group="root" mode="0644"
+
+- name: Enable systemd unit
+ systemd: enabled=true name=gluster-link daemon_reload=yes \ No newline at end of file
diff --git a/roles/glusterfs/tasks/volumes.yml b/roles/glusterfs/tasks/volumes.yml
index e393c08..c4d49ac 100644
--- a/roles/glusterfs/tasks/volumes.yml
+++ b/roles/glusterfs/tasks/volumes.yml
@@ -1,5 +1,5 @@
- name: Configure volume domains
- include: create_domain.yml
+ include_tasks: create_domain.yml
run_once: true
delegate_to: "{{ groups[domain.servers][0] }}"
with_items: "{{ glusterfs_domains }}"
@@ -7,7 +7,7 @@
loop_var: domain
- name: Mount volume domains
- include: mount_domain.yml
+ include_tasks: mount_domain.yml
when: ( domain.clients | default("---") ) in group_names
with_items: "{{ glusterfs_domains }}"
loop_control: