Skip to content

Instantly share code, notes, and snippets.

@dsx1123
Created April 23, 2021 05:24
Show Gist options
  • Save dsx1123/6f39fc58304c69f8d88570781a9b5ad3 to your computer and use it in GitHub Desktop.
Save dsx1123/6f39fc58304c69f8d88570781a9b5ad3 to your computer and use it in GitHub Desktop.
dcnm issue template indent
 ansible-playbook -i inventory/dcnm/host dcnm_template.yml -vvvv    master 
ansible-playbook 2.10.5
config file = /root/.ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /root/virtualenv/ansible/lib/python3.7/site-packages/ansible
executable location = /root/virtualenv/ansible/bin/ansible-playbook
python version = 3.7.3 (default, Apr 3 2019, 05:39:12) [GCC 8.3.0]
Using /root/.ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /root/workspace/ansible/dcnm/inventory/dcnm/host as it did not pass its verify_file() method
script declined parsing /root/workspace/ansible/dcnm/inventory/dcnm/host as it did not pass its verify_file() method
auto declined parsing /root/workspace/ansible/dcnm/inventory/dcnm/host as it did not pass its verify_file() method
Parsed /root/workspace/ansible/dcnm/inventory/dcnm/host inventory source with ini plugin
Loading collection cisco.dcnm from /root/.ansible/collections/ansible_collections/cisco/dcnm
Loading callback plugin default of type stdout, v2.0 from /root/virtualenv/ansible/lib/python3.7/site-packages/ansible/plugins/callback/default.py
redirecting (type: callback) ansible.builtin.profile_tasks to ansible.posix.profile_tasks
Loading collection ansible.posix from /root/virtualenv/ansible/lib/python3.7/site-packages/ansible_collections/ansible/posix
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
Loading callback plugin ansible.posix.profile_tasks of type aggregate, v2.0 from /root/virtualenv/ansible/lib/python3.7/site-packages/ansible_collections/ansible/posix/plugins/callback/profile_tasks.py
PLAYBOOK: dcnm_template.yml **********************************************************************************************************************************************************************************************************************
Positional arguments: dcnm_template.yml
verbosity: 4
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/root/workspace/ansible/dcnm/inventory/dcnm/host',)
forks: 5
1 plays in dcnm_template.yml
PLAY [create template for telemery] **************************************************************************************************************************************************************************************************************
Trying secret FileVaultSecret(filename='/root/.vault_pass') for vault_id=default
META: ran handlers
TASK [read template config from file] ************************************************************************************************************************************************************************************************************
task path: /root/workspace/ansible/dcnm/dcnm_template.yml:6
Thursday 22 April 2021 22:21:16 -0700 (0:00:00.048) 0:00:00.048 ********
File lookup using /root/workspace/ansible/dcnm/./telemetry.cfg as file
redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
Loading collection ansible.netcommon from /root/.ansible/collections/ansible_collections/ansible/netcommon
<172.25.74.53> attempting to start connection
<172.25.74.53> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /root/virtualenv/ansible/bin/ansible-connection
<172.25.74.53> local domain socket does not exist, starting it
<172.25.74.53> control socket path is /root/.ansible/pc/72455c65bb
<172.25.74.53> redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
<172.25.74.53> Loading collection ansible.netcommon from /root/.ansible/collections/ansible_collections/ansible/netcommon
<172.25.74.53> Loading collection cisco.dcnm from /root/.ansible/collections/ansible_collections/cisco/dcnm
<172.25.74.53> local domain socket listeners started successfully
<172.25.74.53> loaded API plugin ansible_collections.cisco.dcnm.plugins.httpapi.dcnm from path /root/.ansible/collections/ansible_collections/cisco/dcnm/plugins/httpapi/dcnm.py for network_os cisco.dcnm.dcnm
<172.25.74.53>
<172.25.74.53> local domain socket path is /root/.ansible/pc/72455c65bb
ok: [172.25.74.53] => {
"ansible_facts": {
"template_content": "feature telemetry\n\ntelemetry\n certificate /bootflash/telegraf.crt telegraf\n destination-profile\n use-vrf management\n destination-group 1\n ip address 10.195.225.176 port 57000 protocol gRPC encoding GPB\n sensor-group 1\n data-source DME\n path sys/ch depth unbounded\n sensor-group 2\n data-source DME\n path sys/intf depth unbounded\n sensor-group 3\n data-source DME\n path sys/bgp depth unbounded\n sensor-group 4\n data-source DME\n path sys/procsys/syscpusummary/syscpuhistory-last60seconds\n sensor-group 5\n data-source DME\n path sys/procsys/sysmem/sysmemusage\n sensor-group 6\n data-source DME\n path sys/bd depth unbounded\n sensor-group 7\n data-source DME\n path sys/mac depth unbounded\n sensor-group 8\n data-source DME\n path sys/evpn depth 4\n sensor-group 9\n data-source DME\n path sys/urib depth unbounded query-condition rsp-foreign-subtree=ephemeral\n sensor-group 10\n data-source DME\n path sys/u6rib depth unbounded query-condition rsp-foreign-subtree=ephemeral\n sensor-group 11\n data-source DME\n path sys/bgp/inst/dom-default/af-[l2vpn-evpn] depth unbounded query-condition rsp-foreign-subtree=ephemeral\n subscription 1\n dst-grp 1\n snsr-grp 1 sample-interval 10000\n subscription 2\n dst-grp 1\n snsr-grp 2 sample-interval 10000\n subscription 3\n dst-grp 1\n snsr-grp 3 sample-interval 30000\n subscription 4\n dst-grp 1\n snsr-grp 4 sample-interval 15000\n subscription 5\n dst-grp 1\n snsr-grp 5 sample-interval 15000\n subscription 6\n dst-grp 1\n snsr-grp 6 sample-interval 0\n subscription 7\n dst-grp 1\n snsr-grp 7 sample-interval 10000\n subscription 8\n dst-grp 1\n snsr-grp 8 sample-interval 15000\n subscription 9\n dst-grp 1\n snsr-grp 9 sample-interval 15000\n subscription 10\n dst-grp 1\n snsr-grp 10 sample-interval 15000\n subscription 11\n dst-grp 1\n snsr-grp 11 sample-interval 15000"
},
"changed": false
}
TASK [create template] ***************************************************************************************************************************************************************************************************************************
task path: /root/workspace/ansible/dcnm/dcnm_template.yml:10
Thursday 22 April 2021 22:21:18 -0700 (0:00:01.961) 0:00:02.009 ********
redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
Loading collection ansible.netcommon from /root/.ansible/collections/ansible_collections/ansible/netcommon
<172.25.74.53> attempting to start connection
<172.25.74.53> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /root/virtualenv/ansible/bin/ansible-connection
<172.25.74.53> found existing local domain socket, using it!
<172.25.74.53> updating play_context for connection
<172.25.74.53>
<172.25.74.53> local domain socket path is /root/.ansible/pc/72455c65bb
<172.25.74.53> ESTABLISH LOCAL CONNECTION FOR USER: root
<172.25.74.53> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-local-11567lm8wo721 `"&& mkdir "` echo /root/.ansible/tmp/ansible-local-11567lm8wo721/ansible-tmp-1619155279.8308542-11580-137627505468573 `" && echo ansible-tmp-1619155279.8308542-11580-137627505468573="` echo /root/.ansible/tmp/ansible-local-11567lm8wo721/ansible-tmp-1619155279.8308542-11580-137627505468573 `" ) && sleep 0'
<172.25.74.53> Attempting python interpreter discovery
<172.25.74.53> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<172.25.74.53> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
Using module file /root/.ansible/collections/ansible_collections/cisco/dcnm/plugins/modules/dcnm_template.py
<172.25.74.53> PUT /root/.ansible/tmp/ansible-local-11567lm8wo721/tmp57kxhv8w TO /root/.ansible/tmp/ansible-local-11567lm8wo721/ansible-tmp-1619155279.8308542-11580-137627505468573/AnsiballZ_dcnm_template.py
<172.25.74.53> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-local-11567lm8wo721/ansible-tmp-1619155279.8308542-11580-137627505468573/ /root/.ansible/tmp/ansible-local-11567lm8wo721/ansible-tmp-1619155279.8308542-11580-137627505468573/AnsiballZ_dcnm_template.py && sleep 0'
<172.25.74.53> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-local-11567lm8wo721/ansible-tmp-1619155279.8308542-11580-137627505468573/AnsiballZ_dcnm_template.py && sleep 0'
<172.25.74.53> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-local-11567lm8wo721/ansible-tmp-1619155279.8308542-11580-137627505468573/ > /dev/null 2>&1 && sleep 0'
changed: [172.25.74.53] => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python3"
},
"changed": true,
"diff": [
{
"deleted": [],
"failed": [],
"merged": [
{
"content": "##template properties\nname = telegraf_telemetry_configuration;\ndescription = telemetry configuration;\ntags = ;\nuserDefined = true;\nsupportedPlatforms = All;\ntemplateType = POLICY;\ntemplateSubType = DEVICE;\ncontentType = TEMPLATE_CLI;\nimplements = implements;\ndependencies = ;\npublished = false;\n##\n##template content\nfeature telemetry\n\ntelemetry\n certificate /bootflash/telegraf.crt telegraf\n destination-profile\n use-vrf management\n destination-group 1\n ip address 10.195.225.176 port 57000 protocol gRPC encoding GPB\n sensor-group 1\n data-source DME\n path sys/ch depth unbounded\n sensor-group 2\n data-source DME\n path sys/intf depth unbounded\n sensor-group 3\n data-source DME\n path sys/bgp depth unbounded\n sensor-group 4\n data-source DME\n path sys/procsys/syscpusummary/syscpuhistory-last60seconds\n sensor-group 5\n data-source DME\n path sys/procsys/sysmem/sysmemusage\n sensor-group 6\n data-source DME\n path sys/bd depth unbounded\n sensor-group 7\n data-source DME\n path sys/mac depth unbounded\n sensor-group 8\n data-source DME\n path sys/evpn depth 4\n sensor-group 9\n data-source DME\n path sys/urib depth unbounded query-condition rsp-foreign-subtree=ephemeral\n sensor-group 10\n data-source DME\n path sys/u6rib depth unbounded query-condition rsp-foreign-subtree=ephemeral\n sensor-group 11\n data-source DME\n path sys/bgp/inst/dom-default/af-[l2vpn-evpn] depth unbounded query-condition rsp-foreign-subtree=ephemeral\n subscription 1\n dst-grp 1\n snsr-grp 1 sample-interval 10000\n subscription 2\n dst-grp 1\n snsr-grp 2 sample-interval 10000\n subscription 3\n dst-grp 1\n snsr-grp 3 sample-interval 30000\n subscription 4\n dst-grp 1\n snsr-grp 4 sample-interval 15000\n subscription 5\n dst-grp 1\n snsr-grp 5 sample-interval 15000\n subscription 6\n dst-grp 1\n snsr-grp 6 sample-interval 0\n subscription 7\n dst-grp 1\n snsr-grp 7 sample-interval 10000\n subscription 8\n dst-grp 1\n snsr-grp 8 sample-interval 15000\n subscription 9\n dst-grp 1\n snsr-grp 9 sample-interval 15000\n subscription 10\n dst-grp 1\n snsr-grp 10 sample-interval 15000\n subscription 11\n dst-grp 1\n snsr-grp 11 sample-interval 15000##",
"template_name": "telegraf_telemetry_configuration"
}
],
"query": []
}
],
"invocation": {
"module_args": {
"check_mode": false,
"config": [
{
"content": "feature telemetry\n\ntelemetry\n certificate /bootflash/telegraf.crt telegraf\n destination-profile\n use-vrf management\n destination-group 1\n ip address 10.195.225.176 port 57000 protocol gRPC encoding GPB\n sensor-group 1\n data-source DME\n path sys/ch depth unbounded\n sensor-group 2\n data-source DME\n path sys/intf depth unbounded\n sensor-group 3\n data-source DME\n path sys/bgp depth unbounded\n sensor-group 4\n data-source DME\n path sys/procsys/syscpusummary/syscpuhistory-last60seconds\n sensor-group 5\n data-source DME\n path sys/procsys/sysmem/sysmemusage\n sensor-group 6\n data-source DME\n path sys/bd depth unbounded\n sensor-group 7\n data-source DME\n path sys/mac depth unbounded\n sensor-group 8\n data-source DME\n path sys/evpn depth 4\n sensor-group 9\n data-source DME\n path sys/urib depth unbounded query-condition rsp-foreign-subtree=ephemeral\n sensor-group 10\n data-source DME\n path sys/u6rib depth unbounded query-condition rsp-foreign-subtree=ephemeral\n sensor-group 11\n data-source DME\n path sys/bgp/inst/dom-default/af-[l2vpn-evpn] depth unbounded query-condition rsp-foreign-subtree=ephemeral\n subscription 1\n dst-grp 1\n snsr-grp 1 sample-interval 10000\n subscription 2\n dst-grp 1\n snsr-grp 2 sample-interval 10000\n subscription 3\n dst-grp 1\n snsr-grp 3 sample-interval 30000\n subscription 4\n dst-grp 1\n snsr-grp 4 sample-interval 15000\n subscription 5\n dst-grp 1\n snsr-grp 5 sample-interval 15000\n subscription 6\n dst-grp 1\n snsr-grp 6 sample-interval 0\n subscription 7\n dst-grp 1\n snsr-grp 7 sample-interval 10000\n subscription 8\n dst-grp 1\n snsr-grp 8 sample-interval 15000\n subscription 9\n dst-grp 1\n snsr-grp 9 sample-interval 15000\n subscription 10\n dst-grp 1\n snsr-grp 10 sample-interval 15000\n subscription 11\n dst-grp 1\n snsr-grp 11 sample-interval 15000",
"description": "telemetry configuration",
"name": "telegraf_telemetry_configuration"
}
],
"state": "merged"
}
},
"response": [
{
"DATA": {
"status": "Template Created "
},
"MESSAGE": "OK",
"METHOD": "POST",
"REQUEST_PATH": "https://172.25.74.53:443/rest/config/templates/template",
"RETURN_CODE": 200
}
]
}
META: ran handlers
META: ran handlers
PLAY RECAP ***************************************************************************************************************************************************************************************************************************************
172.25.74.53 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Thursday 22 April 2021 22:21:21 -0700 (0:00:02.961) 0:00:04.970 ********
===============================================================================
create template --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.96s
/root/workspace/ansible/dcnm/dcnm_template.yml:10 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
read template config from file ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 1.96s
/root/workspace/ansible/dcnm/dcnm_template.yml:6 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment