what is the puppet agent status on the machine?

A one-liner to get the current status is: cat `puppet agent –configprint agent_disabled_lockfile` Generally, this must be run as root, so I use: sudo cat `sudo puppet agent –configprint agent_disabled_lockfile` There are a number of possible results. cat: \path\to\lock: No such file or directory Puppet is not disabled. Any other text means that puppet is … Read more

How to fetch a remote file (e.g. from Github) in a Puppet file resource?

Before Puppet 4.4, as per http://docs.puppetlabs.com/references/latest/type.html#file, the file source only accepts puppet:// or file:// URIs. As of Puppet 4.4+, your original code would be possible. If you’re using an older version, one way to achieve what you want to do without pulling down the entire Git repository would be to use the exec resource to … Read more

Vagrant provisioning shell vs puppet vs chef

The following article concerns yet another CM tool (ansible), but I think the author does an excellent job of explaining the benefits of transitioning away from shell scripts. http://devopsu.com/blog/ansible-vs-shell-scripts/ quote 1: What really surprised me was the response from some of these more famous devs. They basically said, “This is really cool, but I probably … Read more

Managing a user password for linux in puppet

Linux users have their passwords stored as hash in /etc/shadow file. Puppet passes the password supplied in the user type definition in the /etc/shadow file. Generate your hash password using openssl command: #openssl passwd -1 #Enter your password here Password: Verifying – Password: $1$HTQUGYUGYUGwsxQxCp3F/nGc4DCYM The previous example generate this hash: $1$HTQUGYUGYUGwsxQxCp3F/nGc4DCYM/ Add this hash password … Read more

Installing a puppet module from a manifest script

I ran into this problem as well. The trick is to download the modules using a vagrant shell command before the puppet provisioner runs. config.vm.provision :shell do |shell| shell.inline = “mkdir -p /etc/puppet/modules; puppet module install puppetlabs/nodejs; puppet module install puppetlabs/apache” end config.vm.provision :puppet do |puppet| puppet.manifests_path = “puppet/manifests” puppet.manifest_file = “site.pp” end Order is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)