nttmcp.mcp.sec_group_info (1.0.9) — module

Get and List Security Groups

| "added in version" 2.10.0 of nttmcp.mcp"

Authors: Ken Sinfield (@kensinfield)

preview | supported by NTT Ltd.

Install collection

Install with ansible-galaxy collection install nttmcp.mcp:==1.0.9


Add to requirements.yml

  collections:
    - name: nttmcp.mcp
      version: 1.0.9

Description

Get and List Security Groups

https://docs.mcp-services.net/x/NgMu


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- hosts: 127.0.0.1
  connection: local
  collections:
    - nttmcp.mcp
  tasks:

  - name: List all Server Security Groups in a Network Domain
    sec_group_info:
      region: na
      datacenter: NA9
      network_domain: my_cnd
      type: server

  - name: List all VLAN Security Groups in a Network Domain
    sec_group_info:
      region: na
      datacenter: NA9
      network_domain: my_cnd
      type: vlan

  - name: Get a specific VLAN Security Group by Security Group name
    sec_group_info:
      region: na
      datacenter: NA9
      network_domain: my_cnd
      type: vlan
      name: my_vlan_security_group

  - name: Get a specific Server Security Group by Security Group UUID
    sec_group_info:
      region: na
      datacenter: NA9
      network_domain: my_cnd
      type: server
      id: b2fbd7e6-ddbb-4eb6-a2dd-ad048bc5b9ae

  - name: Get all Server Security Groups for a specific server
    sec_group_info:
      region: na
      datacenter: NA9
      network_domain: my_cnd
      type: server
      server: my_server

Inputs

    
id:
    description:
    - The UUID of the Security Group
    required: false
    type: str

auth:
    description:
    - Optional dictionary containing the authentication and API information for Cloud
      Control
    required: false
    suboptions:
      api:
        description:
        - The Cloud Control API endpoint e.g. api-na.mcp-services.net
        required: false
        type: str
      api_version:
        description:
        - The Cloud Control API version e.g. 2.11
        required: false
        type: str
      password:
        description:
        - The Cloud Control API user password
        required: false
        type: str
      username:
        description:
        - The Cloud Control API username
        required: false
        type: str
    type: dict

name:
    description:
    - The name of the Security Group
    - A specific value for type should be used when searching by name
    required: false
    type: str

type:
    choices:
    - vlan
    - server
    default: vlan
    description:
    - The type of security group
    required: false
    type: str

vlan:
    description:
    - The name of the vlan to search on
    required: false
    type: str

region:
    default: na
    description:
    - The geographical region
    required: false
    type: str

server:
    description:
    - The name of a server to search on
    - A specific value for type should be used when searching by server
    required: false
    type: str

datacenter:
    description:
    - The datacenter name e.g NA9
    required: true
    type: str

network_domain:
    description:
    - The name of the Cloud Network Domain
    required: true
    type: str

Outputs

data:
  contains:
    count:
      description: The number of objects returned
      returned: success
      sample: 1
      type: int
    security_group:
      contains:
        createTime:
          description: The time (in zulu) that the Security Group was created
          sample: '2019-11-26T19:29:52.000Z'
          type: str
        datacenterId:
          description: The MCP/datacenter ID
          sample: NA12
          type: str
        description:
          description: Text description
          sample: My VLAN security group
          type: str
        id:
          description: The UUID of the Security Group
          sample: b2fbd7e6-ddbb-4eb6-a2dd-ad048bc5b9ae
          type: str
        name:
          description: The name of the Security Group
          sample: my_vlan_security_group
          type: str
        nics:
          contains:
            nic:
              contains:
                id:
                  description: The UUID of the NIC
                  sample: 7b664273-05fa-467f-82c2-6dea32cdf233
                  type: str
                ipv4Address:
                  description: The IPv4 address of the NIC
                  sample: 10.0.0.7
                  type: str
                ipv6Address:
                  description: The IPv6 address of the NIC
                  sample: 1111:1111:1111:1111:0:0:0:1
                  type: str
                primary:
                  description: Is the NIC the primary NIC on the server
                  type: bool
                server:
                  contains:
                    id:
                      description: The UUID of the server
                      sample: b2fbd7e6-ddbb-4eb6-a2dd-ad048bc5b9ae
                      type: str
                    name:
                      description: The name of the server
                      sample: myServer03
                      type: str
                  description: dict containing server information for this NIC
                  type: complex
              description: List of NICs in this Security Group
              type: list
            vlanId:
              description: The UUID of the VLAN for the NICs
              sample: b2fbd7e6-ddbb-4eb6-a2dd-ad048bc5b9ae
              type: str
          description: List of NICs associated with the Security Group
          returned: type == vlan and at least 1 NIC is configured in this group
          type: complex
        servers:
          contains:
            networkDomainId:
              description: The UUID of the Cloud Network Domain
              sample: b2fbd7e6-ddbb-4eb6-a2dd-ad048bc5b9ae
              type: str
            server:
              contains:
                id:
                  description: The UUID of the server
                  sample: b2fbd7e6-ddbb-4eb6-a2dd-ad048bc5b9ae
                  type: str
                name:
                  description: The name of the server
                  sample: myServer01
                  type: str
              description: List of server objects
              type: list
          description: List of servers associated with the Security Group
          returned: type == server and at least 1 server is configured in this group
          type: complex
        state:
          description: The operational state
          sample: NORMAL
          type: str
        type:
          description: The Security Group type
          sample: VLAN
          type: str
      description: List of Security Group objects
      type: complex
  description: dict of returned Objects
  returned: success
  type: complex