User Tools

Site Tools


wiki:qclug_presentations:puppet

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
wiki:qclug_presentations:puppet [2015/11/11 21:52]
Root [Configuring the Puppet Master]
wiki:qclug_presentations:puppet [2015/11/11 22:07]
Root [Configuring a Puppet Agent]
Line 7: Line 7:
 Step 1: Add the Puppet Repository\\ Step 1: Add the Puppet Repository\\
 Step 2: Install Puppet\\ Step 2: Install Puppet\\
-Step 3: Install R10K\\ +Step 3: Configure the Puppet Master\\ 
-Step 4: Install Hiera\\ +Step 4: Configure a Puppet agent\\ 
-Step 5: Install and Configure a Puppet agent\\ +Step 5: Apply Puppet Code
-Step 6: Apply Puppet Code+
  
 ===== Prerequisites ===== ===== Prerequisites =====
-  - Master/​Agent requires at least 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 65: 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 74: Line 73:
 <​code>​ <​code>​
 [main] [main]
-#​templatedir=$confdir/​templates+#​templatedir = $confdir/​templates
 </​code>​ </​code>​
  
Line 104: Line 103:
 node '​pupagent.pcdomain.pvt'​ { node '​pupagent.pcdomain.pvt'​ {
   include roles::​home::​server   include roles::​home::​server
-} 
-node '​laptop.pcdomain.pvt'​ { 
-  include roles::​home::​laptop 
 } }
 </​code>​ </​code>​
Line 127: 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 135: Line 131:
 <​code>​ <​code>​
 class roles::​home::​server { class roles::​home::​server {
-  include profiles::​home::​apache+  include profiles::​home::​mysql
 } }
 </​code>​ </​code>​
Line 156: 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 215: Line 214:
 <​code>​ <​code>​
 puppet agent -t puppet agent -t
 +</​code>​
 +
 +Enable the agent service to have Puppet run automatically every 30 minutes by default:
 +<​code>​
 +update-rc.d puppet enable
 </​code>​ </​code>​
 ===== Setup R10K ===== ===== Setup R10K =====
wiki/qclug_presentations/puppet.txt · Last modified: 2015/11/11 22:07 by Root