Posts

Showing posts with the label describe

Featured Post

Directory environments in Puppet

Environments are individual groups of Puppet agents each environment have there own completely different manifests and module-paths. This basically is useful for testing changes to our Puppet code before implementing them on production machines. There are two types of implementation of environments structure in Puppet one if directory based and another is config file based here we will see bit of an insight about directory based. As usual for more information about this you can visit puppetlabs official website. On the master node: Append following details in puppet.conf which is placed under /etc/puppet or /etc/puppetlabs/puppet:     Under [main] section add a variable called confdir with value as /etc/puppet or /etc/puppetlabs/puppet     confdir=/etc/puppet Then add information regarding environments/manifests and modulepath in it.      #environments     environmentpath = $confdir/environments  ...

Manifests

Manifests Puppet programs are called “manifests,” and they use the .pp file extension. The core of the Puppet language is the resource declaration. A resource declaration describes a desired state for one resource. (Manifests can also use various kinds of logic: conditional statements, collections of resources, functions to generate text, etc. We’ll get to these later.) [root@server demo_manifests]# cat add_user.pp user { 'optimus':   ensure => 'present',   home   => '/home/optimus',   shell  => '/bin/bash', } [root@server demo_manifests]# [root@server demo_manifests]# puppet apply /root/Desktop/demo_manifests/add_user.pp notice: /Stage[main]//User[optimus]/ensure: created notice: Finished catalog run in 0.21 seconds [root@server demo_manifests]# Puppet Apply Like resource in the last chapter, apply is a Puppet subcommand. It takes the name of a manifest file as its argument, and enforces the desired state descri...

puppet master???

*Master daemon in Puppet "puppet master"* Puppet master is the central puppet server. Firing this command "puppet master" starts an instance of puppet master and runs as a daemon by default. [root@puppet ~]# /etc/init.d/puppetmaster status puppetmasterd is stopped [root@puppet ~]# puppet master [root@puppet ~]# /etc/init.d/puppetmaster status puppetmasterd (pid  31281) is running... [root@puppet ~]# If you want to enable full debugging mode while executing puppet master you can use the option --debug while firing it. [root@puppet ~]# puppet master --debug --no-daemonize debug: Puppet::Type::User::ProviderPw: file pw does not exist debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not exist debug: Puppet::Type::User::ProviderLdap: true value when expecting false debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl does not exist debug: Failed to load library 'rubygems' for feature 'rubygems' debug: /File[/...

puppet agent???

*Agent sub-command in Puppet "puppet agent"* The puppet agent subcommand is a powerful tool which fetches the configurations from a master server and get that applied to the agent node. It has basically two modes: 1. Daemonize and fetch configurations every half-hour (this is by default and can be changed). 2. Run once and quit It is the main puppet client. Basically its purpose is to retrieve the local machine's configuration from a remote server[the master] and apply it to the agent node. In order to successfully communicate with the remote server, the client must have a certificate signed by a certificate authority provided by the puppet master. The client will connect and request a signed certificate unless and until the puppet master sign's the certificate the agent node cannot communicate with the puppet master. Once the client has a signed certificate, it will retrieve its configuration from the puppet master and apply it on the agent node. Now sup...

puppet describe???

*Describe sub-command in Puppet "puppet describe" * The puppet describe sub-command can list info about the currently installed resource types on a given machine. This is a built in documentation and a great source of information. It helps us to know the behavior of types, their properties and parameters. "puppet describe -l" — List all of the resource types available on the system. "puppet describe -s <TYPE>" Print short information about a type, without describing every attribute "puppet describe <TYPE>" Shows each and every information about the type which you are referring too. [root@puppet ~]# puppet describe -l These are the types known to puppet: augeas          -  Apply a change or an array of changes to the ... computer        - Computer object management using DirectorySer ... cron            -  Installs a...