GithubHelp home page GithubHelp logo

gluster / gluster-ansible-features Goto Github PK

View Code? Open in Web Editor NEW
10.0 9.0 14.0 142 KB

Ansible role to enable a Gluster cluster with gluster-specific features like samba, ganesha etc.

License: GNU General Public License v3.0

Python 100.00%

gluster-ansible-features's Introduction

gluster.features

The gluster.features role implements GlusterFS usecases. This role implements following sub-roles:

  • nfs_ganesha
  • gluster_hc
  • ctdb
  • geo_replication

Requirements

  • GlusterFS

Role Variables

NFS Ganesha related variables

Name Choices Default value Comments
gluster_features_ganesha_haname UNDEF Name of the NFS Ganesha cluster.
gluster_features_ganesha_volume UNDEF An existing GlusterFS volume which will be exported through NFS Ganesha
gluster_features_ganesha_hostnames UNDEF A comma separated list of hostnames, these are subset of nodes of the Gluster Trusted Pool that form the ganesha HA cluster
gluster_features_ganesha_viplist UNDEF public A comma separated list of virtual IPs for each of the nodes specified above.
gluster_features_ganesha_masternode UNDEF One of the nodes from the Trusted Storage Pool, gluster commands will be run on this node. gluster_features_ganesha_masternode: "{{ groups['ganesha_nodes'][0] }}" - the first node of the inventory section ganesha_nodes will be used.
gluster_features_ganesha_clusternodes UNDEF List of the nodes in the Trusted Storage Pool. gluster_features_ganesha_clusternodes: "{{ groups['ganesha_nodes'] }}" - The nodes listed in section ganesha_nodes in the inventory.

Gluster Hyperconverged Interface setup related roles

Name Choices Default value Comments
gluster_features_hci_cluster UNDEF The cluster ip/hostnames. Can be set by gluster_hci_cluster: "{{ groups['hc-nodes'] }}", where hc-nodes is from the inventory file.
gluster_features_hci_volumes UNDEF This is a dictionary setting the volume information. See below for further explanation and variables.
gluster_features_hci_volume_options UNDEF This is not needed to be set by user, defaults are picked up. Set to override defaults. For default values see Gluster HCI documentation.
gluster_features_hci_master UNDEF The REST host to be connected to (do not include `http'). This value will be ignored if glusterd1 is running on remote node.
gluster_features_hci_port 24007 The glusterd2 port

Dependencies

gluster.infra gluster.cluster

Example Playbook

Creating a NFS Ganesha Cluster:

An example playbook to deploy NFS Ganesha. Note to gather_facts should be set to true.

---
- name: Setting NFS Ganesha
  remote_user: root
  hosts: ganesha_nodes
  gather_facts: false

  vars:
     # Setting up NFS Ganesha
     gluster_features_ganesha_haname: ganesha-ha
     gluster_features_ganesha_volume: nfs_ganesha
     gluster_features_ganesha_hostnames: "server1,server2,server3,server4"
     gluster_features_ganesha_viplist: 10.70.44.121,10.70.44.122,10.70.44.123,10.70.44.124

     gluster_features_ganesha_masternode: "{{ groups['ganesha_nodes'][0] }}"
     gluster_features_ganesha_clusternodes: "{{ groups['ganesha_nodes'] }}"

  roles:
     - gluster.features

The above playbook assumes that a volume named nfs_ganesha is created and running.

Note:

If you are using GlusterFS 4.0 (glusterd2) ensure to install python-gluster-mgmt-client package on the remote master host.

Or create a directory glusterapilib on the remote host and copy the files volume.py, peer.py, common.py,init.py, excpetions.py under glusterapilib in a python searchable path.

License

GPLv3

Author Information

Sachidananda Urs [email protected]

gluster-ansible-features's People

Contributors

amarts avatar anoopcs9 avatar devyanikota avatar gobindadas avatar hunter86bg avatar obnoxxx avatar rchikatw avatar sac avatar sheersha-jain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gluster-ansible-features's Issues

[CTDB] adding local user via smbpasswd fails on Ubuntu 20.04

When the flow is reaching the point to create the user, smbpasswd fails with :

TASK [gluster.features/roles/ctdb : Set smb password] *****************************************************************************************************************************************
fatal: [kubluster]: FAILED! => {"changed": true, "msg": "non-zero return code", "rc": 1, "stderr": "Shared connection to kubluster closed.\r\n", "stderr_lines": ["Shared connection to kubluster closed."], "stdout": "\r\n/bin/sh: 1: 1.1: not found\r\n/bin/sh: 1: AES256: not found\r\n/bin/sh: 1: 1.1: not found\r\n/bin/sh: 1: AES256: not found\r\nFailed to open /var/lib/samba/private/secrets.tdb\r\n", "stdout_lines": ["", "/bin/sh: 1: 1.1: not found", "/bin/sh: 1: AES256: not found", "/bin/sh: 1: 1.1: not found", "/bin/sh: 1: AES256: not found", "Failed to open /var/lib/samba/private/secrets.tdb"]}

It seems that 'clustering=yes' is the root cause. Commenting out the line allows the change of the pass.

ctdb role hangs while trying to stop gluster volume

Ansible playbook execution hangs at the following stage:

TASK [gluster.features/roles/ctdb : Add volume name to ctdb setup/teardown scripts] ***
skipping: [storage0] => (item=/var/lib/glusterd/hooks/1/stop/pre/S29CTDB-teardown.sh) 
skipping: [storage0] => (item=/var/lib/glusterd/hooks/1/start/post/S29CTDBsetup.sh) 
skipping: [storage1] => (item=/var/lib/glusterd/hooks/1/stop/pre/S29CTDB-teardown.sh) 
skipping: [storage1] => (item=/var/lib/glusterd/hooks/1/start/post/S29CTDBsetup.sh) 

TASK [gluster.features/roles/ctdb : Stop GlusterFS volume] *********************

Looking at the particular task it seems like gluster volume stop <VOLNAME> force is waiting for an input for the prompt Stopping volume will make its data inaccessible. Do you want to continue? (y/n). Using --mode=script to the above command is a viable solution.

installing nfs ganesha does not work.

Given the following playbook:

- name: install ganesha
  hosts: ganesha
  become: true
  vars:
    gluster_features_ganesha_volume: vol1
    gluster_features_ganesha_hostnames: 
    - "{{ groups['ganesha'] }}"
    gluster_features_ganesha_haname: ganesha
    gluster_features_ganesha_viplis: "192.168.21.21,192.168.21.22"
    gluster_features_ganesha_clusternodes:
    - "{{ groups['ganesha'] }}"
    gluster_features_ganesha_masternode: "{{ groups['ganesha'][0] }}"

  roles:
  - gluster.features

This fails at the "Copy the ssh keys to the local machine" task.

The reason is that it attempts to do this before those keys have been generated.

Add tasks/check_vars.yml for every role

This tasks file should essential check for the required variables for that particular role.

For example:

- name: Checking that required variables are set
  fail: msg="{{ item }} is not defined"
  when: not {{ item }}
  with_items:
    - foo_volname
    - foo_username
    - foo_mastenodes

This should essentially do a role sanity check before executing the role.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.