Skip to content

Latest commit

 

History

History
65 lines (52 loc) · 2.71 KB

contrail-module.md

File metadata and controls

65 lines (52 loc) · 2.71 KB

Contrail - Manages Contrail resources

Synopsis

  • Use the Juniper's Contrail's REST API.
  • Does not support authentication yet.
  • Support check mode.

Requirements

The below requirements are needed on the Ansible controller that executes this module.

  • Ansible plugin httpapi.contrail

Parameters

Parameter Choices/Defaults Comments
name
string/required
Contrail's resource name (e.g. my_vpc)
type
string/required
Contrail's resource type (e.g. virtual-network)
domain
string/required
Contrail's domain name (e.g. default-domain)
project
string/required
Contrail's project name (e.g. vCenter)
definition
complex
The resource defnition as specifiec in Contrail API
state
string/required
- present
- absent
- query
Determine if an object should be created, patched, deleted or queried. When set to present, a resource will be created, if it does not already exist. If set to absent, an existing resource will be deleted. If set to present, an existing resource will be patched, if its attributes differ from those specified using definition. If set to query, the resource properties will be collected.

Examples

- name: Setup a virtual network
  contrail:
    name: test_ansible_1
    type: virtual-network
    domain: default-domain
    project: vCenter
    state: present
    definition:
      network_ipam_refs:
        - attr:
            ipam_subnets:
              - subnet:
                  ip_prefix: 100.100.100.0
                  ip_prefix_len: 24
          to:
            - default-domain
            - vCenter
            - vCenter-ipam

- name: Query a virtual network
  contrail:
    name: test_ansible_1
    type: virtual-network
    domain: default-domain
    project: vCenter
    state: present

Return values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
result
complex
always Contrail response
result.api
integer
always API response