cisco.intersight.intersight_virtual_media_policy (2.0.8) — module

Virtual Media policy configuration for Cisco Intersight

Authors: David Soper (@dsoper2), Sid Nath (@SidNath21)

preview | supported by community

Install collection

Install with ansible-galaxy collection install cisco.intersight:==2.0.8


Add to requirements.yml

  collections:
    - name: cisco.intersight
      version: 2.0.8

Description

Virtual Media policy configuration for Cisco Intersight.

Used to configure Virtual Media image mappings on Cisco Intersight managed devices.

For more information see L(Cisco Intersight,https://intersight.com/apidocs).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure Virtual Media Policy
  cisco.intersight.intersight_virtual_media_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: DevNet
    name: lab-vmedia
    description: Virutal Media policy for lab use
    tags:
      - Key: Site
        Value: RCDN
    cdd_virtual_media:
      mount_type: nfs
      volume: nfs-cdd
      remote_hostname: 172.28.224.77
      remote_path: mnt/SHARE/ISOS/CENTOS
      remote_file: CentOS7.iso
    hdd_virtual_media:
      mount_type: nfs
      volume: nfs-hdd
      remote_hostname: 172.28.224.77
      remote_path: mnt/SHARE/ISOS/CENTOS
      remote_file: CentOS7.iso
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete Virtual Media Policy
  cisco.intersight.intersight_virtual_media_policy:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    organization: DevNet
    name: lab-vmedia
    state: absent

Inputs

    
name:
    description:
    - The name assigned to the NTP policy.
    - The name must be between 1 and 62 alphanumeric characters, allowing special characters
      :-_.
    required: true
    type: str

tags:
    description:
    - List of tags in Key:<user-defined key> Value:<user-defined value> format.
    elements: dict
    type: list

state:
    choices:
    - present
    - absent
    default: present
    description:
    - If C(present), will verify the resource is present and will create if needed.
    - If C(absent), will verify the resource is absent and will delete if needed.
    type: str

enable:
    default: true
    description:
    - Enable or disable virtual media.
    type: bool

api_uri:
    default: https://intersight.com/api/v1
    description:
    - URI used to access the Intersight API.
    - If not set, the value of the INTERSIGHT_API_URI environment variable is used.
    type: str

use_proxy:
    default: true
    description:
    - If C(no), it will not use a proxy, even if one is defined in an environment variable
      on the target hosts.
    type: bool

api_key_id:
    description:
    - Public API Key ID associated with the private key.
    - If not set, the value of the INTERSIGHT_API_KEY_ID environment variable is used.
    required: true
    type: str

encryption:
    default: false
    description:
    - If enabled, allows encryption of all Virtual Media communications
    type: bool

description:
    aliases:
    - descr
    description:
    - The user-defined description of the NTP policy.
    - Description can contain letters(a-z, A-Z), numbers(0-9), hyphen(-), period(.), colon(:),
      or an underscore(_).
    type: str

organization:
    default: default
    description:
    - The name of the Organization this resource is assigned to.
    - Profiles and Policies that are created within a Custom Organization are applicable
      only to devices in the same Organization.
    type: str

low_power_usb:
    default: true
    description:
    - If enabled, the virtual drives appear on the boot selection menu after mapping the
      image and rebooting the host.
    type: bool

validate_certs:
    default: true
    description:
    - Boolean control for verifying the api_uri TLS certificate
    type: bool

api_private_key:
    description:
    - Filename (absolute path) or string of PEM formatted private key data to be used
      for Intersight API authentication.
    - If a string is used, Ansible vault should be used to encrypt string data.
    - Ex. ansible-vault encrypt_string --vault-id tme@/Users/dsoper/Documents/vault_password_file
      '-----BEGIN EC PRIVATE KEY-----
    - '    <your private key data>'
    - '    -----END EC PRIVATE KEY-----'''
    - If not set, the value of the INTERSIGHT_API_PRIVATE_KEY environment variable is
      used.
    required: true
    type: path

cdd_virtual_media:
    description:
    - CDD Virtual Media image mapping options.
    suboptions:
      authentication_protocol:
        default: none
        description:
        - Authentication Protocol for CIFS Mount Type
        required: false
        type: str
      enable:
        default: true
        description:
        - Enable or disable CDD image mapping.
        type: bool
      mount_options:
        description:
        - Mount options for the Virtual Media mapping.
        - For NFS, supported options are ro, rw, nolock, noexec, soft, port=VALUE, timeo=VALUE,
          retry=VALUE
        - For CIFS, supported options are soft, nounix, noserverino, guest
        required: false
        type: str
      mount_type:
        choices:
        - nfs
        - cifs
        - http
        - https
        description:
        - Type (protocol) of network share used by the remote_hostname.
        - Ensure that the remote_hostname's communication port for the mount type that
          you choose is accessible from the managed endpoint.
        - For CIFS as your mount type, ensure port 445 (which is its communication port)
          on the remote_hostname is accessible.
        - For HTTP, ensure port 80 is accessible.
        - For HTTPS, ensure port 443 is accessible.
        - For NFS, ensure port 2049 is accessible.
        required: true
        type: str
      password:
        description:
        - The password for the selected username, if required.
        type: str
      remote_file:
        description:
        - Filename of the remote image.
        - Ex. custom_image.iso
        required: true
        type: str
      remote_hostname:
        description:
        - Hostname or IP address of the server hosting the virtual media image.
        required: true
        type: str
      remote_path:
        description:
        - Filepath (not including the filename) of the remote image.
        - Ex. mnt/SHARE/ISOS
        required: true
        type: str
      username:
        description:
        - The username for the specified Mount Type, if required.
        type: str
      volume:
        description:
        - A user defined name of the image mounted for mapping.
        required: true
        type: str
    type: dict

hdd_virtual_media:
    description:
    - HDD Virtual Media image mapping options.
    suboptions:
      authentication_protocol:
        default: none
        description:
        - Authentication Protocol for CIFS Mount Type
        required: false
        type: str
      enable:
        default: true
        description:
        - Enable or disable HDD image mapping.
        type: bool
      mount_options:
        description:
        - Mount options for the Virtual Media mapping.
        - For NFS, supported options are ro, rw, nolock, noexec, soft, port=VALUE, timeo=VALUE,
          retry=VALUE
        - For CIFS, supported options are soft, nounix, noserverino, guest
        required: false
        type: str
      mount_type:
        choices:
        - nfs
        - cifs
        - http
        - https
        description:
        - Type (protocol) of network share used by the remote_hostname.
        - Ensure that the remote_hostname's communication port for the mount type that
          you choose is accessible from the managed endpoint.
        - For CIFS as your mount type, ensure port 445 (which is its communication port)
          on the remote_hostname is accessible.
        - For HTTP, ensure port 80 is accessible.
        - For HTTPS, ensure port 443 is accessible.
        - For NFS, ensure port 2049 is accessible.
        required: true
        type: str
      password:
        description:
        - The password for the selected username, if required.
        type: str
      remote_file:
        description:
        - Filename of the remote image.
        - Ex. custom_image.iso
        required: true
        type: str
      remote_hostname:
        description:
        - Hostname or IP address of the server hosting the virtual media image.
        required: true
        type: str
      remote_path:
        description:
        - Filepath (not including the filename) of the remote image.
        - Ex. mnt/SHARE/ISOS
        required: true
        type: str
      username:
        description:
        - The username for the specified Mount Type, if required.
        type: str
      volume:
        description:
        - A user defined name of the image mounted for mapping.
        required: true
        type: str
    type: dict

Outputs

api_repsonse:
  description: The API response output returned by the specified resource.
  returned: always
  sample:
    api_response:
      Name: lab-ntp
      ObjectType: ntp.Policy
      Tags:
      - Key: Site
        Value: RCDN
  type: dict