Skip to content

Instantly share code, notes, and snippets.

@jeff1evesque
Created March 25, 2016 12:58
Show Gist options
  • Save jeff1evesque/675b0d80845741a7d4b6 to your computer and use it in GitHub Desktop.
Save jeff1evesque/675b0d80845741a7d4b6 to your computer and use it in GitHub Desktop.
Test logic in puppet
# install module into my home dir
% puppet module install puppetlabs/inifile
Notice: Preparing to install into /home/rip/.puppetlabs/etc/code/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/home/rip/.puppetlabs/etc/code/modules
└── puppetlabs-inifile (v1.5.0)
# grab a throw away php.ini
% cp /etc/php.ini ~
# test.pp
ini_setting { "sample setting":
ensure => present,
path => '/home/rip/php.ini',
section => 'PHP',
setting => 'memory_limit',
value => '512M',
}
# run the code
% puppet apply test.pp
Notice: Compiled catalog for dev2.devco.net in environment production in 0.06 seconds
Notice: /Stage[main]/Main/Ini_setting[sample setting]/value: value changed '[redacted sensitive information]' to '[redacted sensitive information]'
Notice: Applied catalog in 0.05 seconds
# check outcome
% grep ^memory php.ini
memory_limit = 512M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment