Re: [Puppet Users] Puppet ignoring ENC classes

395 views
Skip to first unread message

R.I.Pienaar

unread,
Sep 14, 2012, 5:54:38 AM9/14/12
to puppet...@googlegroups.com


----- Original Message -----
> From: "Cosmin-Viorel Ilie" <ilie.cosm...@gmail.com>
> To: puppet...@googlegroups.com
> Sent: Friday, September 14, 2012 10:43:48 AM
> Subject: [Puppet Users] Puppet ignoring ENC classes
>
> Hi everyone,
>
> I've been bashing my head in the wall for several days now trying to
> find out why puppet isn't loading the class from enc. I've setup the
> enc from puppet-dashboard which returns:
>
> [root@v-test-mng-01 puppet-dashboard]# /usr/bin/env
> PUPPET_DASHBOARD_URL=http://v-test-mng-01:3000
> /usr/share/puppet-dashboard/bin/external_node
>
>
>
> ---
> - name: v-test-tst-01.domain.net
> parameters: {}
>
> classes:
> - test
> - name: v-test-mng-01.domain.net
> parameters: {}
>
> classes: []


When puppet calls your script it will pass in the node name information
as arguments to your script.

Your script must then return information for just the one node requested
so your result should be something like:

parameters: {}
classes:
- test

without node name etc

see http://docs.puppetlabs.com/guides/external_nodes.html

Cosmin-Viorel Ilie

unread,
Sep 14, 2012, 6:37:13 AM9/14/12
to puppet...@googlegroups.com
If i try to emulate what puppet is doing and call the script with the node name i get:

[root@v-test-mng-01 puppet-dashboard]# /usr/bin/env PUPPET_DASHBOARD_URL=http://v-test-mng-01:3000 /usr/share/puppet-dashboard/bin/external_node v-test-tst-01.domain.net
---
parameters: {}

classes:
- test



Cosmin-Viorel Ilie

unread,
Sep 17, 2012, 4:20:24 AM9/17/12
to puppet...@googlegroups.com
Any ideas on what is wrong with this setup and why the puppet master is not even executing the external_nodes or logging any errors ?

Cosmin-Viorel Ilie

unread,
Sep 17, 2012, 4:26:20 AM9/17/12
to puppet...@googlegroups.com
After some more trial and error i've managed to get this working if i disabled store configs, which is strange. Maybe i'm missing something but there is nothing in the documentation about not using store configs with ENC.


On Friday, September 14, 2012 12:43:48 PM UTC+3, Cosmin-Viorel Ilie wrote:
Hi everyone,

I've been bashing my head in the wall for several days now trying to find out why puppet isn't loading the class from enc. I've setup the enc from puppet-dashboard which returns:

[root@v-test-mng-01 puppet-dashboard]# /usr/bin/env PUPPET_DASHBOARD_URL=http://v-test-mng-01:3000 /usr/share/puppet-dashboard/bin/external_node
---
  parameters: {}

  classes:
  - test
  parameters: {}

  classes: []

however when i run  puppet agent --test --debug --no-daemonize -v on v-test-tst-01 the class is not loaded. If a look in the /var/lib/puppet/classes.txt on the agent i only see an entry for settings, but not the test class. Permissions to the /usr/share/puppet-dashboard/bin/external_node are [-rwxr-xr-x 1 puppet puppet 1453 Sep 12 04:43 /usr/share/puppet-dashboard/bin/external_node]. 

The test module is as fallows:

test/manifests/init.pp
               class test ($var='default') {
                        notify {$var:}
                 }

The puppet config file is :

[main]

    # The Puppet log directory.
    # The default value is '$vardir/log'.
    logdir = /var/log/puppet

    # Where Puppet PID files are kept.
    # The default value is '$vardir/run'.
    rundir = /var/run/puppet

    # Where SSL certificates are kept.
    # The default value is '$confdir/ssl'.
    ssldir = $vardir/ssl
    autosign=true
    environment = production

[agent]
    # The file in which puppetd stores a list of the classes
    # associated with the retrieved configuratiion.  Can be loaded in
    # the separate ``puppet`` executable using the ``--loadclasses``
    # option.
    # The default value is '$confdir/classes.txt'.
    classfile = $vardir/classes.txt

    # Where puppetd caches the local configuration.  An
    # extension indicating the cache format is added automatically.
    # The default value is '$confdir/localconfig'.
    localconfig = $vardir/localconfig
    report = true

[master]
    node_terminus = exec
    external_nodes = /usr/bin/env PUPPET_DASHBOARD_URL=http://v-test-mng-01:3000 /usr/share/puppet-dashboard/bin/external_node
    
    ssl_client_header = SSL_CLIENT_S_D
    ssl_client_verify_header = SSL_CLIENT_VERIFY
    storeconfigs = true
    dbadapter = mysql
    dbname = puppet
    dbuser = puppet
    dbpassword = xxxx
    dbserver = localhost
    dbsocket = /var/lib/mysql/mysql.sock
    reports = http,store,log

If i create the site.pp and add the node definition there everything works fine. 

The dashboard is on the same machine as the puppet master (v-test-mng-01 in my case).  If i run: puppet master --configprint external_nodes
/usr/bin/env PUPPET_DASHBOARD_URL=http://v-test-mng-01:3000 /usr/share/puppet-dashboard/bin/external_node

I'm using puppet 3.0 RC6 and dashboard 1.2.11 with Ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]


I'm running out of ideas on how to get this working so any idea or help would be appreciated.

The output from the agent run is attached.

Cosmin-Viorel Ilie

unread,
Sep 17, 2012, 6:40:26 AM9/17/12
to puppet...@googlegroups.com
So just in case you have the same problem:

 using : 
    storeconfigs = true
    dbadapter = mysql
    dbname = puppet
    dbuser = puppet
    dbpassword = xxxx
    dbserver = localhost

causes puppet master to ignore the ENC setting, however if i use:

    storeconfigs = true
    storeconfigs_backend = puppetdb
and use puppetdb for storeconf everything works fine. I haven tried with different adapters but for mysql adapter it doesn't work.  It might be an environment setting based on the version of gems i use ... not sure at this point.

Reply all
Reply to author
Forward
0 new messages