This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| wiki:qclug_presentations:puppet [2015/11/11 21:54] Root | wiki:qclug_presentations:puppet [2015/11/11 22:07] (current) Root [Setup R10K] | ||
|---|---|---|---|
| Line 12: | Line 12: | ||
| ===== Prerequisites ===== | ===== Prerequisites ===== | ||
| - | - Master/Agent requires at least 2 servers, masterless requires only 1. | + | - Master/Agent requires at least two servers, masterless requires only one | 
| - | - Master/Agent should have DNS configured, but IP addresses could work as well. | + | - Master/Agent require DNS to be configured for SSL certificate signing purposes | 
| ===== Installing Open Source Puppet ===== | ===== Installing Open Source Puppet ===== | ||
| Line 64: | Line 64: | ||
| [master] | [master] | ||
| always_cache_features = true | always_cache_features = true | ||
| - | environment_timeout=unlimited | + | environment_timeout = unlimited | 
| - | environmentpath=$confdir/environments | + | environmentpath = $confdir/environments | 
| basemodulepath = /etc/puppet/modules | basemodulepath = /etc/puppet/modules | ||
| ca = true | ca = true | ||
| Line 73: | Line 73: | ||
| <code> | <code> | ||
| [main] | [main] | ||
| - | #templatedir=$confdir/templates | + | #templatedir = $confdir/templates | 
| </code> | </code> | ||
| Line 123: | Line 123: | ||
| </code> | </code> | ||
| - | Edit the server.pp file and have it include the profiles::home::apache module which will be created later and will use the Puppetlabs apache module to install and configure apache: | + | Edit the server.pp file and have it include the profiles::home::mysql module which will be created later and will use the Puppetlabs mysql module to install and configure mysql: | 
| <code> | <code> | ||
| Line 131: | Line 131: | ||
| <code> | <code> | ||
| class roles::home::server { | class roles::home::server { | ||
| - | include profiles::home::apache | + | include profiles::home::mysql | 
| } | } | ||
| </code> | </code> | ||
| Line 152: | Line 152: | ||
| </code> | </code> | ||
| - | Edit the apache.pp file and have it call the apache class: | + | Edit the mysql.pp file and have it call the mysql::server class: | 
| <code> | <code> | ||
| - | vi /etc/puppet/environments/production/modules/profiles/manifests/home/apache.pp | + | vi /etc/puppet/environments/production/modules/profiles/manifests/home/mysql.pp | 
| </code> | </code> | ||
| <code> | <code> | ||
| - | class profiles::home::apache { | + | class profiles::home::mysql { | 
| - | class { '::apache':  } | + | class { '::mysql::server': | 
| + | root_password  => 'strongpassword', | ||
| + | remove_default_accounts => true, | ||
| + | } | ||
| } | } | ||
| </code> | </code> | ||
| - | //Note: Ensure the class is prefixed with the double colons or else the profile will try to load itself instead of the actual apache module!// | + | //Note: Ensure the class is prefixed with the double colons or else the profile will try to load itself instead of the actual mysql module!// | 
| ==== Install the puppetlabs-mysql module ==== | ==== Install the puppetlabs-mysql module ==== | ||
| Line 212: | Line 215: | ||
| puppet agent -t | puppet agent -t | ||
| </code> | </code> | ||
| - | ===== Setup R10K ===== | + | |
| + | Enable the agent service to have Puppet run automatically every 30 minutes by default: | ||
| + | <code> | ||
| + | update-rc.d puppet enable | ||
| + | </code> | ||
| ===== Additional Resources ===== | ===== Additional Resources ===== | ||