From be32d57f7829e62a53b4e98f1402c691fa68e7b7 Mon Sep 17 00:00:00 2001 From: Kevin Aloysius Date: Sat, 4 Oct 2014 21:06:40 -0700 Subject: [PATCH 1/5] Added Puppet Description --- docs/scenarios/admin.rst | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst index 2a82b03df..a4079c943 100644 --- a/docs/scenarios/admin.rst +++ b/docs/scenarios/admin.rst @@ -240,7 +240,26 @@ Chef Puppet ------ -.. todo:: Write about Puppet +`Puppet `_ is an IT Automation and configuration management +software from Puppet Labs that allows System Administrators to define the state of +their IT Infrastructure, thereby providing an elegant way to manage their fleet of +physical and virtual machines. + +Puppet is available both as an Open Source and an Enterprise variant. Modules are +small,shareable units of code written to automate or define the state of a system. +`Puppet Forge `_ is a repository for modules written +by the community for Open Source +and Enterprise Puppet. + +Puppet Agents are installed on nodes whose state needs to be monitored or changed. +A desginated server known as the Puppet Master is responsible for orchastrating the +agent nodes. + +Agent nodes send basic facts about the system such as to the Operating System, Kernel, +Architecture, IP Address, Hostname etc. to the Puppet Master. +The Puppet Master then compiles a catalog with information provided by the agents on +how each node should be configured and sends it to the agent. The agent enforces the +change as prescribed in the catalog and sends a report back to the Puppet Master. `Puppet Labs Documentation `_ From 5fc3eff097137ae8be7aaf3b29f56bffee1c6dd9 Mon Sep 17 00:00:00 2001 From: Kevin Aloysius Date: Sat, 4 Oct 2014 21:47:39 -0700 Subject: [PATCH 2/5] Facter Example --- docs/scenarios/admin.rst | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst index a4079c943..92a199cd6 100644 --- a/docs/scenarios/admin.rst +++ b/docs/scenarios/admin.rst @@ -248,20 +248,33 @@ physical and virtual machines. Puppet is available both as an Open Source and an Enterprise variant. Modules are small,shareable units of code written to automate or define the state of a system. `Puppet Forge `_ is a repository for modules written -by the community for Open Source -and Enterprise Puppet. +by the community for Open Source and Enterprise Puppet. Puppet Agents are installed on nodes whose state needs to be monitored or changed. A desginated server known as the Puppet Master is responsible for orchastrating the agent nodes. -Agent nodes send basic facts about the system such as to the Operating System, Kernel, -Architecture, IP Address, Hostname etc. to the Puppet Master. +Agent nodes send basic facts about the system such as to the operating system, kernel, +architecture, ip address, hostname etc. to the Puppet Master. The Puppet Master then compiles a catalog with information provided by the agents on how each node should be configured and sends it to the agent. The agent enforces the change as prescribed in the catalog and sends a report back to the Puppet Master. - `Puppet Labs Documentation `_ +Facter is an interesting tool that ships with Puppet that pulls basic facts about +the System. These facts can be referenced as a variable while writing your +Puppet modules. + +.. code-block:: console + + $ facter kernel + Linux +.. code-block:: console + + $ facter operatingsystem + Ubuntu + + +`Puppet Labs Documentation `_ Blueprint --------- From 65502530e9425d9779d26b9ec7dd9c2d24d611ae Mon Sep 17 00:00:00 2001 From: Kevin Aloysius Date: Sun, 5 Oct 2014 03:39:05 -0700 Subject: [PATCH 3/5] Added Puppet Code and Examples --- docs/scenarios/admin.rst | 55 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst index 92a199cd6..abca2e4f3 100644 --- a/docs/scenarios/admin.rst +++ b/docs/scenarios/admin.rst @@ -273,7 +273,60 @@ Puppet modules. $ facter operatingsystem Ubuntu - +Writing Modules in Puppet is pretty straight forward. Puppet Manifests together form +Puppet Modules. Puppet manifest end with an extension of ``.pp``. +Here is an example of 'Hello World' in Puppet. + +.. code-block:: puppet + + notify { 'This message is getting logged into the agent node': + + #As nothing is specified in the body the resource title + #the notification message by default. + } + +Here is another example with system based logic. Note how the operatingsystem fact +is being used as a variable prepended with the ``$`` sign. Similarly, this holds true +for other facts such as hostname which can be referenced by ``$hostname`` + +.. code-block:: puppet + + notify{ 'Mac Warning': + message => $operatingsystem ? { + 'Darwin' => 'This seems to be a Mac.', + default => 'I am a PC.', + }, + } + +There are several resource types for Puppet but the package-file-service paradigm is all +you need for undertaking majority of theconfiguration management. The following Puppet code makes sure +that the OpenSSH-Server package is installed in a system and the sshd service is notified to restart +everytime the sshd configuration file is changed. + +.. code-block:: puppet + + package { 'openssh-server': + ensure => installed, + } + + file { '/etc/ssh/sshd_config': + source => 'puppet:///modules/sshd/sshd_config', + owner => 'root', + group => 'root', + mode => '640', + notify => Service['sshd'], # sshd will restart + # whenever you edit this + # file + require => Package['openssh-server'], + + } + + service { 'sshd': + ensure => running, + enable => true, + hasstatus => true, + hasrestart=> true, + } `Puppet Labs Documentation `_ Blueprint From 40dc0d40c216ea90f94a6a797ef790e9e3630b20 Mon Sep 17 00:00:00 2001 From: Kevin Aloysius Date: Sun, 5 Oct 2014 03:41:34 -0700 Subject: [PATCH 4/5] Fixed Typo --- docs/scenarios/admin.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst index abca2e4f3..272488430 100644 --- a/docs/scenarios/admin.rst +++ b/docs/scenarios/admin.rst @@ -299,7 +299,7 @@ for other facts such as hostname which can be referenced by ``$hostname`` } There are several resource types for Puppet but the package-file-service paradigm is all -you need for undertaking majority of theconfiguration management. The following Puppet code makes sure +you need for undertaking majority of the configuration management. The following Puppet code makes sure that the OpenSSH-Server package is installed in a system and the sshd service is notified to restart everytime the sshd configuration file is changed. From a829c848a1bf7c0ce5cca0b4f273840c98df836c Mon Sep 17 00:00:00 2001 From: Kevin Aloysius Date: Sun, 5 Oct 2014 03:45:18 -0700 Subject: [PATCH 5/5] Minor Change --- docs/scenarios/admin.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst index 272488430..461c2a967 100644 --- a/docs/scenarios/admin.rst +++ b/docs/scenarios/admin.rst @@ -327,7 +327,8 @@ everytime the sshd configuration file is changed. hasstatus => true, hasrestart=> true, } -`Puppet Labs Documentation `_ + +For more information checkout `Puppet Labs Documentation `_ Blueprint ---------