Skip to content

cml_node | making started/stopped/wiped states only changing state#48

Open
tvarohohlavy wants to merge 4 commits intoCiscoDevNet:mainfrom
tvarohohlavy:cml_node_state_changes
Open

cml_node | making started/stopped/wiped states only changing state#48
tvarohohlavy wants to merge 4 commits intoCiscoDevNet:mainfrom
tvarohohlavy:cml_node_state_changes

Conversation

@tvarohohlavy
Copy link

  1. I have optimized the wait to use native node methods argument wait (just cleanup)
  2. I have done following changes to the behavior of state changes:
state current behavior new behavior reason
started config and image_definition can be rewritten node is just started, not altered this should just start the node
stopped N/A N/A no change
wiped does fail when node is running node will be stopped first this way if node exist operation is idempotent and will make sure node is wiped

all 3 states will make sure the requested state is applied if node exist otherwise will return failed if node does not exist.

Absent state is currently not implemented, but part of following PR: #47

Examples:

  - name: Create, Start, Stop, Wipe
    cisco.cml.cml_node:
      name: "{{ item.hostname }}"
      node_definition: unmanaged_switch
      state: "{{ item.state | default(omit) }}"
    loop:
      - hostname: switch01 # created
      - hostname: switch01 # started
        state: started
      - hostname: switch01 # stopped
        state: stopped
      - hostname: switch01 # started
        state: started
      - hostname: switch01 # stopped and wiped
        state: wiped

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