Skip to main content

Posts

Showing posts from 2016

Install Centos using VMplayer

Here we will install centos 6. Redhat installation will be similar to centos Below are few steps. Step1: Open VMplayer and configure necessary settings (CPU,RAM, Disk etc) Step2: Installation of OS. Run the VM Step3: Once installation completes reboot the VM Step4: After system comes up check the IP address. Currenlty there no IP address assigned. We will check the config. IP adress is 192.168.111.128 - This is dynamic IP which means in next reboot server may have different IP. Step5: Create a static IP address for the server. We should know the gateway IP of the server and add it in eth0 config. Gateway IP is 192.168.111.2 Step6: We will reboot and check if IP address is same IP address is same. Step7: Now you can use this IP to connect the virtual machine from putty (Host Machine) Step8: Thats All. Hope you liked this. Thanks

connect: Network is unreachable

connect: Network is unreachable If you are getting below error, then probably you have not added gateway address or you have incorrect gateway in config file. [root@cluster ~]# ping google.com connect: Network is unreachable Before: [root@cluster ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth3 DEVICE=eth3 TYPE=Ethernet ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=static IPADDR=192.168.174.130 NETMASK=255.255.255.0 After: [root@cluster ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth3 DEVICE=eth3 TYPE=Ethernet ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=static IPADDR=192.168.174.130 NETMASK=255.255.255.0 GATEWAY=192.168.174.2 [root@cluster ~]# ifdown eth3 [root@cluster ~]# ifup eth3 Determining if ip address 192.168.174.130 is already in use for device eth3... [root@cluster ~]# ping google.com PING google.com (216.58.218.174) 56(84) bytes of data. 64 bytes from dfw06s46-in-f14.1e100.net (216.58.218.174): icmp_seq=1 ttl=128 time=261 ms 6

Ansible script to stop iptables

 Ansible script to stop iptables and disable during boot Step 1. [root@cluster playbooks]# pwd /root/playbooks [root@cluster playbooks]# cat hosts [webservers] 169.254.41.221 169.254.41.222 Step2. [root@cluster playbooks]# cat iptables.yml --- - name: stop ipatbles and disable   hosts: webservers   tasks:   - name: stop iptables     service: name=iptables state=stopped   - name: disbale on iptable on boot     service: name=iptables enabled=no Step3: [root@cluster playbooks]# ansible-playbook iptables.yml PLAY [stop ipatbles and disable] *********************************************** TASK [setup] ******************************************************************* ok: [169.254.41.222] ok: [169.254.41.221] ok: [localhost] TASK [stop iptables] *********************************************************** changed: [localhost] ok: [169.254.41.221] ok: [169.254.41.222] TASK [disbale on iptable on boot] ********************************************** ok: [169.254.41.222] changed: [localhost

Ansible script to install httpd

Ansible script to install httpd package and enable httpd during boot. Step 1. [root@cluster playbooks]# pwd /root/playbooks [root@cluster playbooks]# cat hosts [webservers] 169.254.41.221 169.254.41.222 Step2. [root@cluster playbooks]# cat httpd.yml --- - name: Install httpd package and start the service   hosts: webservers   tasks:   - name: install httpd     yum: name=httpd update_cache=yes   - name: enable httpd on boot     service: name=httpd enabled=yes   - name: start the service     service: name=httpd state=started Step3. Run [root@cluster playbooks]# ansible-playbook httpd.yml Output: PLAY [Install httpd package and start the service] ***************************** TASK [setup] ******************************************************************* ok: [169.254.41.221] ok: [169.254.41.222] TASK [install httpd] *********************************************************** changed: [169.254.41.221] changed: [169.254.41.222] TASK [enable httpd on boot] ******************************