Hello, Alright, my puppetmaster configuration works without external nodes, but I really need my external node script to work.
In my /etc/puppet/puppet.conf I have the following: [main] ... node_terminus = exec external_nodes = /etc/puppet/tools/external_nodes.py When running puppetmaster, I get: [r...@vpsadmins ~]# puppetmasterd --no-daemonize --verbose --debug [--snip--] info: Listening on port 8140 notice: Starting Puppet server version 0.24.8 debug: Overriding dc2-vps1-400.example.com with cert name dc2- vps1-400b.example.com info: access[fileserver]: allowing *.example.com access info: access[puppetmaster]: allowing *.example.com access info: access[resource]: allowing vpsadmins.example.com access info: access[puppetbucket]: allowing *.example.com access info: access [puppetreports]: allowing *.example.com access debug: Allowing authenticated client dc2-vps1-400b.example.com (67.227.199.245) access to puppet master.getconfig debug: Our client is remote debug: Executing '/etc/puppet/tools/external_nodes.py dc2- vps1-400b.example.com' err: Could not call: Could not find node 'dc2-vps1-400b.example.com'; cannot compile notice: Caught INT; shutting down debug: Signal caught here: debug: /usr/lib/ruby/site_ruby/1.8/puppet/external/event-loop/event- loop.rb:127:in `call' debug: /usr/lib/ruby/site_ruby/1.8/puppet/external/event-loop/event- loop.rb:127:in `select' debug: /usr/lib/ruby/site_ruby/1.8/puppet/external/event-loop/event- loop.rb:127:in `select' debug: /usr/lib/ruby/site_ruby/1.8/puppet/external/event-loop/event- loop.rb:116:in `iterate' debug: /usr/lib/ruby/site_ruby/1.8/puppet/external/event-loop/event- loop.rb:107:in `run' debug: /usr/lib/ruby/site_ruby/1.8/puppet.rb:320:in `start' debug: /usr/sbin/puppetmasterd:285 notice: Shutting down When I run the script directly: [r...@vpsadmins ~]# python /etc/puppet/tools/external_nodes.py dc2- vps1-400b.example.com --- classes: - custom - monitoring::base - ntpd - puppetd - rpms - sshd - yum - crontab - iptables - ldap::client - monitoring::vps - sudo - virtuozzo - vpsscripts Here's the script I am running: #!/usr/local/bin/python # # external_nodes.py # Take a YAML file containing node types, regular expressions to match # a hostname, and which modules are get loaded for each node type. # Print to stdout the list of classes (in YAML) associated with the node # type. This script is currently not very pythonic. # # TODO: actual error checking, particularly for file handling ### Imports import sys import re import time import yaml ### Constants # puppet user must have read acces to this NODEFILE = '/etc/puppet/nodes.yaml' # puppet user must have write access to this LOGFILE = '/var/log/puppet/nodes.log' ### Arguments hostname = sys.argv[1] ### Functions # Open NODESFILE and load the two documents into structures, return as tuple def parse_nodefile(): f = file(NODEFILE, 'r') docs = yaml.load_all(f.read()) f.close() return (docs.next(), docs.next()) # Write a msg to LOGFILE def log(msg): f = file(LOGFILE, 'a') timestamp = time.strftime('%Y%m%d-%H:%M') f.write(timestamp + ' - ' + msg + '\n') f.close() ### Action! (regexes, modules) = parse_nodefile() for nodetype, regexlist in regexes.iteritems(): for regex in regexlist: p = re.compile(regex) m = p.match(hostname) if m: found_nodetype = nodetype modulelist = modules['default'] try: if found_nodetype and modules[found_nodetype] is not None: modulelist.extend(modules[found_nodetype]) except NameError: log(hostname + ' doesn\'t match a defined node type') sys.exit(1) yamldoc = {'classes': modulelist} print yaml.dump(yamldoc, explicit_start=True, default_flow_style=False) # Puppet expects a return code of 0 to signal to indicate success # and non-zero for error or a non-regcognized hostname sys.exit(0) This particular server is covered by this in my nodes.yaml: - ^dc2-vps[12]-[2-9][0-9][0-9]b\.example\.com$ According to the wiki all I need to do is return YAML with an exit code of 0, which this script does. Anyone have any ideas as to why I am getting this error? I appreciate any help, Curt Micol --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---