Discussion:
[Puppet Users] Problem starting with cisco_ios
Ángel L. Mateo
2018-11-30 13:29:05 UTC
Permalink
I'm beginning with puppetlabs/cisco_ios module. For the moment, just a
proof of concept.

These are the modules I have installed:

/etc/puppetlabs/code/environments/ciscotest/modules
├── puppetlabs-cisco_ios (v0.6.1)
├── puppetlabs-concat (v5.1.0)
├── puppetlabs-device_manager (v2.7.0)
├── puppetlabs-hocon (v1.0.1)
├── puppetlabs-netdev_stdlib (v0.17.0)
├── puppetlabs-puppetserver_gem (v1.0.0)
├── puppetlabs-resource_api (v1.0.0)
└── puppetlabs-stdlib (v5.1.0)

In _manifests/site.pp_ I have:
node default {
device_manager {'switch_cisco_pruebas':
type => 'cisco_ios',
credentials => {
address => '1.2.3.4',
port => '22',
username => 'test',
password => 'password',
enable_password => 'enablepassword',
},
}
}

The problem I have is that running puppet agent gives no error, but the
device command doesn't work. I have the error:

***@leo10:/etc/puppetlabs/code/environments/ciscotest# puppet device
--verbose --target switch_cisco_pruebas --apply ~/manifest.pp --noop
Error: Could not autoload puppet/provider/ntp_server/cisco_ios:
superclass mismatch for class Device
Error: Could not autoload puppet/type/ntp_server: Could not autoload
puppet/provider/ntp_server/cisco_ios: superclass mismatch for class Device
Error: Evaluation Error: Error while evaluating a Resource Statement,
Could not autoload puppet/type/ntp_server: Could not autoload
puppet/provider/ntp_server/cisco_ios: superclass mismatch for class
Device (file: /home/amateo_adm/manifest.pp, line: 1, column: 1) on node
switch_cisco_pruebas

Could anybody help me?
--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868889150
Fax: 868888337
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/47d7e959-8859-5459-c885-a15bb89fbd1b%40um.es.
For more options, visit https://groups.google.com/d/optout.
Ángel L. Mateo
2018-11-30 13:37:11 UTC
Permalink
Post by Ángel L. Mateo
node default {
    type => 'cisco_ios',
    credentials => {
      address => '1.2.3.4',
      port => '22',
      username => 'test',
      password => 'password',
      enable_password => 'enablepassword',
    },
  }
}
Errata. This is my manifest:

node default {
include cisco_ios::proxy

device_manager {'switch_cisco_pruebas':
type => 'cisco_ios',
credentials => {
address => '1.2.3.4',
port => '22',
username => 'test',
password => 'password',
enable_password => 'enablepassword',
},
}
}
--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868889150
Fax: 868888337
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/7abe1850-1060-de0a-16ca-12f65eded1f8%40um.es.
For more options, visit https://groups.google.com/d/optout.
Will Meek
2018-11-30 14:16:03 UTC
Permalink
Hi Angel,

I'm having a look at this now.

The manifest you supplied looks to be device_manager setup, which is
executed either by an agent (if set in an environment) or 'puppet apply'
rather than 'puppet device'.

This sets up the device.conf ready for puppet device.

Can you tell me if you get any output for a 'resource' command eg.

# puppet device --verbose --target switch_cisco_pruebas --resource banner

Info: retrieving resource: banner from switch_cisco_pruebas at
file:///etc/puppetlabs/puppet/devices/switch_cisco_pruebas.conf

banner { 'default':

motd => 'Compliance banner',

}

Also - could you verify that the resource_api gem is installed?

eg.

# gem list | grep resource_api

puppet-resource_api (1.6.2)

Thanks
Will
Post by Ángel L. Mateo
I'm beginning with puppetlabs/cisco_ios module. For the moment, just a
proof of concept.
/etc/puppetlabs/code/environments/ciscotest/modules
├── puppetlabs-cisco_ios (v0.6.1)
├── puppetlabs-concat (v5.1.0)
├── puppetlabs-device_manager (v2.7.0)
├── puppetlabs-hocon (v1.0.1)
├── puppetlabs-netdev_stdlib (v0.17.0)
├── puppetlabs-puppetserver_gem (v1.0.0)
├── puppetlabs-resource_api (v1.0.0)
└── puppetlabs-stdlib (v5.1.0)
node default {
type => 'cisco_ios',
credentials => {
address => '1.2.3.4',
port => '22',
username => 'test',
password => 'password',
enable_password => 'enablepassword',
},
}
}
The problem I have is that running puppet agent gives no error, but the
--verbose --target switch_cisco_pruebas --apply ~/manifest.pp --noop
superclass mismatch for class Device
Error: Could not autoload puppet/type/ntp_server: Could not autoload
puppet/provider/ntp_server/cisco_ios: superclass mismatch for class Device
Error: Evaluation Error: Error while evaluating a Resource Statement,
Could not autoload puppet/type/ntp_server: Could not autoload
puppet/provider/ntp_server/cisco_ios: superclass mismatch for class
Device (file: /home/amateo_adm/manifest.pp, line: 1, column: 1) on node
switch_cisco_pruebas
Could anybody help me?
--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868889150
Fax: 868888337
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/0fb86c93-eb54-41b5-94eb-df637ff663d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ángel L. Mateo
2018-12-05 07:33:21 UTC
Permalink
Post by Will Meek
Hi Angel,
I'm having a look at this now.
The manifest you supplied looks to be device_manager setup, which is
executed either by an agent (if set in an environment) or 'puppet apply'
rather than 'puppet device'.
This sets up the device.conf ready for puppet device.
You're right. That's the code I use to configure the device manager
(the proxy agent). I forgot to paste the code for the device. It's this:

# ~/manifest.pp
ntp_server { '1.2.3.5':
ensure => 'present',
key => 94,
prefer => true,
minpoll => 4,
maxpoll => 14,
}

I had to manually add modulepath to my apply commands:

***@leo10:/etc/puppetlabs/code/environments# puppet device --verbose
--target switch_cisco_pruebas --apply ~/manifest.pp --noop --modulepath
/etc/puppetlabs/code/environments/ciscotest/modules
Notice: Compiled catalog for switch_cisco_pruebas in environment
production in 0.07 seconds
Info: Applying configuration version '1543995151'
Notice: /Stage[main]/Main/Ntp_server[1.2.3.5]/ensure: current_value
'absent', should be 'present' (noop)
Info: Class[Main]: Unscheduling all events on Class[Main]
Info: Creating state file
/opt/puppetlabs/puppet/cache/devices/switch_cisco_pruebas/state/state.yaml
Notice: Applied catalog in 1.19 seconds
Post by Will Meek
Can you tell me if you get any output for a 'resource' command eg.
# puppet device --verbose --target switch_cisco_pruebas --resource banner
Info: retrieving resource: banner from switch_cisco_pruebas at
file:///etc/puppetlabs/puppet/devices/switch_cisco_pruebas.conf
motd => 'Compliance banner',
}
***@leo10:~$ sudo puppet device --verbose --target
switch_cisco_pruebas --resource banner
Info: retrieving resource: banner from switch_cisco_pruebas at
file:///etc/puppetlabs/puppet/devices/switch_cisco_pruebas.conf
banner { 'default':

I'm getting the configured banner:

motd =>
"\n+--------------------------------------------------------------+\n|
|\n| ATICA
UNIVERSIDAD DE MURCIA CATALYST 3650-12X|\n|
http://www.um.es PILOTO HIPERCONV|\n|
|\n|
------------------------------ |\n|
|\n| ATENCION: Esta intentando
conectar con un conmutador privado |\
...
Post by Will Meek
Also - could you verify that the resource_api gem is installed?
eg.
# gem list | grep resource_api
puppet-resource_api(1.6.2)
It's installed in the puppet's ruby environment, but not in _standard's_:

***@leo10:~$ gem list | grep resource_api

***@leo10:~$ sudo /opt/puppetlabs/puppet/bin/gem list | grep
resource_api
puppet-resource_api (1.6.2, 1.6.1, 1.6.0)
--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868889150
Fax: 868888337
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d6eeff7b-dadc-c86c-1cd4-36f59f5fb2e7%40um.es.
For more options, visit https://groups.google.com/d/optout.
Ángel L. Mateo
2018-12-05 08:15:54 UTC
Permalink
I don't know what have I touch (if it's really my fault), but it's not
working again.

This is the manifest to configure the proxy agent:

node default {

include cisco_ios::proxy

device_manager {'switch_cisco_pruebas':
type => 'cisco_ios',
credentials => {
address => '10.54.1.111',
port => '22',
username => 'test',
password => 'test123',
enable_password => '123test',
},
}

}

With banner resource it works:

***@leo10:~$ sudo puppet device --verbose --target
switch_cisco_pruebas --resource banner --modulepath
/etc/puppetlabs/code/environments/ciscotest/modules
Info: retrieving resource: banner from switch_cisco_pruebas at
file:///etc/puppetlabs/puppet/devices/switch_cisco_pruebas.conf
banner { 'default':
motd => 'Test banner',
}

and I can configure it with this manifest:
banner {'default':
motd => 'Test banner',
}

and sudo puppet device --verbose --target switch_cisco_pruebas
--modulepath /etc/puppetlabs/code/environments/ciscotest/modules --apply
~/manifest.pp

but it didn't work with ntp_server resource:

***@leo10:~$ sudo puppet device --verbose --target
switch_cisco_pruebas --modulepath
/etc/puppetlabs/code/environments/ciscotest/modules --resource ntp_server
Error: Could not autoload puppet/provider/ntp_server/ios: superclass
mismatch for class NtpServer
Error: Could not autoload puppet/type/ntp_server: Could not autoload
puppet/provider/ntp_server/ios: superclass mismatch for class NtpServer
Error: Could not autoload puppet/type/ntp_server: Could not autoload
puppet/provider/ntp_server/ios: superclass mismatch for class NtpServer
Post by Will Meek
Hi Angel,
I'm having a look at this now.
The manifest you supplied looks to be device_manager setup, which is
executed either by an agent (if set in an environment) or 'puppet
apply' rather than 'puppet device'.
This sets up the device.conf ready for puppet device.
    You're right. That's the code I use to configure the device manager
# ~/manifest.pp
      ensure => 'present',
      key => 94,
      prefer => true,
      minpoll => 4,
      maxpoll => 14,
}
--target switch_cisco_pruebas --apply ~/manifest.pp --noop --modulepath
/etc/puppetlabs/code/environments/ciscotest/modules
Notice: Compiled catalog for switch_cisco_pruebas in environment
production in 0.07 seconds
Info: Applying configuration version '1543995151'
Notice: /Stage[main]/Main/Ntp_server[1.2.3.5]/ensure: current_value
'absent', should be 'present' (noop)
Info: Class[Main]: Unscheduling all events on Class[Main]
Info: Creating state file
/opt/puppetlabs/puppet/cache/devices/switch_cisco_pruebas/state/state.yaml
Notice: Applied catalog in 1.19 seconds
Post by Will Meek
Can you tell me if you get any output for a 'resource' command eg.
# puppet device --verbose --target switch_cisco_pruebas --resource banner
Info: retrieving resource: banner from switch_cisco_pruebas at
file:///etc/puppetlabs/puppet/devices/switch_cisco_pruebas.conf
motd => 'Compliance banner',
}
switch_cisco_pruebas --resource banner
Info: retrieving resource: banner from switch_cisco_pruebas at
file:///etc/puppetlabs/puppet/devices/switch_cisco_pruebas.conf
  motd =>
"\n+--------------------------------------------------------------+\n|
                                                           |\n|   ATICA
          UNIVERSIDAD DE MURCIA     CATALYST 3650-12X|\n|
http://www.um.es         PILOTO HIPERCONV|\n|
                                         |\n|
------------------------------                 |\n|
                                        |\n| ATENCION: Esta intentando
conectar con un conmutador privado |\
...
Post by Will Meek
Also - could you verify that the resource_api gem is installed?
eg.
# gem list | grep resource_api
puppet-resource_api(1.6.2)
    It's installed in the puppet's ruby environment, but not in
resource_api
puppet-resource_api (1.6.2, 1.6.1, 1.6.0)
--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868889150
Fax: 868888337
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20049ea1-83c1-f809-b0b3-031efcd1af07%40um.es.
For more options, visit https://groups.google.com/d/optout.
Loading...