setup docker hosts to mount glusterfs mounts
move git.xai-corp.net to dkhost02
This commit is contained in:
34
roles/glusterfs/tasks/main.yml
Normal file
34
roles/glusterfs/tasks/main.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
# main tasks for installing glusterfs
|
||||
|
||||
|
||||
# install packages
|
||||
- name: Update apt cache.
|
||||
apt: update_cache=yes cache_valid_time=86400
|
||||
|
||||
- name: Ensure glusterfs server is installed.
|
||||
apt: "name={{ item }} state=installed"
|
||||
with_items:
|
||||
- glusterfs-server
|
||||
- xfsprogs
|
||||
- xfsdump
|
||||
|
||||
|
||||
# create mount points
|
||||
- name: create mount points for all bricks in all volumes
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
with_items: "{{mountpoints}}"
|
||||
|
||||
# manage volumes
|
||||
- name: create gluster volumes
|
||||
gluster_volume:
|
||||
state: present
|
||||
name: "{{ item.key }}"
|
||||
brick: '{{ item.value | join(",")}}'
|
||||
rebalance: no
|
||||
cluster: "{{cluster}}"
|
||||
with_dict: "{{volumes}}"
|
||||
run_once: true
|
||||
Reference in New Issue
Block a user