Skip to content

cml_node | add missing absent state handling#47

Open
tvarohohlavy wants to merge 1 commit intoCiscoDevNet:mainfrom
tvarohohlavy:cml_node_absent_state
Open

cml_node | add missing absent state handling#47
tvarohohlavy wants to merge 1 commit intoCiscoDevNet:mainfrom
tvarohohlavy:cml_node_absent_state

Conversation

@tvarohohlavy
Copy link

cml_node module has an absent state option which was not implemented

to make this idempotent compared to state changes (started, stopped, wiped) this state also makes sure node is stopped (if running) and wiped (if not wiped yet) before it is deleted as otherwise CML would throw an error.
Usage of wait is preferred to make sure some delay introduced does not prevent all steps: started > stopped > wiped > removed

Examples:

  - name: Create 3 Nodes
    cisco.cml.cml_node:
      name: "{{ item.hostname }}"
      node_definition: unmanaged_switch
    loop:
      - hostname: switch01
      - hostname: switch02
      - hostname: switch03

  - name: Start 2 Nodes
    cisco.cml.cml_node:
      name: "{{ item.hostname }}"
      state: started
      wait: true
    loop:
      - hostname: switch01
      - hostname: switch02

  - name: Delete 3 Nodes
    cisco.cml.cml_node:
      name: "{{ item.hostname }}"
      state: absent
      wait: true
    loop:
      - hostname: switch01
      - hostname: switch02
      - hostname: switch03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant