|
![]() |
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
![]()
Trying to take my secure cry device list and import it into ansible so i can start doing playbooks. My device list is thousands long so doing this manually is not feasible. Any help on this would be greatly appreciated.
|
#2
|
||||
|
||||
Quote:
What format does ansible allow, or what format do you need the data exported in order for it to be imported easily into ansible? --Jake
__________________
Jake Devenport VanDyke Software Technical Support YouTube Channel: https://www.youtube.com/vandykesoftware Email: support@vandyke.com Web: https://www.vandyke.com/support |
#3
|
|||
|
|||
Ok let me simply my request. Id like to take my xml exported of sessions and extract from that the session folder groups and hostnames. So if data center 1 and 2 that have 3 routers each Id like to dump that to something like this:
[data center 1] hostname 1 hostname 2 hostname 3 [data center 2] hostname 4 hostname 5 hostname 6 |
#4
|
||||
|
||||
never2spicy,
You've already engaged by email with our associate, Brenda, so you already know that we've created a feature request for a way to limit/select what gets exported using SecureCRT's Tools > Export settings... feature. I don't have any ETA as to when or if such functionality might become available in SecureCRT. But in the mean time, there is an example we link to in the Script Examples "Sticky" that shows how you might be able to iterate over saved sessions and create yourself either a CSV output file, or a .conf/INI file format that might help you get close to what you need for your purposes. The examples are only provided as a starting point for you to take and run with for creating your own personal custom solution. Good luck with your scripting efforts! --Jake
__________________
Jake Devenport VanDyke Software Technical Support YouTube Channel: https://www.youtube.com/vandykesoftware Email: support@vandyke.com Web: https://www.vandyke.com/support |
#5
|
|||
|
|||
First off Thank you for the input Jake. I cant stress this update is needed URGENTLY as this is a total more and more will be used with Ansible.
If I may Id like to give some specific input on what I'd like to see that i think would make this a super powerful tool that would pair what I believe is the best CLI tool for neteng with the bets automation tool for neteng. That said theres what I think would be powerful: Following ansibles documentation here (https://docs.ansible.com/ansible/lat...inventory.html) the ability to export a format in yaml with multiple groups so that - all hosts are in the "all:" section for global changes - folder structure exported with all sub folders as below - all hosts under folders exported for hostname field (even if just ip) - preserving the port as a host variable on the tree. That said this is what the before an after should look like: <key name="Sessions"> <key name="CzechRep"> <key name="CORE"> <key name="EULCR-CZH-EDLFSW02 - 10.197.212.13"> <dword name="[SSH2] Port">22</dword> <string name="Hostname">10.197.212.13</string> </key> <key name="EUNCR-CZH-EDLFSW01 - 10.197.212.12"> <dword name="[SSH2] Port">22</dword> <string name="Hostname">10.197.212.12</string> </key> <key name="EUNCR-CZH-SPSW01 - 10.197.212.10"> <dword name="[SSH2] Port">22</dword> <string name="Hostname">10.197.212.10</string> </key> <key name="EUNCR-CZH-SPSW02 - 10.197.212.11"> <dword name="[SSH2] Port">22</dword> <string name="Hostname">10.197.212.11</string> </key> </key> <key name="OOB Stack"> <key name="10.197.212.44"> <dword name="[SSH2] Port">22</dword> <string name="Hostname">10.197.212.44</string> </key> <key name="EUNCR-CZH-TS01 - 10.197.212.34"> <dword name="[SSH2] Port">22</dword> <string name="Hostname">10.197.212.34</string> </key> <key name="EUNCR-CZH-TS02 - 10.197.212.35"> <dword name="[SSH2] Port">22</dword> <string name="Hostname">10.197.212.35</string> </key> </key> <key name="RACK XXX"> <key name="EUNCR-CZH-ACLFSW01 - 10.197.212.14"> <dword name="[SSH2] Port">22</dword> <string name="Hostname">10.197.212.14</string> </key> <key name="EUNCR-CZH-ACLFSW02 - 10.197.212.15"> <dword name="[SSH2] Port">22</dword> <string name="Hostname">10.197.212.15</string> </key> <key name="EUNCR-CZH-ACLFSW03 - 10.197.230.16"> <dword name="[SSH2] Port">22</dword> <string name="Hostname">10.197.212.16</string> </key> <key name="EUNCR-CZH-ACLFSW04 - 10.197.230.17"> <dword name="[SSH2] Port">22</dword> <string name="Hostname">10.197.212.17</string> </key> <key name="EUNCR-CZH-ACLFSW05 - 10.197.230.18"> <string name="Hostname">10.197.212.18</string> </key> <key name="EUNCR-CZH-ACLFSW06 - 10.197.230.19"> <dword name="[SSH2] Port">22</dword> <string name="Hostname">10.197.212.19</string> </key> </key> all: hosts: 10.197.212.13: 22 10.197.212.12: 22 10.197.212.10: 22 10.197.212.11: 22 10.197.212.44: 22 10.197.212.34: 22 10.197.212.35: 22 10.197.212.14: 22 10.197.212.15: 22 10.197.212.16: 22 10.197.212.17: 22 10.197.212.18: 22 10.197.212.19: 22 CzechRep: CORE: hosts: 10.197.212.13: 22 10.197.212.12: 22 10.197.212.10: 22 10.197.212.11: 22 OOB Stack: hosts: 10.197.212.44: 22 10.197.212.34: 22 10.197.212.35: 22 RACK XXX: hosts: 10.197.212.14: 22 10.197.212.15: 22 10.197.212.16: 22 10.197.212.17: 22 10.197.212.18: 22 10.197.212.19: 22 That said thanks again. I really hope to hear this feature is ready and perhaps has even more options in the near future. ![]() |
#6
|
|||
|
|||
Here is a python script I used to convert that xml file that exports from SecureCRT into Yaml. Some cleanup needs to be done to the output.
https://github.com/Murpup569/SecureCRT_to_Ansible |
![]() |
Tags |
ansible , automation , export |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|