I'm trying to use puppet's network device management feature to configure Cisco routers.
I know its just running ios commands so how can I extend it by having it run my own ios commands? I want to use this to create my own facts and do other stuff.
On a windows endpoint I can use exec to run shell commands:
exec { 'test':
command => 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy remotesigned -file C:\test.ps1',
}
How can I do something like this with puppet device?
When I tried running an ios command it gave me an error:
exec { 'test':
command => 'show ip int bri'
}
Info: Caching catalog for 123.123.123.123
Error: Failed to apply catalog: Validation of Exec[test] failed: 'show ip int bri' is not qualified and no path was specified. Please qualify the command or specify a path. at /etc/puppet/environments/production/modules/ciscorouterconfig/manifests/init.pp:82
shell returned 1
I'm trying to use puppet's network device management feature to configure Cisco routers.
I know its just running ios commands so how can I extend it by having it run my own ios commands? I want to use this to create my own facts and do other stuff.
On a windows endpoint I can use exec to run shell commands:
exec { 'test': command => 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy remotesigned -file C:\test.ps1', }
How can I do something like this with puppet device?
When I tried running an ios command it gave me an error:
exec { 'test': command => 'show ip int bri' } Info: Caching catalog for 123.123.123.123 Error: Failed to apply catalog: Validation of Exec[test] failed: 'show ip int bri' is not qualified and no path was specified. Please qualify the command or specify a path. at /etc/puppet/environments/production/modules/ciscorouterconfig/manifests/init.pp:82 shell returned 1
exec { 'demo':
# for example only
command => '/usr/bin/show ip int bri'
}
Thanks for replying!I'm aware of how puppet device works and I know there is no actual agent software running on the Cisco device (I'm not talking about the newer OnePK thing).My question was how can I use this to send my own commands in a integrated way- meaning the same way Puppet Device does it.
"You could, however, use an Exec to open a telnet or ssh connection to the router with which to execute a remote command; that is akin to how the built-in device management types work"Opening my own instance of telent/ssh defeats the purpose- I want to do it "how the built-in device management" feature does it. Meaning I have already defined the IPs and authentication info for my routers in device.conf and I don't want to have to hard code that info into the module.
Puppet device already has that telnet/ssh connection info so how can I send the devices my own arbitrary commands from my module?
Is there a way I can refer to the telnet session/connection in my module and just enter my own commands?
Thanks for taking the time to answer my questions.It seems like Puppet isn't the right tool for what I want to accomplish or I will have to wait for native full featured Cisco support.I think my confusion came from the notion that extending puppet in this way was a simple end usery task.
I thought, for example, if I wanted to push out an EIGRP message digest configuration (currently puppet device can't do this out of the box) I could plug in my own code/ios commands somewhere and refer to it in my module the same way I do other "resources'" like this (sloppy pseudo code):keychain {name => chainNamekeynumber => 5key-string => zzzzzzzz}interface {'GigabitEthernet 0/1':description => $interface_description_laneigrp keychain {as => 123name => chainName}}
But, if I understand what you are saying, that would require a great deal of coding. Being that I am not a ruby dev this would probably be a waste of my time.