ansible.builtin.gluster_volume (v2.9.27) — module

Manage GlusterFS volumes

| "added in version" 1.9 of ansible.builtin"

Authors: Taneli Leppä (@rosmo)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Create, remove, start, stop and tune GlusterFS volumes

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: create gluster volume
  gluster_volume:
    state: present
    name: test1
    bricks: /bricks/brick1/g1
    rebalance: yes
    cluster:
      - 192.0.2.10
      - 192.0.2.11
  run_once: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: tune
  gluster_volume:
    state: present
    name: test1
    options:
      performance.cache-size: 256MB
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set multiple options on GlusterFS volume
  gluster_volume:
    state: present
    name: test1
    options:
      { performance.cache-size: 128MB,
        write-behind: 'off',
        quick-read: 'on'
      }
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: start gluster volume
  gluster_volume:
    state: started
    name: test1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: limit usage
  gluster_volume:
    state: present
    name: test1
    directory: /foo
    quota: 20.0MB
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: stop gluster volume
  gluster_volume:
    state: stopped
    name: test1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove gluster volume
  gluster_volume:
    state: absent
    name: test1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: create gluster volume with multiple bricks
  gluster_volume:
    state: present
    name: test2
    bricks: /bricks/brick1/g2,/bricks/brick2/g2
    cluster:
      - 192.0.2.10
      - 192.0.2.11
  run_once: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove the bricks from gluster volume
  gluster_volume:
    state: present
    name: testvol
    bricks: /bricks/brick1/b1,/bricks/brick2/b2
    cluster:
      - 10.70.42.85
    force: true
  run_once: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Reduce cluster configuration
  gluster_volume:
    state: present
    name: testvol
    bricks: /bricks/brick3/b1,/bricks/brick4/b2
    replicas: 2
    cluster:
      - 10.70.42.85
    force: true
  run_once: true

Inputs

    
host:
    description:
    - Override local hostname (for peer probing purposes).

name:
    aliases:
    - volume
    description:
    - The volume name.
    required: true

force:
    description:
    - If brick is being created in the root partition, module will fail. Set force to
      true to override this behaviour.
    type: bool

quota:
    description:
    - Quota value for limit-usage (be sure to use 10.0MB instead of 10MB, see quota list).

state:
    choices:
    - absent
    - present
    - started
    - stopped
    description:
    - Use present/absent ensure if a volume exists or not. Use started/stopped to control
      its availability.
    required: true

bricks:
    aliases:
    - brick
    description:
    - Brick paths on servers. Multiple brick paths can be separated by commas.

cluster:
    description:
    - List of hosts to use for probing and brick setup.

options:
    description:
    - A dictionary/hash with options/settings for the volume.

stripes:
    description:
    - Stripe count for volume.

arbiters:
    description:
    - Arbiter count for volume.
    version_added: '2.3'
    version_added_collection: ansible.builtin

replicas:
    description:
    - Replica count for volume.

directory:
    description:
    - Directory for limit-usage.

disperses:
    description:
    - Disperse count for volume.
    version_added: '2.2'
    version_added_collection: ansible.builtin

rebalance:
    default: 'no'
    description:
    - Controls whether the cluster is rebalanced after changes.
    type: bool

transport:
    choices:
    - tcp
    - rdma
    - tcp,rdma
    default: tcp
    description:
    - Transport type for volume.

redundancies:
    description:
    - Redundancy count for volume.
    version_added: '2.2'
    version_added_collection: ansible.builtin

start_on_create:
    default: 'yes'
    description:
    - Controls whether the volume is started after creation or not.
    type: bool