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 print something when running Puppet client?

Here is the puppet script with all the available puppet log functions. log_levels.pp node default { notice(“try to run this script with -v and -d to see difference between log levels”) notice(“function documentation is available here: http://docs.puppetlabs.com/references/latest/function.html”) notice(“————————————————————————–“) debug(“this is debug. visible only with -d or –debug”) info(“this is info. visible only with -v or … Read more

Run `apt-get update` before installing other packages with Puppet

Since Puppet 2.6.0 a new feature “relationship syntax” was introduced. An example in Puppet 2.6.0 and above would look like this: exec { “apt-update”: command => “/usr/bin/apt-get update” } Exec[“apt-update”] -> Package <| |> Every time a package command is executed, the dependency (in our case ‘apt-update’) will be triggered fist. You can even define … Read more

How do you add items to .dockerignore?

The .dockerignore file is similar to the .gitignore syntax. Here are some example rules: # Ignore a file or directory in the context root named “modules” modules # Ignore any files or directories within the subdirectory named “modules” # in the context root modules/* # Ignore any files or directories in the context root beginning … Read more

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