Puppet Package Configuration Examples


1) Install the xpad package

node “UT-9c8e99e3959e”{
package { “xpad”:
ensure => “installed”}
}

Example:

generic@UT-9c8e99e3959e:~$ dpkg-query -l xpad
dpkg-query: no packages found matching xpad

generic@UT-9c8e99e3959e:~$ sudo puppet agent –test
info: Caching catalog for ut-9c8e99e3959e
info: Applying configuration version ‘1361592519’
notice: /Stage[main]//Node[ut-9c8e99e3959e]/Package[xpad]/ensure: ensure changed ‘purged’ to ‘present’
notice: Finished catalog run in 18.87 seconds

generic@UT-9c8e99e3959e:~$ dpkg-query -l xpad
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  xpad           4.1-1ubuntu4 i386         sticky note application for X

2) Remove the xpad package (‘purged’ will remove both package and configurations, ’‘absent’ will keep the configuration file)

node “UT-9c8e99e3959e”{
package { “xpad”:
ensure => “purged” }
}

Example:

generic@UT-9c8e99e3959e:~$ sudo puppet agent –test
info: Caching catalog for ut-9c8e99e3959e
info: Applying configuration version ‘1361593685’
notice: /Stage[main]//Node[ut-9c8e99e3959e]/Package[xpad]/ensure: ensure changed ‘4.1-1ubuntu4’ to ‘purged’
notice: Finished catalog run in 9.22 seconds

generic@UT-9c8e99e3959e:~$ dpkg-query -l xpad
dpkg-query: no packages found matching xpad

3) Update the xpad to the lastest version

node “UT-9c8e99e3959e”{
package { “xpad”:
ensure => “latest” }
}

Example:

generic@UT-9c8e99e3959e:~$ sudo puppet agent –test
info: Caching catalog for ut-9c8e99e3959e
info: Applying configuration version ‘1361595049’
notice: /Stage[main]//Node[ut-9c8e99e3959e]/Package[xpad]/ensure: ensure changed ‘purged’ to ‘latest’
notice: Finished catalog run in 9.18 seconds

generic@UT-9c8e99e3959e:~$ dpkg-query -l xpad
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  xpad           4.1-1ubuntu4 i386         sticky note application for X

4) Choose a different package provider

node “UT-9c8e99e3959e”{
package { “xpad”:
ensure => “latest”,
provider => “yum” }
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s