phoenixnap.bmc.storage_network_volume (1.17.0) — module

add/remove Volume from a Storage Network.

| "added in version" 1.11.0 of phoenixnap.bmc"

Authors: Pavle Jojkic (@pajuga) <pavlej@phoenixnap.com>, Goran Jelenic (@goranje) <goranje@phoenixnap.com>

preview | supported by certified

Install collection

Install with ansible-galaxy collection install phoenixnap.bmc:==1.17.0


Add to requirements.yml

  collections:
    - name: phoenixnap.bmc
      version: 1.17.0

Description

add/remove Volume from a Storage Network.

This module has a dependency on requests

API is documented at U(https://developers.phoenixnap.com/docs/network-storage/1/overview).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# All the examples assume that you have file config.yaml with your 'clientId' and 'clientSecret'
# in location: ~/.pnap/config.yaml

- name: Create a volume belonging to a storage network.
  hosts: localhost
  gather_facts: false
  vars_files:
    - ~/.pnap/config.yaml
  tasks:
    - name: Create a volume belonging to a storage network.
      phoenixnap.bmc.storage_network_volume:
        client_id: "{{ clientId }}"
        client_secret: "{{ clientSecret }}"
        storage_network_id: e6afba51-7de8-4080-83ab-0f915570659c
        volume_name: myvolume
        capacityInGb: 1000
        state: present
      register: output
    - name: Print the storage network information
      ansible.builtin.debug:
        var: output.storage_network_ip_block
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete a Storage Network's Volume
  hosts: localhost
  gather_facts: false
  vars_files:
    - ~/.pnap/config.yaml
  tasks:
    - name: Delete a Storage Network's Volume
      phoenixnap.bmc.storage_network_volume:
        client_id: "{{ clientId }}"
        client_secret: "{{ clientSecret }}"
        storage_network_id: e6afba51-7de8-4080-83ab-0f915570659c
        volume_id: 60473a6115e34466c9f8f083
        state: absent
      register: output
    - name: Print the storage network information
      ansible.builtin.debug:
        var: output.storage_network_volume

Inputs

    
tags:
    description: Tag request to assign to resource.
    elements: dict
    suboptions:
      name:
        description: The name of the tag.
        type: str
      value:
        description: The value of the tag assigned to the resource.
        type: str
    type: list

state:
    choices:
    - present
    - absent
    default: present
    description: Indicate desired state of the target.
    type: str

client_id:
    description: Client ID (Application Management)
    type: str

volume_id:
    description: ID of volume.
    type: str

description:
    description: Volume description.
    type: str

path_suffix:
    description: Last part of volume's path.
    type: str

permissions:
    description: permissions for a volume.
    suboptions:
      nfs:
        description: NFS specific permissions on a volume.
        suboptions:
          all_squash:
            description: All squash permission.
            elements: str
            type: list
          no_squash:
            description: No squash permission.
            elements: str
            type: list
          read_only:
            description: Read only access.
            elements: str
            type: list
          read_write:
            description: Read/Write access.
            elements: str
            type: list
          root_squash:
            description: Root squash permission.
            elements: str
            type: list
        type: dict
    type: dict

volume_name:
    description: Volume friendly name.
    type: str

client_secret:
    description: Client Secret (Application Management)
    type: str

capacity_in_gb:
    description: Capacity of Volume in GB.
    type: int

volume_new_name:
    description: Volume new name
    type: str

storage_network_id:
    description: ID of storage network.
    required: true
    type: str

Outputs

storage_network_volume:
  contains:
    capacityInGb:
      description: Maximum capacity in GB.
      returned: always
      sample: 1000
      type: int
    createdOn:
      description: date-time
      returned: always
      type: str
    deleteRequestedOn:
      description: Date and time of the initial request for volume deletion.
      returned: always
      type: str
    description:
      description: Volume description.
      returned: always
      sample: My volume description
      type: str
    id:
      description: Volume ID.
      returned: always
      sample: 60473a6115e34466c9f8f083
      type: str
    name:
      description: Volume friendly name.
      returned: always
      sample: My volume name
      type: str
    path:
      description: Volume's full path.
      returned: always
      sample: /qjul77ahf5fplr2ba484/shared-docs
      type: str
    pathSuffix:
      description: Last part of volume's path.
      returned: always
      sample: /shared-docs
      type: str
    permissions:
      contains:
        nfs:
          contains:
            allSquash:
              description: All squash permission.
              elements: str
              type: list
            noSquash:
              description: No squash permission.
              elements: str
              type: list
            readOnly:
              description: Read only access.
              elements: str
              type: list
            readWrite:
              description: Read/Write access.
              elements: str
              type: list
            rootSquash:
              description: Root squash permission.
              elements: str
              type: list
          description: NFS specific permissions on a volume.
          type: dict
      description: Permissions for a volume.
      type: dict
    protocol:
      description: File system protocol.
      returned: always
      sample: NFS
      type: str
    status:
      description: Status of the resource.
      returned: always
      sample: READY
      type: str
    tags:
      contains:
        createdBy:
          description: Who the tag was created by.
          type: str
        id:
          description: The unique id of the tag.
          type: str
        isBillingTag:
          description: Whether or not to show the tag as part of billing and invoices.
          type: bool
        name:
          description: The name of the tag.
          type: str
        value:
          description: The value of the tag assigned to the resource.
          type: str
      description: The tags assigned if any.
      type: list
    usedCapacityInGb:
      description: Used capacity in GB, updated periodically.
      returned: always
      sample: 1000
      type: int
  description: The specified Volume information
  returned: success
  type: complex