Skip to content

cml_node | creating and updating day0 config(s) via present state#49

Open
tvarohohlavy wants to merge 2 commits intoCiscoDevNet:mainfrom
tvarohohlavy:cml_node_configuration
Open

cml_node | creating and updating day0 config(s) via present state#49
tvarohohlavy wants to merge 2 commits intoCiscoDevNet:mainfrom
tvarohohlavy:cml_node_configuration

Conversation

@tvarohohlavy
Copy link

Generating day0 config(s) for new nodes and overwriting of existing node config(s) via present state.

Examples:

  - name: Create New Nodes
    cisco.cml.cml_node:
      name: "{{ item.hostname }}"
      node_definition: "{{ item.node_definition| default(omit) }}"
      config: "{{ item.config | default(omit) }}"
      state: "{{ item.state | default(omit) }}"
    loop:
      - hostname: switch01 # create node with config defined via string
        node_definition: cat9000v-uadp
        config: |-
          int gi0/0
           shut
      - hostname: switch02 # create node with config defined via dict
        node_definition: cat9000v-uadp
        config:
          name: iosxe_config.txt
          content: |-
            int gi0/0
            shut
      - hostname: switch03 # create node with config defined via list of dicts
        node_definition: cat9000v-uadp
        config:
          - name: iosxe_config.txt
            content: |-
              int gi0/0
               shut
          - name: conf/vswitch.xml
            content: |-
              ... <omitted> ...
      - hostname: switch01 # start node
         state: started
      - hostname: switch01 # wipe node before changing config
         state: wiped
      - hostname: switch01 # overwrite node config via string
        config: |-
          int gi0/0
           no shut

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