Posts

Showing posts from April, 2015

Automate Installation of Perl and Sudo packages with Puppet

Image
Requirement I need to install 2 packages, perl and sudo, and also want to re-install if these go missing. Try to do this manually and you could realize the manual effort required. But the good news is you could completely automate this using Puppet. You could write a Puppet module for installing the packages on RHEL 6.4 and Ubuntu. Pre-requisite Puppet server Puppet client installed (You could find this article in my blog) RHEL 6.x Ubuntu 14.x Configure yum and apt-get repositories, very important. Setup DNS or simpley put your hosts in /etc/hosts file on all servers Hosts I have 2 client machines, one running RHEL 6.4 and other on Ubuntu 14. I already configured these as puppet clients to the puppet server and already signed their SSL certificates on the puppet server. 1. web 2. db You could configure you own hosts, in any numbers you need. Action! Create puppet module Directory structure for module files         ...

How to Install Web Server with MySQL database and PHP (Installing LAMP stack with puppet)

Requirement You want to install a Web Server alongwith MySQL database and the powerful and most famous PHP programming language, popularly known as a LAMP stack! Surely, you could do this manually by installing packages one by one for few machines. In case you have many machines to build with a LAMP stack, then use Puppet. I will show you how to do this build by automating using the powerful Puppet tool. Pre-requisite RHEL 6.4 YUM repository configured and working properly A working Puppet Server A working Puppet Client (there is an article I wrote in this blog) Start! On your puppet client follow below steps: # mkdir -p /etc/puppet/modules/lamp/manifests # vi /etc/puppet/modules/lamp/manifests/init.pp class lamp { # install httpd package package { 'httpd':   ensure => installed, } # ensure httpd service is running service { 'httpd':   ensure => running, } # install mysql-server package package { 'mysql-server':   ensure...

How to mount Windows shares in LINUX

    Requirement There is a share available in Windows server. The user wants to access it's files from a Linux machine. Windows Pre-requisite   Export the Windows folder. Assign a user and password for the associated Windows domain. Inform the Linux admin about these and the Windows domain name.  Enviromnent for this setup   Windows 2008 server Red Hat Enterprise Linux  6.4 Linux Configuration   Create a credential file having Windows username and the password. You could create /root/.secretfile and put below lines in it: username=user01 password=password01 You will replace the user and password with your actual contents provided by your Windows admin. Don't forget to set root only permissions for this secret file. # chmod 600 /root/.secretfile You are now ready to mount the Windows share.  Insert one line as shown below into your /etc/fstab: //hostname/Reports   ...

Collect LUN information from remote Windows servers

This is an odd article I am writing under a Linux blog! Oops! forgive me. Requirement You are assigned with a task to collect LUN information from hundreds of Windows servers. Do it Manually if you like Yes, if you have the time and patience you could surely go about it by collecting manually and you got it right, start logging in one-by-one on each server, 1st to 200th hundres for example, or make your life easy by using my script. You are smart, I knew it! Here's how to create the script. Download Psexec and copy to a jump server. You know that from a jump server  all your target servers are reachable, right. Prepare the script You will need to create 3 files, and all are simple text files you could use notepad for this. 1. Llist of your servers or IP addresses - serverlist.txt server0001 server0002 server0003 ... server1000 2. Type below 2 commands in this file and save it - script_win.bat hostname C:\"Program Files"\install...