SlideShare uma empresa Scribd logo
1 de 3
Baixar para ler offline
Admin  |  How To _______________________________________________________________________________________________________




                                           pet
                                        Pup w
                                         Sho

Automating UNIX Administration
                             A Puppet show can turn out to be real entertainment for UNIX administrators.




                             I
                                           n the UNIX operating system            problems in the UNIX environment occur due
                                           everything is a file, which makes      to ad-hoc changes, which can be mitigated
                                           it an easy-to-manage and               by following proper change management
                                           administrator-friendly system.         procedures. Handling and monitoring ad-hoc
                             The traditional way of managing UNIX was             changes, and restoring the previous state,
                             to use the telnet interface, but being a plain-      remains a challenge for organisations.
                             text protocol, telnet exposes you to the risk of          Meeting such challenges is quite workable
                             network snooping and compromise of login             for a small set-up of 1-20 servers and a dedicated
                             credentials. SSH works on an encrypted channel       UNIX administration. But during hardware
                             to overcome the snooping issues. A UNIX              failure or other problems, where the servers
                             administrator can SSH into the box from a            need to be reconfigured from scratch, it takes a
                             remote machine and change the configuration          lot of effort and time in restoring the servers to
                             or execute commands remotely.                        the previous state. To handle such scenarios, a
                                 Generally, it is considered a good practice to   quick solution would be to hire another UNIX
                             take a configuration backup before making any        administrator who could act as a secondary
                             changes to the production configuration so that      resource and offloads other activities from the
                             the old configuration is available for roll-back.    primary resource during disaster conditions.
                             Also, as a part of the organisation’s policy, the         Think about a scenario of managing a
                             same base configuration should be configured         globally-distributed data centre with 500 *NIX
                             on all the servers to reflect consistency and as     servers or more, comprising Solaris, Debian,
                             a server-hardening practice. A majority of the       Ubuntu, Fedora, CentOS, etc. Here, servers

40  |  June 2009 | LInuX For You | www.LinuxForu.com
____________________________________________________________________________________________________________                       How To    |  Admin

are running with the same base configuration and packages,
where configuration files need to be checked-out to a version-                           Client                         Client                 Client
controlled repository. Only planned changes are allowed and
the previous configuration state is restored for unplanned                         puppetd                           puppetd                 puppetd
changes. Additionally, centralised user and policy management,
along with automated configuration recovery during disaster
conditions are required. In such a case, building a team of
10-20 administrators would not be a recommended approach.                                                            Network
Rather, using a centralised configuration tool to automate the
administration tasks would be a better option to follow.
     Along with commercial tools like BladeLogic and OpsWare,
there are a couple of open source systems automation and
configuration management tools available like Bcfg2, Cfengine                                                      puppet Master
and Puppet. Cfengine has been an administrator’s favourite
configuration management framework since the past few years
                                                                              Figure 1: A typical Puppet set-up
and is widely being used by many companies. Puppet turns
out to be a next-generation configuration management tool to                  5. Now, create a sample manifest file to start the Puppet
overcome many of Cfengine’s weaknesses.                                          server. This is just a test manifest and more complex
     Puppet is written in Ruby and is released under the GPL. It                 manifests can be created using this tool, which will be
supports a number of operating systems like CentOS, Debian,                      demonstrated later. Put the following contents into the file
FreeBSD, Gentoo, OpenBSD, Solaris, SuSE Linux, Ubuntu,                           using Vim or any other text editor. The purpose here is to
etc. Puppet is being used by many organisations including                        create /tmp/testfile on a node (puppet client) if it doesn’t
Google, which uses it to manage all Mac desktops, laptops and                    exist:
Linux clients. A list of other Puppet users can be fetched from                    class test_class {
reductivelabs.com/trac/puppet/wiki/WhosUsingPuppet                                       file { “/tmp/testfile”:
                                                                                             ensure => present,
Puppet installation                                                                          mode => 644,
Puppet installation is fairly easy and is, in fact, a matter                                 owner => root,
of seconds. Puppet runs in client-server configuration,                                      group => root
where the client polls the server at port 8140 every 30                                  }
minutes to check for the new instructions or to match the                            }
configuration files. The client also listens to a port to have                       node puppetclient {
push-updates from the server. In Puppet terminology, a                                   include test_class
client is called a Puppet node and a server is called a Puppet                       }
master. Figure 1 shows the set-up.
    The following few steps demonstrate the installation                                  In the above content, the upper section defines a
steps for the CentOS operating system—a similar approach                           class named test_class that ensures that /tmp/testfile with
can be followed for other supported systems:                                       the defined permission is present on the client where
On the server side:                                                                the class will be included. In the lower section, client
1. Define the hostname for server as puppet.domain.com                             puppetclient includes the test_class and Puppet will create
2. Puppet can be installed using yum, but packages are not                         the file with the set permission on puppetclient if it doesn’t
    part of the default CentOS repositories or installation DVD.                   already exist. Once done, start the Puppet server using the
    Even though it is available at DAG’s repository, the versions                  following command:
    are outdated. The best repository for Puppet is EPEL (Extra                    service puppetmaster start
    Packages for Enterprise Linux—see fedoraproject.org/wiki/                 6. The Puppet server is now installed and configured to listen
    EPEL). Puppet RPMs can either be directly downloaded                         to incoming connections from agents. Default installation
    and installed, or the yum repository can be configured to                    comes with Webrick, which is not a good Web server to
    do the job. To use the EPEL repository, run the following                    handle loads from a higher number of Puppet agents.
    command as a root user:                                                      Apache and Mongrel can solve this problem. Refer to the
   rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-      Puppet wiki for instructions on configuring Puppet with
   5-3.noarch.rpm                                                                Mongrel.
3. Now install the Puppet server by issuing the following                     On the client side:
   command:                                                                   1. Define the hostname for the server as puppetclient.
   yum install puppet-server                                                     domain.com
4. Install ruby-rdoc to enable Puppet command line help:                      2. Configure the EPEL repository using the following
   yum install ruby-rdoc                                                         command again:

                                                                                                  www.LinuxForu.com | LInuX For You | June 2009 | 41
Admin  |  How To ____________________________________________________________________________________________________________

     rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-   exec { “/usr/sbin/start_vhost”: }
     5-3.noarch.rpm                                                             }
3. Install puppet and ruby-rdoc:                                                Sample 4: To start a service as per the remote operating
     yum install puppet ruby-rdoc                                               system:
           This completes installation of the Puppet server                     class httpd_service_start {
     and client.                                                                case $operatingsystem {
           Before proceeding further, make sure that the                        redhat: { service { “httpd”: ensure => running }}
     systems timing for the Puppet server and client are in                     debian: { service { “apache”: ensure => running }}
     sync. Now, from the client, issue the following command                    default: { service { “apache2”: ensure => running }}
     to get approval from the server as its subscriber:                         }
     puppetd --verbose --server puppet.domain.com                               }
             This will display the following output:                            Sample 5: To create a user:
     info: Creating a new certificate request for pclient.torridnetworks.com    class virt_users {
     info: Creating a new SSL key at /var/lib/puppet/ssl/private_keys/          @user { “jsmith”:
     puppetclient.domain.com.pem                                                ensure => “present”,
           In the above command, the client has raised a                        uid => “507”,
     request to the server to be registered as a subscriber. Now,               gid => “507”,
     the server needs to approve the subscriptions. To view the                 comment => “John Smith”,
     pending subscriptions, issue the following command on                      home => “/nfs/HR/home/jsmith”,
     the server:                                                                shell => “/bin/bash”,
     puppetca --list                                                            }
           The above command will give the name of the node                     Sample 6: To manage Cron job:
     that needs to be approved or signed by the server. In the                  class set_cron_syscheck {
     next command, sign that node:                                              cron { “syscheck”:
     puppetca -s puppetclient.domain.com                                        command => “/usr/bin/syscheck”,
            Once the client is approved by the server, the class                user => “root”,
     assigned to the client will be executed. In this case, a file              hour => “18”,
     /tmp/testfile will be created on puppetclient.domain.com.                  minute => “0”
     If the created file is deleted, it will be recreated on the next           }
     polling, i.e., within the next 30 minutes.                                 }
            Once the basic Puppet infrastructure is ready,                      Sample 7: Transferring a file from the Puppet server:
     different classes can be created to accomplish different                   class httpd_conf{
     tasks.                                                                     file { “httpd.conf”:
                                                                                source => “puppet://puppetmaster/httpd/conf/httpd.conf”
Some sample Puppet classes                                                      }
Below are a few sample classes for quick reference.                             }
Sample 1: To install Apache and run the httpd service:                              Of course, much more detailed manifests can be created
class apache {                                                                  to manage multiple servers with heterogeneous UNIX
package { httpd: ensure => installed }                                          operating systems. Subversion can be configured with
service { “httpd”:                                                              Puppet to store configuration files and track changes, so
ensure => running,                                                              that the changes can be reverted to a previous state.
require => Package[“httpd”],                                                        Reporting is one of the important aspects of a
}                                                                               configuration management system. Reporting from a
}                                                                               configuration management system can provide information
Sample 2: To stop the mdmdp service:                                            on performance and compliance to policies and standards.
class redhat {                                                                  Puppet’s reporting engine is limited at this stage, but still
service {                                                                       allows some useful basic reporting that can be graphed and
“mdmdp”:                                                                        displayed.
enable => true,                                                                     So, all in all, Puppet can be a real boost for UNIX
ensure => stopped,                                                              administrators.
}
}
                                                                                    By: Dhruv Soi
Sample 3: To execute commands:
                                                                                    The author is the founder and principal consultant, Torrid
class start_vhost {
                                                                                    Networks, and chair, OWASP India. He can be reached at
$noop = true                                                                        dhruv.soi@torridnet.com
exec { “/usr/sbin/start_ws”: }



42  |  June 2009 | LInuX For You | www.LinuxForu.com

Mais conteúdo relacionado

Mais procurados

Performance characteristics of traditional v ms vs docker containers (dockerc...
Performance characteristics of traditional v ms vs docker containers (dockerc...Performance characteristics of traditional v ms vs docker containers (dockerc...
Performance characteristics of traditional v ms vs docker containers (dockerc...Boden Russell
 
Supporting and Using EC2/CIMI on top of Cloud Environments via Deltacloud
Supporting and Using EC2/CIMI on top of Cloud Environments via DeltacloudSupporting and Using EC2/CIMI on top of Cloud Environments via Deltacloud
Supporting and Using EC2/CIMI on top of Cloud Environments via DeltacloudOved Ourfali
 
How Quantum configures Virtual Networks under the Hood?
How Quantum configures Virtual Networks under the Hood?How Quantum configures Virtual Networks under the Hood?
How Quantum configures Virtual Networks under the Hood?Etsuji Nakai
 
LXC – NextGen Virtualization for Cloud benefit realization (cloudexpo)
LXC – NextGen Virtualization for Cloud benefit realization (cloudexpo)LXC – NextGen Virtualization for Cloud benefit realization (cloudexpo)
LXC – NextGen Virtualization for Cloud benefit realization (cloudexpo)Boden Russell
 
Red Hat Enterprise Linux OpenStack Platform 7 - VM Instance HA Architecture
Red Hat Enterprise Linux OpenStack Platform 7 - VM Instance HA ArchitectureRed Hat Enterprise Linux OpenStack Platform 7 - VM Instance HA Architecture
Red Hat Enterprise Linux OpenStack Platform 7 - VM Instance HA ArchitectureEtsuji Nakai
 
Cgroups, namespaces and beyond: what are containers made from?
Cgroups, namespaces and beyond: what are containers made from?Cgroups, namespaces and beyond: what are containers made from?
Cgroups, namespaces and beyond: what are containers made from?Docker, Inc.
 
KVM and docker LXC Benchmarking with OpenStack
KVM and docker LXC Benchmarking with OpenStackKVM and docker LXC Benchmarking with OpenStack
KVM and docker LXC Benchmarking with OpenStackBoden Russell
 
The HaLVM: A Simple Platform for Simple Platforms
The HaLVM: A Simple Platform for Simple PlatformsThe HaLVM: A Simple Platform for Simple Platforms
The HaLVM: A Simple Platform for Simple PlatformsThe Linux Foundation
 
How to operate containerized OpenStack
How to operate containerized OpenStackHow to operate containerized OpenStack
How to operate containerized OpenStackNalee Jang
 
Automating Your CloudStack Cloud with Puppet
Automating Your CloudStack Cloud with PuppetAutomating Your CloudStack Cloud with Puppet
Automating Your CloudStack Cloud with Puppetbuildacloud
 
Docker: automation for the rest of us
Docker: automation for the rest of usDocker: automation for the rest of us
Docker: automation for the rest of usJérôme Petazzoni
 
Networking in Kubernetes
Networking in KubernetesNetworking in Kubernetes
Networking in KubernetesMinhan Xia
 
Orchestrating Redis & K8s Operators
Orchestrating Redis & K8s OperatorsOrchestrating Redis & K8s Operators
Orchestrating Redis & K8s OperatorsDoiT International
 
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-12012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1tcloudcomputing-tw
 
How to become cloud backup provider
How to become cloud backup providerHow to become cloud backup provider
How to become cloud backup providerCLOUDIAN KK
 
Docker introduction
Docker introductionDocker introduction
Docker introductionJo Ee Liew
 
Cloudstack networking2
Cloudstack networking2Cloudstack networking2
Cloudstack networking2Hiroaki Kawai
 

Mais procurados (20)

Performance characteristics of traditional v ms vs docker containers (dockerc...
Performance characteristics of traditional v ms vs docker containers (dockerc...Performance characteristics of traditional v ms vs docker containers (dockerc...
Performance characteristics of traditional v ms vs docker containers (dockerc...
 
Supporting and Using EC2/CIMI on top of Cloud Environments via Deltacloud
Supporting and Using EC2/CIMI on top of Cloud Environments via DeltacloudSupporting and Using EC2/CIMI on top of Cloud Environments via Deltacloud
Supporting and Using EC2/CIMI on top of Cloud Environments via Deltacloud
 
How Quantum configures Virtual Networks under the Hood?
How Quantum configures Virtual Networks under the Hood?How Quantum configures Virtual Networks under the Hood?
How Quantum configures Virtual Networks under the Hood?
 
LXC – NextGen Virtualization for Cloud benefit realization (cloudexpo)
LXC – NextGen Virtualization for Cloud benefit realization (cloudexpo)LXC – NextGen Virtualization for Cloud benefit realization (cloudexpo)
LXC – NextGen Virtualization for Cloud benefit realization (cloudexpo)
 
Build a Cloud Day San Francisco - Ubuntu Cloud
Build a Cloud Day San Francisco - Ubuntu CloudBuild a Cloud Day San Francisco - Ubuntu Cloud
Build a Cloud Day San Francisco - Ubuntu Cloud
 
Red Hat Enterprise Linux OpenStack Platform 7 - VM Instance HA Architecture
Red Hat Enterprise Linux OpenStack Platform 7 - VM Instance HA ArchitectureRed Hat Enterprise Linux OpenStack Platform 7 - VM Instance HA Architecture
Red Hat Enterprise Linux OpenStack Platform 7 - VM Instance HA Architecture
 
Cgroups, namespaces and beyond: what are containers made from?
Cgroups, namespaces and beyond: what are containers made from?Cgroups, namespaces and beyond: what are containers made from?
Cgroups, namespaces and beyond: what are containers made from?
 
KVM and docker LXC Benchmarking with OpenStack
KVM and docker LXC Benchmarking with OpenStackKVM and docker LXC Benchmarking with OpenStack
KVM and docker LXC Benchmarking with OpenStack
 
The HaLVM: A Simple Platform for Simple Platforms
The HaLVM: A Simple Platform for Simple PlatformsThe HaLVM: A Simple Platform for Simple Platforms
The HaLVM: A Simple Platform for Simple Platforms
 
How to operate containerized OpenStack
How to operate containerized OpenStackHow to operate containerized OpenStack
How to operate containerized OpenStack
 
draft_myungho
draft_myunghodraft_myungho
draft_myungho
 
Automating Your CloudStack Cloud with Puppet
Automating Your CloudStack Cloud with PuppetAutomating Your CloudStack Cloud with Puppet
Automating Your CloudStack Cloud with Puppet
 
Xen and Apache cloudstack
Xen and Apache cloudstack  Xen and Apache cloudstack
Xen and Apache cloudstack
 
Docker: automation for the rest of us
Docker: automation for the rest of usDocker: automation for the rest of us
Docker: automation for the rest of us
 
Networking in Kubernetes
Networking in KubernetesNetworking in Kubernetes
Networking in Kubernetes
 
Orchestrating Redis & K8s Operators
Orchestrating Redis & K8s OperatorsOrchestrating Redis & K8s Operators
Orchestrating Redis & K8s Operators
 
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-12012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
2012 CloudStack Design Camp in Taiwan--- CloudStack Overview-1
 
How to become cloud backup provider
How to become cloud backup providerHow to become cloud backup provider
How to become cloud backup provider
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Cloudstack networking2
Cloudstack networking2Cloudstack networking2
Cloudstack networking2
 

Semelhante a Unix Automation using centralized configuration management tool

Scalable Systems Management with Puppet
Scalable Systems Management with PuppetScalable Systems Management with Puppet
Scalable Systems Management with PuppetPuppet
 
Scalable systems management with puppet
Scalable systems management with puppetScalable systems management with puppet
Scalable systems management with puppetPuppet
 
Instalando Cacti no CentOS 5
Instalando Cacti no CentOS 5Instalando Cacti no CentOS 5
Instalando Cacti no CentOS 5Carlos Eduardo
 
The Switch as a Server - PuppetConf 2014
The Switch as a Server - PuppetConf 2014The Switch as a Server - PuppetConf 2014
The Switch as a Server - PuppetConf 2014Puppet
 
Cluster management (supercomputer)
Cluster management (supercomputer)Cluster management (supercomputer)
Cluster management (supercomputer)Hary HarysMatta
 
the NML project
the NML projectthe NML project
the NML projectLei Yang
 
Puppet slides for intelligrape
Puppet slides for intelligrapePuppet slides for intelligrape
Puppet slides for intelligrapeSharad Aggarwal
 
One click deployment
One click deploymentOne click deployment
One click deploymentAlex Su
 
Enabling ceph-mgr to control Ceph services via Kubernetes
Enabling ceph-mgr to control Ceph services via KubernetesEnabling ceph-mgr to control Ceph services via Kubernetes
Enabling ceph-mgr to control Ceph services via Kubernetesmountpoint.io
 
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris WhitepaperEucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris WhitepaperTorry Harris Business Solutions
 
Manage your switches like servers
Manage your switches like serversManage your switches like servers
Manage your switches like serversCumulus Networks
 
Ovms ops manager_admin
Ovms ops manager_adminOvms ops manager_admin
Ovms ops manager_adminsati1981
 
Drupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The BasicsDrupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The BasicsJohn Smith
 
Install websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsInstall websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsManuel Vega
 
4 implementation
4 implementation4 implementation
4 implementationhanmya
 
final proposal-Xen based Hypervisor in a Box
final proposal-Xen based Hypervisor in a Boxfinal proposal-Xen based Hypervisor in a Box
final proposal-Xen based Hypervisor in a BoxParamkusham Shruthi
 
John Spray - Ceph in Kubernetes
John Spray - Ceph in KubernetesJohn Spray - Ceph in Kubernetes
John Spray - Ceph in KubernetesShapeBlue
 
Know thyubuntu
Know thyubuntuKnow thyubuntu
Know thyubuntuchkmao
 
Deploying datacenters with Puppet - PuppetCamp Europe 2010
Deploying datacenters with Puppet - PuppetCamp Europe 2010Deploying datacenters with Puppet - PuppetCamp Europe 2010
Deploying datacenters with Puppet - PuppetCamp Europe 2010Puppet
 

Semelhante a Unix Automation using centralized configuration management tool (20)

Scalable Systems Management with Puppet
Scalable Systems Management with PuppetScalable Systems Management with Puppet
Scalable Systems Management with Puppet
 
Scalable systems management with puppet
Scalable systems management with puppetScalable systems management with puppet
Scalable systems management with puppet
 
Puppet demo
Puppet demoPuppet demo
Puppet demo
 
Instalando Cacti no CentOS 5
Instalando Cacti no CentOS 5Instalando Cacti no CentOS 5
Instalando Cacti no CentOS 5
 
The Switch as a Server - PuppetConf 2014
The Switch as a Server - PuppetConf 2014The Switch as a Server - PuppetConf 2014
The Switch as a Server - PuppetConf 2014
 
Cluster management (supercomputer)
Cluster management (supercomputer)Cluster management (supercomputer)
Cluster management (supercomputer)
 
the NML project
the NML projectthe NML project
the NML project
 
Puppet slides for intelligrape
Puppet slides for intelligrapePuppet slides for intelligrape
Puppet slides for intelligrape
 
One click deployment
One click deploymentOne click deployment
One click deployment
 
Enabling ceph-mgr to control Ceph services via Kubernetes
Enabling ceph-mgr to control Ceph services via KubernetesEnabling ceph-mgr to control Ceph services via Kubernetes
Enabling ceph-mgr to control Ceph services via Kubernetes
 
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris WhitepaperEucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
Eucalyptus on Xen - Build Enterprise Private Cloud | Torry Harris Whitepaper
 
Manage your switches like servers
Manage your switches like serversManage your switches like servers
Manage your switches like servers
 
Ovms ops manager_admin
Ovms ops manager_adminOvms ops manager_admin
Ovms ops manager_admin
 
Drupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The BasicsDrupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The Basics
 
Install websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsInstall websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bits
 
4 implementation
4 implementation4 implementation
4 implementation
 
final proposal-Xen based Hypervisor in a Box
final proposal-Xen based Hypervisor in a Boxfinal proposal-Xen based Hypervisor in a Box
final proposal-Xen based Hypervisor in a Box
 
John Spray - Ceph in Kubernetes
John Spray - Ceph in KubernetesJohn Spray - Ceph in Kubernetes
John Spray - Ceph in Kubernetes
 
Know thyubuntu
Know thyubuntuKnow thyubuntu
Know thyubuntu
 
Deploying datacenters with Puppet - PuppetCamp Europe 2010
Deploying datacenters with Puppet - PuppetCamp Europe 2010Deploying datacenters with Puppet - PuppetCamp Europe 2010
Deploying datacenters with Puppet - PuppetCamp Europe 2010
 

Último

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

Unix Automation using centralized configuration management tool

  • 1. Admin  |  How To _______________________________________________________________________________________________________ pet Pup w Sho Automating UNIX Administration A Puppet show can turn out to be real entertainment for UNIX administrators. I n the UNIX operating system problems in the UNIX environment occur due everything is a file, which makes to ad-hoc changes, which can be mitigated it an easy-to-manage and by following proper change management administrator-friendly system. procedures. Handling and monitoring ad-hoc The traditional way of managing UNIX was changes, and restoring the previous state, to use the telnet interface, but being a plain- remains a challenge for organisations. text protocol, telnet exposes you to the risk of Meeting such challenges is quite workable network snooping and compromise of login for a small set-up of 1-20 servers and a dedicated credentials. SSH works on an encrypted channel UNIX administration. But during hardware to overcome the snooping issues. A UNIX failure or other problems, where the servers administrator can SSH into the box from a need to be reconfigured from scratch, it takes a remote machine and change the configuration lot of effort and time in restoring the servers to or execute commands remotely. the previous state. To handle such scenarios, a Generally, it is considered a good practice to quick solution would be to hire another UNIX take a configuration backup before making any administrator who could act as a secondary changes to the production configuration so that resource and offloads other activities from the the old configuration is available for roll-back. primary resource during disaster conditions. Also, as a part of the organisation’s policy, the Think about a scenario of managing a same base configuration should be configured globally-distributed data centre with 500 *NIX on all the servers to reflect consistency and as servers or more, comprising Solaris, Debian, a server-hardening practice. A majority of the Ubuntu, Fedora, CentOS, etc. Here, servers 40  |  June 2009 | LInuX For You | www.LinuxForu.com
  • 2. ____________________________________________________________________________________________________________ How To  |  Admin are running with the same base configuration and packages, where configuration files need to be checked-out to a version- Client Client Client controlled repository. Only planned changes are allowed and the previous configuration state is restored for unplanned puppetd puppetd puppetd changes. Additionally, centralised user and policy management, along with automated configuration recovery during disaster conditions are required. In such a case, building a team of 10-20 administrators would not be a recommended approach. Network Rather, using a centralised configuration tool to automate the administration tasks would be a better option to follow. Along with commercial tools like BladeLogic and OpsWare, there are a couple of open source systems automation and configuration management tools available like Bcfg2, Cfengine puppet Master and Puppet. Cfengine has been an administrator’s favourite configuration management framework since the past few years Figure 1: A typical Puppet set-up and is widely being used by many companies. Puppet turns out to be a next-generation configuration management tool to 5. Now, create a sample manifest file to start the Puppet overcome many of Cfengine’s weaknesses. server. This is just a test manifest and more complex Puppet is written in Ruby and is released under the GPL. It manifests can be created using this tool, which will be supports a number of operating systems like CentOS, Debian, demonstrated later. Put the following contents into the file FreeBSD, Gentoo, OpenBSD, Solaris, SuSE Linux, Ubuntu, using Vim or any other text editor. The purpose here is to etc. Puppet is being used by many organisations including create /tmp/testfile on a node (puppet client) if it doesn’t Google, which uses it to manage all Mac desktops, laptops and exist: Linux clients. A list of other Puppet users can be fetched from class test_class { reductivelabs.com/trac/puppet/wiki/WhosUsingPuppet file { “/tmp/testfile”: ensure => present, Puppet installation mode => 644, Puppet installation is fairly easy and is, in fact, a matter owner => root, of seconds. Puppet runs in client-server configuration, group => root where the client polls the server at port 8140 every 30 } minutes to check for the new instructions or to match the } configuration files. The client also listens to a port to have node puppetclient { push-updates from the server. In Puppet terminology, a include test_class client is called a Puppet node and a server is called a Puppet } master. Figure 1 shows the set-up. The following few steps demonstrate the installation In the above content, the upper section defines a steps for the CentOS operating system—a similar approach class named test_class that ensures that /tmp/testfile with can be followed for other supported systems: the defined permission is present on the client where On the server side: the class will be included. In the lower section, client 1. Define the hostname for server as puppet.domain.com puppetclient includes the test_class and Puppet will create 2. Puppet can be installed using yum, but packages are not the file with the set permission on puppetclient if it doesn’t part of the default CentOS repositories or installation DVD. already exist. Once done, start the Puppet server using the Even though it is available at DAG’s repository, the versions following command: are outdated. The best repository for Puppet is EPEL (Extra service puppetmaster start Packages for Enterprise Linux—see fedoraproject.org/wiki/ 6. The Puppet server is now installed and configured to listen EPEL). Puppet RPMs can either be directly downloaded to incoming connections from agents. Default installation and installed, or the yum repository can be configured to comes with Webrick, which is not a good Web server to do the job. To use the EPEL repository, run the following handle loads from a higher number of Puppet agents. command as a root user: Apache and Mongrel can solve this problem. Refer to the rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release- Puppet wiki for instructions on configuring Puppet with 5-3.noarch.rpm Mongrel. 3. Now install the Puppet server by issuing the following On the client side: command: 1. Define the hostname for the server as puppetclient. yum install puppet-server domain.com 4. Install ruby-rdoc to enable Puppet command line help: 2. Configure the EPEL repository using the following yum install ruby-rdoc command again: www.LinuxForu.com | LInuX For You | June 2009 | 41
  • 3. Admin  |  How To ____________________________________________________________________________________________________________ rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release- exec { “/usr/sbin/start_vhost”: } 5-3.noarch.rpm } 3. Install puppet and ruby-rdoc: Sample 4: To start a service as per the remote operating yum install puppet ruby-rdoc system: This completes installation of the Puppet server class httpd_service_start { and client. case $operatingsystem { Before proceeding further, make sure that the redhat: { service { “httpd”: ensure => running }} systems timing for the Puppet server and client are in debian: { service { “apache”: ensure => running }} sync. Now, from the client, issue the following command default: { service { “apache2”: ensure => running }} to get approval from the server as its subscriber: } puppetd --verbose --server puppet.domain.com } This will display the following output: Sample 5: To create a user: info: Creating a new certificate request for pclient.torridnetworks.com class virt_users { info: Creating a new SSL key at /var/lib/puppet/ssl/private_keys/ @user { “jsmith”: puppetclient.domain.com.pem ensure => “present”, In the above command, the client has raised a uid => “507”, request to the server to be registered as a subscriber. Now, gid => “507”, the server needs to approve the subscriptions. To view the comment => “John Smith”, pending subscriptions, issue the following command on home => “/nfs/HR/home/jsmith”, the server: shell => “/bin/bash”, puppetca --list } The above command will give the name of the node Sample 6: To manage Cron job: that needs to be approved or signed by the server. In the class set_cron_syscheck { next command, sign that node: cron { “syscheck”: puppetca -s puppetclient.domain.com command => “/usr/bin/syscheck”, Once the client is approved by the server, the class user => “root”, assigned to the client will be executed. In this case, a file hour => “18”, /tmp/testfile will be created on puppetclient.domain.com. minute => “0” If the created file is deleted, it will be recreated on the next } polling, i.e., within the next 30 minutes. } Once the basic Puppet infrastructure is ready, Sample 7: Transferring a file from the Puppet server: different classes can be created to accomplish different class httpd_conf{ tasks. file { “httpd.conf”: source => “puppet://puppetmaster/httpd/conf/httpd.conf” Some sample Puppet classes } Below are a few sample classes for quick reference. } Sample 1: To install Apache and run the httpd service: Of course, much more detailed manifests can be created class apache { to manage multiple servers with heterogeneous UNIX package { httpd: ensure => installed } operating systems. Subversion can be configured with service { “httpd”: Puppet to store configuration files and track changes, so ensure => running, that the changes can be reverted to a previous state. require => Package[“httpd”], Reporting is one of the important aspects of a } configuration management system. Reporting from a } configuration management system can provide information Sample 2: To stop the mdmdp service: on performance and compliance to policies and standards. class redhat { Puppet’s reporting engine is limited at this stage, but still service { allows some useful basic reporting that can be graphed and “mdmdp”: displayed. enable => true, So, all in all, Puppet can be a real boost for UNIX ensure => stopped, administrators. } } By: Dhruv Soi Sample 3: To execute commands: The author is the founder and principal consultant, Torrid class start_vhost { Networks, and chair, OWASP India. He can be reached at $noop = true dhruv.soi@torridnet.com exec { “/usr/sbin/start_ws”: } 42  |  June 2009 | LInuX For You | www.LinuxForu.com