Skip to content

Commit

Permalink
adding cleanup files
Browse files Browse the repository at this point in the history
  • Loading branch information
sugetha24 committed Feb 14, 2024
1 parent da26810 commit fa66d9f
Show file tree
Hide file tree
Showing 13 changed files with 1,330 additions and 0 deletions.
77 changes: 77 additions & 0 deletions ansible_collections/arista/avd/molecule/deploy_to_cv/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
- name: Converge - Configuration deployment with CVP
hosts: localhost
connection: local
gather_facts: false
vars:
# cv_server: staticstudio-1-cfec4cc2-eos.topo.testdrive.arista.com
cv_server: www.cv-staging.corp.arista.io
# token: "{{ lookup('file', playbook_dir ~ '/token-cvaas.tok')}}"
token: "{{ lookup('env', 'CVAAS_AAWG_DEMO') }}"
# ws_url: https://{{ cv_server }}/api/v3/services/arista.configlet.v1.ConfigletService/GetOne
# cc_url: https://{{ cv_server }}/api/v3/services/arista.changecontrol.v1.ChangeControlService/GetOne
# tag_url: https://{{ cv_server }}/api/v3/services/arista.tag.v2.TagAssignmentService/GetOne
configuration_dir: "{{ playbook_dir }}/intended/configs/base_configs"
structured_config_dir: "{{ playbook_dir }}/intended/structured_configs/base_configs"
# strict_configuration_dir: "{{ playbook_dir }}/intended/configs/strict_tags"
# strict_structured_config_dir: "{{ playbook_dir }}/intended/structured_configs/strict_tags"
# value_configuration_dir: "{{ playbook_dir }}/intended/configs/change_tags"
# value_structured_config_dir: "{{ playbook_dir }}/intended/structured_configs/change_tags"
# intended_tag_device: s1-leaf1
# intended_tags: "{{ lookup('file', structured_config_dir ~ '/' ~ intended_tag_device ~ '.yml')|from_yaml }}"
# # intended_strict_tag_device: s1-leaf1-strict_tags
# intended_strict_tags: "{{ lookup('file', strict_structured_config_dir ~ '/' ~ intended_tag_device ~ '.yml')|from_yaml }}"
# intended_value_tags: "{{ lookup('file', value_structured_config_dir ~ '/' ~ intended_tag_device ~ '.yml')|from_yaml }}"


tasks:
- name: Generate random string
set_fact:
r: "{{ lookup('password', '/dev/null chars=ascii_lowercase,digits length=4') }}"
run_once: true

- name: Check token from env
ansible.builtin.shell: echo "token is read"
when: token != ''

- name: set facts
set_fact:
ws_name: avd-static-studio-cleanup-{{ r }}
ws_description: sample description
ws_req_state: submitted
ws_force: true
cc_name: cc_avd_studio-cleanup-{{ r }}
cc_requested_state: running
cc_desctiption: sample description
run_once: true

- name: Clean up = and provision CVP with with base AVD configuration
run_once: true
delegate_to: localhost
arista.avd.deploy_to_cv:
configuration_dir: "{{ configuration_dir }}"
structured_config_dir: "{{ structured_config_dir }}"
# structured_config_suffix: "yml"
# device_list: "{{ ansible_play_hosts }}"
device_list: ["s1-leaf1", "s1-leaf2", "s1-leaf3", "s1-leaf4", "s1-spine1", "s1-spine2"]
strict_tags: true
# skip_strict_devices: false
# configlet_name_template: "AVD-${hostname}"
cv_servers: [ '{{ cv_server }}' ]
cv_token: '{{ token }}'
# cv_verify_certs: True
workspace:
name: '{{ ws_name }}'
description: '{{ ws_description }}'
id: '{{ ws_name }}'
requested_state: '{{ ws_req_state }}'
force: '{{ ws_force }}'
change_control:
name: '{{ cc_name }}'
description: '{{ cc_desctiption }}'
requested_state: '{{ cc_requested_state }}'
# timeouts:
# workspace_build_timeout: 300.0
# change_control_creation_timeout: 300.0
return_details: true
register: CVP_RESULTS
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
!RANCID-CONTENT-TYPE: arista
!
no aaa root
!
username cvpadmin privilege 15 role network-admin secret sha512 $6$zWeb8jvKJY8ZtQkD$QzZDALGL1yDmjOxiGUNVJNyBU2la8AXPW04OmxaBt7JEfAgNU9QULOkG2HmwD3x8hFoo2LnwtjbX.Muj/dXlH0
username netadmin privilege 15 role network-admin secret sha512 $6$wdCCRfpWoyE3pTFJ$sMePFNrFSFKUVFxlxMTkB7E90tgwiz7BDtcUpBH5ga4Co/N59tsselElTZyYA.LDuSnVl2t/FH.qc1FX9fzNM/
username arista privilege 15 role network-admin secret arista123!
!
daemon TerminAttr
exec /usr/bin/TerminAttr -cvaddr=apiserver.cv-staging.corp.arista.io:443 -cvauth=token-secure,/mnt/flash/cv-onboarding-token -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -ingestexclude=/Sysdb/cell/1/agent,/Sysdb/cell/2/agent -cvvrf=MGMT -taillogs
no shutdown
!
vlan internal order ascending range 3900 4000
!
transceiver qsfp default-mode 4x10G
!
service routing protocols model multi-agent
!
hostname s1-leaf1
ip name-server vrf MGMT 172.22.22.40
!
platform tfa
personality arfa
!
spanning-tree mode mstp
!
system l1
unsupported speed action error
unsupported error-correction action error
!
vrf instance MGMT
!
management api http-commands
no shutdown
!
vrf MGMT
no shutdown
!
interface Ethernet1
!
interface Ethernet2
!
interface Ethernet3
!
interface Ethernet4
!
interface Ethernet6
!
interface Management0
vrf MGMT
ip address 172.20.20.2/24
ipv6 address 2001:172:20:20::2/64
!
no ip routing
no ip routing vrf MGMT
!
ip route vrf MGMT 0.0.0.0/0 172.20.20.1
!
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
!RANCID-CONTENT-TYPE: arista
!
no aaa root
!
username cvpadmin privilege 15 role network-admin secret sha512 $6$1Xramu7r/0xmdLCk$AjZmoBkUwcs55uiTvZdKX6.UsOXjQNZbtjeXEeUPel7yBtLsIj8LPqQnxWWFFJop/8XWk4As8wTiZFJ1vC4j/0
username netadmin privilege 15 role network-admin secret sha512 $6$9HuUPp8hGLEhjim1$JXEkaiym7aiZdyNe16OVrXpxPPZ2AjxOXKIU4y3hRLWr57lwU404UP4cSPTmXNNA60.ioVRfYtaIdQB5KqZxk.
username arista privilege 15 role network-admin secret arista123!
!
daemon TerminAttr
exec /usr/bin/TerminAttr -cvaddr=apiserver.cv-staging.corp.arista.io:443 -cvauth=token-secure,/mnt/flash/cv-onboarding-token -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -ingestexclude=/Sysdb/cell/1/agent,/Sysdb/cell/2/agent -cvvrf=MGMT -taillogs
no shutdown
!
vlan internal order ascending range 3900 4000
!
transceiver qsfp default-mode 4x10G
!
service routing protocols model multi-agent
!
hostname s1-leaf2
ip name-server vrf MGMT 172.22.22.40
!
platform tfa
personality arfa
!
spanning-tree mode mstp
!
system l1
unsupported speed action error
unsupported error-correction action error
!
vrf instance MGMT
!
management api http-commands
no shutdown
!
vrf MGMT
no shutdown
!
interface Ethernet1
!
interface Ethernet2
!
interface Ethernet3
!
interface Ethernet4
!
interface Ethernet6
!
interface Management0
vrf MGMT
ip address 172.20.20.2/24
ipv6 address 2001:172:20:20::2/64
!
no ip routing
no ip routing vrf MGMT
!
ip route vrf MGMT 0.0.0.0/0 172.20.20.1
!
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
!RANCID-CONTENT-TYPE: arista
!
! Command: show running-config
! device: s1-leaf3 (cEOSLab, EOS-4.31.1F-34554157.4311F (engineering build))
!
no aaa root
!
username cvpadmin privilege 15 role network-admin secret sha512 $6$HNM7G0gSdiRYs4tD$vzmvMIop1QgWrFFbEjfRQPzjZO5NvptNCTZVsLZU130XSOPKam3TSXr9XnPfgMJaXheET//ms3amQ32xxZLme.
username netadmin privilege 15 role network-admin secret sha512 $6$XoEontx4/LyZdDy/$1L.EXBocg2BVQFQwIZppvkKADGrj5CYEWoKXMrqEJs.qpmjKyCUhZ6ibQ70kHx0RomOrNxRQzs13mCNY3ym...
username arista privilege 15 role network-admin secret arista123!
!
daemon TerminAttr
exec /usr/bin/TerminAttr -cvaddr=apiserver.cv-staging.corp.arista.io:443 -cvauth=token-secure,/mnt/flash/cv-onboarding-token -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -ingestexclude=/Sysdb/cell/1/agent,/Sysdb/cell/2/agent -cvvrf=MGMT -taillogs
no shutdown
!
vlan internal order ascending range 3900 4000
!
transceiver qsfp default-mode 4x10G
!
service routing protocols model multi-agent
!
hostname s1-leaf3
ip name-server vrf MGMT 172.22.22.40
!
platform tfa
personality arfa
!
spanning-tree mode mstp
!
system l1
unsupported speed action error
unsupported error-correction action error
!
vrf instance MGMT
!
management api http-commands
no shutdown
!
vrf MGMT
no shutdown
!
interface Ethernet1
!
interface Ethernet2
!
interface Ethernet3
!
interface Ethernet4
!
interface Ethernet6
!
interface Management0
vrf MGMT
ip address 172.20.20.2/24
ipv6 address 2001:172:20:20::2/64
!
no ip routing
no ip routing vrf MGMT
!
ip route vrf MGMT 0.0.0.0/0 172.20.20.1
!
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
!RANCID-CONTENT-TYPE: arista
!
no aaa root
!
username cvpadmin privilege 15 role network-admin secret sha512 $6$sXO/9BwBxfmc2it9$/v6Eddob3cElunU60LKbXJZ2ind/W6ju4LAGr0bFOPaxc49pFFzjnUB.//v9F60olyrOrmmbXV62kbBwN4O7w.
username netadmin privilege 15 role network-admin secret sha512 $6$78gSPkPb3N3dfmqM$WVUUE/QTbpSZFuHRVi.wGhVV9T543laKjUlmgtZGj8ovJsLMPBXk1gOqwTbLWZEEUAzoDZydYniPFEMQ0pwBL.
username arista privilege 15 role network-admin secret arista123!
!
daemon TerminAttr
exec /usr/bin/TerminAttr -cvaddr=apiserver.cv-staging.corp.arista.io:443 -cvauth=token-secure,/mnt/flash/cv-onboarding-token -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -ingestexclude=/Sysdb/cell/1/agent,/Sysdb/cell/2/agent -cvvrf=MGMT -taillogs
no shutdown
!
vlan internal order ascending range 3900 4000
!
transceiver qsfp default-mode 4x10G
!
service routing protocols model multi-agent
!
hostname s1-leaf4
ip name-server vrf MGMT 172.22.22.40
!
platform tfa
personality arfa
!
spanning-tree mode mstp
!
system l1
unsupported speed action error
unsupported error-correction action error
!
vrf instance MGMT
!
management api http-commands
no shutdown
!
vrf MGMT
no shutdown
!
interface Ethernet1
!
interface Ethernet2
!
interface Ethernet3
!
interface Ethernet4
!
interface Ethernet6
!
interface Management0
vrf MGMT
ip address 172.20.20.2/24
ipv6 address 2001:172:20:20::2/64
!
no ip routing
no ip routing vrf MGMT
!
ip route vrf MGMT 0.0.0.0/0 172.20.20.1
!
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
!RANCID-CONTENT-TYPE: arista
!
no aaa root
!
username cvpadmin privilege 15 role network-admin secret sha512 $6$p7VOAkEcf9QaHur9$yQpwEW/AbIKGeUofve7SPB8sOVqsAxx4mOcW/0eU.dtMfnwrE844ZJkk18s0Hf4mUxrUXJdHmvFUpAcY2g6oU1
username netadmin privilege 15 role network-admin secret sha512 $6$CxQZipOJ8hrWFo8H$8SIcQzvft3SmAbIQaJXcFOZoIX4bAf3ANUeBA2pmChbSQewJaMn4Xz9aMPTc9hS9xKYRwfg8lWRezXfXd4COM0
username arista privilege 15 role network-admin secret arista123!
!
daemon TerminAttr
exec /usr/bin/TerminAttr -cvaddr=apiserver.cv-staging.corp.arista.io:443 -cvauth=token-secure,/mnt/flash/cv-onboarding-token -smashexcludes=ale,flexCounter,hardware,kni,pulse,strata -ingestexclude=/Sysdb/cell/1/agent,/Sysdb/cell/2/agent -cvvrf=MGMT -taillogs
no shutdown
!
vlan internal order ascending range 3900 4000
!
transceiver qsfp default-mode 4x10G
!
service routing protocols model multi-agent
!
hostname s1-spine1
ip name-server vrf MGMT 172.22.22.40
!
platform tfa
personality arfa
!
spanning-tree mode mstp
!
system l1
unsupported speed action error
unsupported error-correction action error
!
vrf instance MGMT
!
management api http-commands
no shutdown
!
vrf MGMT
no shutdown
!
interface Ethernet1
!
interface Ethernet2
!
interface Ethernet3
!
interface Ethernet4
!
interface Ethernet5
!
interface Ethernet6
!
interface Ethernet7
!
interface Ethernet8
!
interface Management0
vrf MGMT
ip address 172.20.20.2/24
ipv6 address 2001:172:20:20::2/64
!
no ip routing
no ip routing vrf MGMT
!
ip route vrf MGMT 0.0.0.0/0 172.20.20.1
!
end
Loading

0 comments on commit fa66d9f

Please sign in to comment.