Ubuntu Server Guide Changes, errors and bugs
Download 1.27 Mb. Pdf ko'rish
|
ubuntu-server-guide
Configuration
Create a folder path for the apache2 class: sudo mkdir −p / e t c / puppet / modules / apache2 / m a n i f e s t s 289 Now setup some resources for apache2. Create a file /etc/puppet/modules/apache2/manifests/init.pp con- taining the following: c l a s s apache2 { package { ’ apache2 ’ : e n s u r e => i n s t a l l e d , } s e r v i c e { ’ apache2 ’ : e n s u r e => t r u e , e n a b l e => t r u e , r e q u i r e => Package [ ’ apache2 ’ ] , } } Next, create a node file /etc/puppet/code/environments/production/manifests/site.pp with: node ’ p u p p e t c l i e n t . example . com ’ { i n c l u d e apache2 } Note Replace puppetclient .example.com with your actual Puppet client’s host name. The final step for this simple Puppet server is to restart the daemon: sudo s y s t e m c t l r e s t a r t puppetmaster . s e r v i c e Now everything is configured on the Puppet server, it is time to configure the client. First, configure the Puppet agent daemon to start. Edit /etc/default/puppet, changing START to yes: START=y e s Then start the service: sudo s y s t e m c t l s t a r t puppet . s e r v i c e View the client cert fingerprint sudo puppet a g e n t −−f i n g e r p r i n t Back on the Puppet server, view pending certificate signing requests: sudo puppet c e r t l i s t On the Puppet server, verify the fingerprint of the client and sign puppetclient’s cert: sudo puppet c e r t s i g n p u p p e t c l i e n t . example . com On the Puppet client, run the puppet agent manually in the foreground. This step isn’t strictly speaking necessary, but it is the best way to test and debug the puppet service. sudo puppet a g e n t −−t e s t Check /var/log/syslog on both hosts for any errors with the configuration. If all goes well the apache2 package and it’s dependencies will be installed on the Puppet client. Note This example is very simple, and does not highlight many of Puppet’s features and benefits. For more information see Resources. 290 |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling