Thursday, August 13, 2015

Install the Perl module

Unable to install a perl module and through below error:

Looking for CPAN mirrors near you (please be patient)
Can't locate Time/HiRes.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 /OBD/OBRT) at /usr/share/perl5/Net/Ping.pm line 313.

Needs to install perl-Time-HiRes.x86_64 4:1.9725-3.el7 package to fix this issue

[root@localhost OBRT]# yum install perl-Time-HiRes
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package perl-Time-HiRes.x86_64 4:1.9725-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================
 Package                          Arch                    Version                            Repository                  Size
==============================================================================================================================
Installing:
 perl-Time-HiRes                  x86_64                  4:1.9725-3.el7                     rhel7_dvd                   45 k

Transaction Summary
==============================================================================================================================
Install  1 Package

Total download size: 45 k
Installed size: 92 k
Is this ok [y/d/N]: yes
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 4:perl-Time-HiRes-1.9725-3.el7.x86_64                                                                      1/1
  Verifying  : 4:perl-Time-HiRes-1.9725-3.el7.x86_64                                                                      1/1

Installed:
  perl-Time-HiRes.x86_64 4:1.9725-3.el7

Complete!

2) Install the DBI module 

[root@localhost OBRT]# cpan install DBI


Tuesday, August 11, 2015

Create a Yum repo

step 1)


[root@localhost Packages]#mount -o loop /dev/cdrom /a

step2)


[root@localhost Packages]#rpm -ivh createrepo-0.9.9-23.el7.noarch.rpm

step 3)

[root@localhost Packages]# more /etc/yum.repos.d/test.repo
[rhel7_dvd]
gpgcheck = 0
enabled = 1
baseurl = file:///a
name = test
[root@localhost Packages]#

step 4)

[root@localhost Packages]# yum repolist
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id                                                                       repo name                                                                status
rhel7_dvd                                                                     test                                                                     4,305
repolist: 4,305
[root@localhost Packages]#

Monday, August 10, 2015

Restart the puppet server

[root@localhost bin]# ./puppetserver  foreground


^Z
[1]+  Stopped                 ./puppetserver foreground
[root@localhost bin]# bg
[1]+ ./puppetserver foreground &
[root@localhost bin]# service pe-puppet start
Redirecting to /bin/systemctl start  pe-puppet.service
[root@localhost bin]# 2015-08-11 01:28:30,699 INFO  [o.e.j.u.log] Logging initialized @25047ms
2015-08-11 01:28:33,683 INFO  [p.t.s.w.jetty9-service] Initializing web server(s).
2015-08-11 01:28:33,903 INFO  [p.s.j.jruby-puppet-service] Initializing the JRuby service
2015-08-11 01:28:33,905 WARN  [p.s.j.jruby-puppet-core] No configuration value found for jruby-puppet max-active-instances; using default value of 1.  Please consider setting this value explicitly in the jruby-puppet section of your Puppet Server config files.

[root@localhost bin]# /bin/systemctl start  pe-puppet.service
[root@localhost bin]#
[root@localhost bin]# ps -ef | grep 2015-08-11 01:28:56,757 INFO  [puppet-server] Puppet Puppet settings initialized; run mode: master
2015-08-11 01:28:59,855 INFO  [p.s.j.jruby-puppet-agents] Finished creating JRubyPuppet instance 1 of 1
2015-08-11 01:28:59,992 INFO  [p.s.c.puppet-server-config-core] Not overriding webserver settings with values from core Puppet
2015-08-11 01:28:59,998 INFO  [p.p.certificate-authority] CA already initialized for SSL
2015-08-11 01:28:59,999 INFO  [p.s.c.certificate-authority-service] CA Service adding a ring handler
2015-08-11 01:29:00,017 WARN  [o.e.j.s.h.ContextHandler] Empty contextPath
2015-08-11 01:29:00,084 INFO  [p.p.certificate-authority] Master already initialized for SSL
2015-08-11 01:29:00,090 INFO  [p.e.s.m.master-service] Master Service adding a ring handler
2015-08-11 01:29:00,090 WARN  [o.e.j.s.h.ContextHandler] Empty contextPath
2015-08-11 01:29:00,096 INFO  [p.s.p.puppet-admin-service] Starting Puppet Admin web app
2015-08-11 01:29:00,106 INFO  [p.t.s.w.jetty9-service] Starting web server(s).
2015-08-11 01:29:00,573 INFO  [p.t.s.w.jetty9-core] Starting web server.
2015-08-11 01:29:00,579 INFO  [o.e.j.s.Server] jetty-9.2.z-SNAPSHOT
2015-08-11 01:29:01,404 INFO  [o.e.j.s.h.ContextHandler] Started o.e.j.s.ServletContextHandler@754424ce{/packages,file:/opt/puppet/packages/public/,AVAILABLE}
2015-08-11 01:29:01,406 INFO  [o.e.j.s.h.ContextHandler] Started o.e.j.s.h.ContextHandler@4af56eab{/,null,AVAILABLE}
2015-08-11 01:29:01,408 INFO  [o.e.j.s.h.ContextHandler] Started o.e.j.s.h.ContextHandler@3734c2ff{/,null,AVAILABLE}
2015-08-11 01:29:01,410 INFO  [o.e.j.s.h.ContextHandler] Started o.e.j.s.h.ContextHandler@6cbc6861{/puppet-admin-api,null,AVAILABLE}

Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
[root@localhost bin]# 2015-08-11 01:29:02,016 INFO  [o.e.j.s.ServerConnector] Started ServerConnector@5bf1fe70{SSL-HTTP/1.1}{0.0.0.0:8140}
2015-08-11 01:29:02,017 INFO  [o.e.j.s.Server] Started @56392ms
2015-08-11 01:29:02,110 INFO  [p.e.s.m.master-service] Puppet Server has successfully started and is now ready to handle requests

[root@localhost bin]#








how to restart the puppet?

[root@localhost opt]# service pe-puppet restart
Redirecting to /bin/systemctl restart  pe-puppet.service

[root@localhost opt]#
[root@localhost opt]# /bin/systemctl restart  pe-puppet.service
[root@localhost opt]#

Friday, August 7, 2015

how to open 3000 port for puppet on RHEL 7?

1) add rule for 3000 ports through firewall-cmd command

[root@localhost puppet-enterprise-3.8.0-el-7-x86_64]# firewall-cmd --zone=public --add-port=3000/tcp --permanent
success
[root@localhost puppet-enterprise-3.8.0-el-7-x86_64]#

2) Reload the firewall rules

[root@localhost puppet-enterprise-3.8.0-el-7-x86_64]# firewall-cmd --reload
success
[root@localhost puppet-enterprise-3.8.0-el-7-x86_64]#

3) verify the port status

[root@localhost puppet-enterprise-3.8.0-el-7-x86_64]# iptables-save | grep -i 3000
-A IN_public_allow -p tcp -m tcp --dport 3000 -m conntrack --ctstate NEW -j ACCEPT
[root@localhost puppet-enterprise-3.8.0-el-7-x86_64]#


Thursday, August 6, 2015

Puppet Installation

Step 1) Download the puppet installer
Step2) unzip and untar it
Step3) Run the puppet installer
root@test puppet-enterprise-3.8.0-el-7-x86_64]# ./puppet-enterprise-installer
==============================================================================================================================

Puppet Enterprise v3.8.0 installer

Puppet Enterprise documentation can be found at http://docs.puppetlabs.com/pe/3.8/

------------------------------------------------------------------------------------------------------------------------------

STEP 1: GUIDED INSTALLATION

Before you begin, choose an installation method. We've provided a few paths to choose from.

- Perform a guided installation using the web-based interface. Think of this as an installation interview in which we ask
you exactly how you want to install PE. In order to use the web-based installer, you must be able to access this machine
on port 3000 and provide the SSH credentials of a user with root access. This method will login to servers on your behalf,
install Puppet Enterprise and get you up and running fairly quickly.

- Use the web-based interface to create an answer file so that you can log in to the servers yourself and perform the
installation locally. If you choose not to use the web-based interface, you can write your own answer file, or use the
answer file(s) provided in the PE installation tarball. Refer to Answer File Installation
(http://docs.puppetlabs.com/pe/3.8/install_automated.html), which provides an overview on installing PE with an answer
file.

?? Install packages and perform a guided install? [Y/n] y

Installing setup packages.

Please go to https://test:3000 in your browser to continue installation. Be sure to use https:// and that port 3000 is
Reachable through the firewall.
Step4) Enable the firewall to allow 3000 port
Step 5) create the Puppet master



Tuesday, August 4, 2015

How to enable the repo on RHEL 7?

Error:

root@localhost /]# yum install perl
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 You can enable repos with yum-config-manager --enable
[root@localhost /]# yum repolist all
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id                                                     repo name                                                 status
rhel7                                                       rhel7                                                     disabled
repolist: 0

step 1) Installed yum-util packages

root@localhost Packages]# rpm -ivh python-chardet-2.0.1-7.el7.noarch.rpm
warning: python-chardet-2.0.1-7.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:python-chardet-2.0.1-7.el7       ################################# [100%]
[root@localhost Packages]# rpm -ivh python-kitchen-1.1.1-5.el7.noarch.rpm
warning: python-kitchen-1.1.1-5.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:python-kitchen-1.1.1-5.el7       ################################# [100%]
[root@localhost Packages]# rpm -ivh python-chardet-2.0.1-7.el7.noarch.rpm
warning: python-chardet-2.0.1-7.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                          ################################# [100%]
        package python-chardet-2.0.1-7.el7.noarch is already installed
[root@localhost Packages]# rpm -ivh yum-utils-1.1.31-24.el7.noarch.rpm
warning: yum-utils-1.1.31-24.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:yum-utils-1.1.31-24.el7          ################################# [100%]

step 2) Enabled the repo through yum-config-manager

[root@localhost Packages]# yum-config-manager --enable rhel7
Loaded plugins: product-id
======================================================== repo: rhel7 =========================================================
[rhel7]
async = True
bandwidth = 0
base_persistdir = /var/lib/yum/repos/x86_64/7Server
baseurl = file:///Packages/
cache = 0
cachedir = /var/cache/yum/x86_64/7Server/rhel7
check_config_file_age = True
cost = 1000
deltarpm_metadata_percentage = 100
deltarpm_percentage =
enabled = 1
enablegroups = True
exclude =
failovermethod = priority
gpgcadir = /var/lib/yum/repos/x86_64/7Server/rhel7/gpgcadir
gpgcakey =
gpgcheck = True
gpgdir = /var/lib/yum/repos/x86_64/7Server/rhel7/gpgdir
gpgkey =
hdrdir = /var/cache/yum/x86_64/7Server/rhel7/headers
http_caching = all
includepkgs =
ip_resolve =
keepalive = True
keepcache = False
mddownloadpolicy = sqlite
mdpolicy = group:small
mediaid =
metadata_expire = 21600
metadata_expire_filter = read-only:present
metalink =
minrate = 0
mirrorlist =
mirrorlist_expire = 86400
name = rhel7
old_base_cache_dir =
password =
persistdir = /var/lib/yum/repos/x86_64/7Server/rhel7
pkgdir = /var/cache/yum/x86_64/7Server/rhel7/packages
proxy = False
proxy_dict =
proxy_password =
proxy_username =
repo_gpgcheck = False
retries = 10
skip_if_unavailable = False
ssl_check_cert_permissions = True
sslcacert =
sslclientcert =
sslclientkey =
sslverify = True
throttle = 0
timeout = 30.0
ui_id = rhel7
ui_repoid_vars = releasever,
   basearch
username =

[root@localhost Packages]# yum repolist all
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
rhel7                                                                                                  | 2.9 kB  00:00:00
rhel7/primary_db                                                                                       | 3.4 MB  00:00:00
repo id                                                  repo name                                              status
rhel7                                                    rhel7                                                  enabled: 4,305
repolist: 4,305
[root@localhost Packages]#

Install the Perl module

Unable to install a perl module and through below error: Looking for CPAN mirrors near you (please be patient) Can't locate Time/HiR...