Sometimes we would only want to execute some initialization configurations on Puppet agent only on the first of manifest application. One approach is to create a text file and only skip the execution when that file exists.
When a new rpm is added to a yum repository server, the cache in the client machine makes the new rpm unreachable. To check for update of repositories, run the following command in the client.
In Puppet, there are a bunch of core facts which are are available for developer to get the Puppet Agent information such as the IP address of a specific network interface card and the free memory. The following piece of code snippet is a very good example on using facts in the manifest.
file {'puppet_facts_example':
ensure => file,
path => '/tmp/puppet_facts_example.txt',
mode => 0644,
content => "This Learning Puppet VM's IP address is ${ipaddress}. It thinks its
hostname is ${fqdn}, but you might not be able to reach it there
from your host machine. It is running ${operatingsystem} ${operatingsystemrelease} and
Puppet ${puppetversion}.
Web console login:
URL: https://${ipaddress_eth0}
User: puppet@example.com
Password: learningpuppet",
}
You can find the list of Puppet core facts in the reference link below.
We want to be free from a dictatorship. We want to be free from the politicians who work only for themselves, who are ready to shoot, to beat, to injure people, just for saving their money, just for saving their houses, just to saving their power.
We are civilized people, but our government are barbarians. That’s not a soviet union. We want our courts not to be corrupted. We want to be free.
A Ukrainian
Full script:
I am a Ukrainian, the native of Kiev. And now I am on Maidan, on the central part of my city. I want you to know why thousands of people all over my country are on the streets. There is only one reason: We want to be free from a dictatorship. We want to be free from the politicians who work only for themselves, who are ready to shoot, to beat, to injure people, just for saving their money, just for saving their houses, just to saving their power.
I want these people who are here, who have dignity, who are brave, I want them to lead a normal life. We are civilized people, but our government are barbarians. That’s not a soviet union. We want our courts not to be corrupted. We want to be free.
I know that maybe tomorrow we’ll have no phone, no internet connection, and we will be alone here. And maybe police men will murder us, one after another, when it will be dark here.
That’s why I ask you now to help us. We have this freedom inside our hearts. We have this freedom in our minds. And now I ask you to build this freedom in our country.
You can help us only by telling this story to your friends, only by sharing this video. Please share, share it. Speak to your friends, speak to your family, speak to your government, and show that you support us.
I want to automate the newrelic-sysmond installation using Puppet and it requires to set the license key in the nrsysmond.cfg and start the agent. And all this steps should happen once only and this can be achieved by creating a text file and only execute if the file does not exist.