Skip to content

Module Support for config_actions + resource level deploy #368

Description

@mikewiebe

New module/feature description:

We need to make sure that each module supports a config_actions dictionary at the global level and a resource level deploy key.

    config_actions:
        description:
        - Controls save and deploy behavior after inventory is updated.  This option is mutually exclusive with the per resource deploy key.
        type: dict
        suboptions:
            save:
                description:
                - Save/Recalculate the configuration of the fabric after resource is updated.
                type: bool
                default: true
            deploy:
                description:
                - Deploy the pending configuration after resource is updated.
                - When set to C(true), C(save) must also be C(true). (Only if save is required for the module)
                type: bool
                default: true
            type:
                description:
                - Scope of the deploy operation.
                - C(resource) deploys using resource level deploy
                - C(switch) deploys using switch level deploy
                - C(global) deploys using global fabric level deploy
                type: str
                default: switch
                choices:
                - resource
                - switch
                - global

Notes:

  • config_actions and resource level deploy key are mutually exclusive. If both config_actions and resource level deploy are included in the module inputs an error should be generated to indicate that the user needs to pick one and the module documentation should clearly call this out.
  • config_actions.save does is not needed for all modules. Only needed for modules like fabric, switches, vpc_pair, tor_pair , few others...
  • config_actions.type under config_actions controls deployment type for all resources managed by the module
  • If the module cannot support the contract above because of of the way ND functions document the reasons clearly and call this out in the PR

Which resource area of Cisco Nexus Dashboard does this new feature belong to?

manage

New or Affected Documentation for New Feature

Potential Ansible Task Config

- name: Create an L3 Network associated with a VRF
  cisco.nd.nd_manage_networks:
    fabric_name: fab1
    state: merged
    config_actions:  <------------------- Config Actions
      deploy: true
      type: switch
    config:
      - network_name: Network_L3
        is_l2only: false
        vrf_name: Tenant_A
        network_id: 50020
        vlan_id: 2002
        vlan_name: Network_L3_VLAN
        gateway_ipv4_address: 10.10.20.1/24
        arp_suppression: true
        routing_tag: 12345
        deploy: true  <------------------- Resource level deploy

Note: One of these options must be selected by users, not both. If both config_actions and deploy key under config: are specified the module should generate an error indicating that one method must be selected.

Ansible Version

All

Ansible Collection Versions

Cisco Nexus Dashboard Version

ND4.2

Cisco NX-OS Version

Cisco ACI Version

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions