jedimt.nebulon_manage_volumes

Ansible Role: Nebulon Manage Volumes

==========

This role is used to manage volumes for Nebulon nPods.

Requirements


  • NebPyClient version 2.0.8 or newer
  • Nebulon Ansible Module version 1.4.0 or newer

Role Variables


Variables can be found in the defaults/main.yml file. In this example, the SPU serial numbers are kept in an Ansible vault.

# State for all volumes (present or absent)
volume_state: present

# Define the LUN export method (doesn't change the actual volume)
# (present|all) -> All nPod servers can access the export
# (host) -> Make export available to only one host. Needs host_uuid
# (local) -> Export available only to the local host that owns the volume
# (absent) -> Remove the volume export
export_type: local

# nPod name used for managing volumes/exports
npod_name: "K8s_Lenovo"

host_uuid:

# List of volumes to manage (create or delete)
volumes:
  - name: "server-10-local-kadalu"
    size: 1000000000000
    mirrored: true
    owner_spu_serial: "{{ server-10-spu-serial }}"
    backup_spu_serial: "{{ server-09-spu-serial }}"
    state: "{{ volume_state }}"

  - name: "server-11-local-kadalu"
    size: 1000000000000
    mirrored: true
    owner_spu_serial: "{{ server-11-spu-serial }}"
    backup_spu_serial: "{{ server-12-spu-serial }}"
    state: "{{ volume_state }}"

  - name: "server-12-local-kadalu"
    size: 1000000000000
    mirrored: true
    owner_spu_serial: "{{ server-12-spu-serial }}"
    backup_spu_serial: "{{ server-11-spu-serial }}"
    state: "{{ volume_state }}"

Dependencies


None.

Example Playbook


# ===========================================================================
# Manage Nebulon Volumes
# ===========================================================================

# How to run:
# ansible-playbook -i inventory/lenovo.yml playbooks/ansible-playbook-nebulon-volume/manage_nebulon_volumes.yml

- name: Manage Nebulon Volumes
  hosts: localhost
  connection: local
  tags: play_neb_vols
  gather_facts: false

  # module_defaults requires nebulon.nebulon_on version 1.2.1 or newer
  module_defaults:
    group/nebulon.nebulon_on.nebulon:
      neb_username: "{{ vault_neb_username }}"
      neb_password: "{{ vault_neb_password }}"

  vars_files:
    # Ansible vault for all passwords needed
    - "../../credentials.yml"
    # Ansible vault for server and SPU serial numbers
    - "../../serials.yml"

  roles:
    - { role: jedimt.nebulon_manage_volumes }

License


MIT License

Author Information


Aaron Patten
aaronpatten@gmail.com

Informazioni sul progetto

Manage Nebulon volumes

Installa
ansible-galaxy install jedimt.nebulon_manage_volumes
Licenza
mit
Download
89
Proprietario