I've noted that a simplistic puppet task (an empty file), is failing:
puppet apply init.pp
Results in
Error: Could not run: Could not retrieve facts for xxxxx: no implicit conversion of nil into String
I've changed the init.pp file to an empty file, and the error persists.
Are there any special requirements that puppet 3.4 requires for running puppet standalone deployments?
One simple fix (in the comment above) : Uninstalling puppet modules. But I suspect that there is a "proper" fix to this... so this question is still open.
Related
sudo puppet master --verbose --no-daemonize
When I ran above command
[root#puppetmaster bin]# sudo puppet master --verbose --no-daemonize
/usr/lib/ruby/site_ruby/1.8/puppet/settings.rb:1348:in convert': Error converting value for param 'basemodulepath': Could not find value for $configdir (Puppet::Settings::InterpolationError)
from /usr/lib/ruby/site_ruby/1.8/puppet/settings.rb:1337:ingsub'
from /usr/lib/ruby/site_ruby/1.8/puppet/settings.rb:1337:in convert'
from /usr/lib/ruby/site_ruby/1.8/puppet/settings.rb:1315:ininterpolate'
from /usr/lib/ruby/site_ruby/1.8/puppet/settings.rb:1060:in value'
from /usr/lib/ruby/site_ruby/1.8/puppet/settings.rb:121:in[]'
from /usr/lib/ruby/site_ruby/1.8/puppet.rb:184:in base_context'
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:356:inrun'
from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:146:in run'
from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:92:inexecute'
from /usr/bin/puppet:8
Even I created a environment variable now with $configdir with value /etc/puppet, but still same issue.
Please suggest how to rectify this
Puppet does not ordinarily provide or rely on any "configdir" setting, but it does provide and rely on confdir. Since Puppet is complaining about being able to determine the value of a different parameter, basemodulepath, I infer that,
You are using Puppet 3.8 with directory environments enabled (Ruby 1.8 is not supported in later versions, and basemodulepath is a directory environments thing), and
One of your environment.conf files erroneously specifies a value for its environment's basemodulepath in terms of $configdir instead of $confdir.
Note that Puppet 3.8 is obsolete and unsupported. As I write this, the latest is Puppet 6.12.
For testing, I have installed two instances of Ubuntu server 18.04 on VirtualBox. I then installed one with Puppet-server 6.1.0 and one with Puppet-agent 6.1.0, as per the documentation at Puppetlabs for version 6.1. Foreman is not installed.
After registering my agent at the puppetserver and signing the certificate, starting a puppet-run (sudo /opt/puppetlabs/bin/puppet agent --test) fails with the following error:
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Failed when searching for node puppetagent.fritz.box: Exception while executing '/etc/puppetlabs/puppet/node.rb': Cannot run program "/etc/puppetlabs/puppet/node.rb" (in directory "."): error=2, No such file or directory
I was dumbstruck to find that the script /etc/puppetlabs/puppet/node.rb was indeed missing and was also not included in the packages of puppetserver, puppet-agent or facter (sudo dpkg-query -L ...).
Googling for it, I only found a script of the same name that belonged to Foreman.
The file does also not seem to be present in the puppetserver source-code at github.
Is anyone able to shed some light on this?
Your server configuration seems to be set up to specify use of an external node classifier. This is optional: Puppet does not require an ENC and does not provide one by default. That's part of what makes them "external". If you obtained the result you describe straight out of the box then it probably reflects a packaging flaw that you should report.
In the meantime, you should be able to update the configuration to disable use of an ENC by changing the value of the node_terminus setting to plain. Alternatively, you should be able to just delete both node_terminus and external_nodes from your configuration, because the default for the former is plain.
Tagging on to John's answer, your configuration is probably configured to talk to the Foreman. If you didn't write it yourself or copy it from somewhere and you're sure you don't have any Foreman packages installed, then it's definitely a packaging error that you should report.
That said, puppet repos are almost always the right answer rather than distro packages.
I have Solaris 10 operating system with puppet agent installed on it.
When I run puppet agent -t I get an Error:
Error: /Stage[main]//Package[vim-enhanced]/ensure: change from absent to latest failed: Could not update: Sun packages must specify a package source
I have no classes regarding updates of vim-enhanced on the master, so where is the error coming from ?
If I do have some classes that I'm not aware of, how do I specify a package source ?
You don't need to any classes, puppet "package" reference solving your problem.
Use this resource:
package {
'vim-enhanced':
ensure => present,
provider => rpm,
source => "puppet:///files/vim-enchanced.rpm";
}
But, only working if you are using puppet default file server!
I have installed the Syntastic vim plugin using Pathogen and am attempting to have my puppet files validated using puppet and puppet link checker.
I can see errors and warning from puppet-lint, but in addition to that I would expect the puppet validation to run to highligh syntax errors. Would you know what might cause only puppet-lint to run?
FYI, I am trying to get this to work in gVim
I have a similar setup and the puppet-lint checker as well as the puppet run fine for me.
Issuing the :SyntasticInfo command for a .pp file gives me the following:
I am pretty sure that this just might be a case of the puppet executable not being on the path, and hence not available for the validation.
I am new to Puppet - I have been playing around learning the basics. Most of the examples ( except the very basic ones ) that are on the puppet page do not work for me - either some dependency is missing or package is not found. I do not see the logs explaining what went wrong ( even if I run the --test or --verbose option)
Can anyone clarify
1 What is the simplest process ( set of simple steps ) for installing a rpm package on a single Linux box ?
2 In general - how does one go about using the modules on the forge.puppetlabs ? Are the providers for these packages installed automatically or they have to be manually installed first ?
To install a package named pacman from command line:
puppet resource package pacman ensure=present
Corresponding puppet code will look like:
package { 'pacman':
ensure => '4.0.3-5',
}
Explore for more options about the package resource here
Regarding the question of installing puppet modules, have a look here. Official doc is your friend :)
Personally, I just copy-paste the module directory manually in a git repo which I use to maintain my puppet code.