Puppet on Windows: set Administrator password to never expires

When maintaining windows server with puppet, it could be interesting to set your Administrator password to never expires.
Since you want to manage your passwords through puppet, and not manually by some hyper active sysadmin, this comes in handy.

Note the fact that it is wise to change passwords now and then šŸ˜‰

On Windows you can only manage passwords through puppet… not any other expire settings.
You can read here that puppet on Windows does not support manages_password_age.

Therefor, after searching and testing a lot, I came with this class:

You’d think that instead of using WMIC USERACCOUNT, you can use a simple ‘net user administrator /expires:never, but that does not seem to be the case. Although your puppet agent reports that the setting has been modified, it did not… I only got it working with the WMIC command.

Also, when using | in the unless, you need to put the cmd.exe /c in your command. This is intended behaviour because of this:

Exec: Execute external binaries on Windows systems. As with the posix provider, this provider directly calls the command with the arguments given, without passing it through a shell or performing any interpolation. To use shell built-ins ā€“ that is, to emulate the shell provider on Windows ā€” a command must explicitly invoke the shell

Installing Puppet Agent

Installing Puppet agent on Ubuntu 12.04 (Precise)

To installĀ puppetĀ on a Cloudstar (Linux) Server, the following steps need to be performed:

We start with installing all available OS patches

Reboot if necessary
Change your server’s hostname to something that makes sense

Make it easy on yourself and add theĀ puppetĀ server to your /etc/hosts files. Modify your puppet.conf via a module if you like

InstallĀ Puppet

RunĀ puppetĀ for the 1st time to test it

You might still need to sign your newly created certificate on your Puppet Server

When completed, start theĀ puppetĀ agent

Installing Puppet agent on Ubuntu 10.04 (Lucid)

Ubuntu 10.04 has an old Puppet version in its package repo…. therefor, it’s better to download the latest version from Puppetlabs and install it that way.

You can use this on Precise too of course!

Execute the same stuff on your server as above, but don’t apt-get install puppet…

Instead: (underneath link was the latest stable version available at the time of writing this article

Unpack and install

Test your installation:

You might encounter a message stating that you also need facter installed.

If you don’t have it, you can manually install Facter by: (you need facter v1.5 or above)


Installing Puppet agent on RHEL 5

Install theĀ PuppetLabs Repository first:

InstallĀ puppet

Installing Puppet agent on RHEL 6

Add Optional (needed) Repo’s in your RHEL Subscription online

RHEL Server Optional (v. 6 64-bit x86_64)

in the subscription management page.

Then install theĀ PuppetLabs Repository:

InstallĀ puppet intself

Then we add theĀ puppetĀ server to the /etc/hosts files

RunĀ puppetĀ for the 1st time

When completed, start theĀ puppetĀ agent