Ethernet Port Details

Below post will help you know how to find out available ethernet ports on server and which one is mapped to your IP. 


[root@Server network-scripts]# cat ifcfg-eth[01234567] | grep -i HWADDR
HWADDR=A0:36:9F:46:24:1C
HWADDR=A0:36:9F:46:24:1D
HWADDR=A0:36:9F:46:24:1E
HWADDR=A0:36:9F:46:24:1F
HWADDR=98:BE:94:3C:FD:AA
HWADDR=98:BE:94:3C:FD:AB
HWADDR=98:BE:94:3C:FD:AC
HWADDR=98:BE:94:3C:FD:AD

[root@Server network-scripts]# lspci | grep -i ethernet
06:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
06:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
06:00.2 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
06:00.3 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
20:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
20:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
20:00.2 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
20:00.3 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)

[root@Server network-scripts]# for i in {0..7}
> do
> ethtool -i eth$i | grep -i bus-info
> done
bus-info: 0000:20:00.0
bus-info: 0000:20:00.1
bus-info: 0000:20:00.2
bus-info: 0000:20:00.3
bus-info: 0000:06:00.0
bus-info: 0000:06:00.1
bus-info: 0000:06:00.2
bus-info: 0000:06:00.3

[root@Server network-scripts]# ip link show up | grep eth*
6: eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 98:be:94:3c:fd:aa brd ff:ff:ff:ff:ff:ff
    link/ether 9a:be:94:3c:fd:a9 brd ff:ff:ff:ff:ff:ff
[root@Server network-scripts]#

DNS Server Configuration


Below steps were executed on real server. I have mentioned only the important commands/entries required to setup DNS server. In this scenario, there is only 1 client is configured to test the setup. 


[root@server etc]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=server.example.com


[root@server etc]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.0.10 server.example.com server
192.168.0.12 client1.example.com client1

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


#cat named.conf
options {
        listen-on port 53 { 127.0.0.1; 192.168.0.10;};
        #listen-on-v6 port 53 { ::1; };


allow-query     { any;};


include "/etc/named.rfc1912.zones";
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#cat /etc/named.rfc1912.zones

zone "example.com" IN {
        type master;
        file "forward.zone";
        allow-update { none; };
};

zone "0.168.192.in-addr.arpa" IN {
        type master;
        file "reverse.zone";
        allow-update { none; };

};

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#cd /var/named

[root@server named]# cat forward.zone
$TTL 1D
@       IN SOA  server.example.com. root.server.example.com. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        IN NS   server.example.com.
server  IN A    192.168.0.10
client1 IN A    192.168.0.12
[root@server named]# cat reverse.zone
$TTL 1D
@       IN SOA  server.example.com. root.server.example.com. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        IN NS   server.example.com.
10      IN PTR  server.example.com.
12      IN PTR  client1.example.com.

X11 Setup with SSH Linux


PROCESS OVERVIEW:

In order to obtain the ability to interact with an X11 GUI remotely, we will follow these general steps:
  1. Ensure that the foundational X11 packages are installed
  2. Ensure that OpenSSH server is configured to forward X11 connections
  3. Configure a local X11 server on our workstation (You can use MobaXterm too)
  4. Configure our ssh application to forward X11 requests ( I'll use MobaXterm, however, Xming can also be installed at local machine.)
  5. Test with a simple application
  6. Configured authentication if user changes are needed.


1. # yum install xorg-x11-xauth xterm xorg-x11-apps -y

2. # cat /etc/ssh/sshd_config | grep -i X11
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no

# service sshd restart
Redirecting to /bin/systemctl restart sshd.service

3. Xming  or MobaXterm need to be installed on the workstation.

4. Try to connect the server by mentioning the hostname on MobaXterm. However, for putty you need to check "X11 forwarding" under SSH settings.


5# /usr/bin/xauth
Using authority file /root/.Xauthority
xauth> exit

#xclock
#xeyes

From Putty: We need to set the display as below:

# xauth list
server:10  MIT-MAGIC-COOKIE-1  5a5f2e0832b24f8c3391614cec512363
# export DISPLAY=server:10
# xclock
Warning: Missing charsets in String to FontSet conversion


6. Suppose We need to run the X11 for a particular user - webadmin

[root@server~]# su - webadmin
Last login: Mon Sep  9 14:59:35 IST 2019 from vp-1c2oadc062.1dc.com on pts/0
[webadmin@server~]$ xclock
Error: Can't open display:
[webadmin@server~]$ xauth list
xauth:  file /home/webadmin/.Xauthority does not exist

# cp .Xauthority /home/webadmin/  (from root)
#chown webadmin:webadmin /home/webadmin/.Xauthority (from root)
#[webadmin@server~]$ xauth
Using authority file /home/webadmin/.Xauthority
xauth> exit

[webadmin@server~]$ xauth list
server:10  MIT-MAGIC-COOKIE-1  8d2414ef1216a5ef3b276866c490311c
export DISPLAY=server:10
[webadmin@lipvap1077 ~]$ xclock
Warning: Missing charsets in String to FontSet conversion
[webadmin@lipvap1077 ~]$




Rescue Mode Recovery


Series of commands executed for OS recovery in rescue mode for RHEL 7.6


Scenario: After installing VMWare tools, the kernel got corrupted and not was not booting through old kernel images. In rescue mode, I was unable to see the root partition mounted inside /mnt/sysimage. Later I found out all the VGs were deactivated. Hence, ran vgchange in rescue mode to enable all the VGs. Please go through the commands, in case of any confusion or if you need clarity regarding command, please leave a comment.. I'll surely get back to you.

Pre-requisites: Please mount the ISO image of the required OS and boot it from CD/DVD ROM and not from disk.

#blkid
#lvs
#pvs
#vgs
#vgchange -ay
#mount
#mount <root-partion> /mnt/sysimage
#lvs
#vgs
#lvm lvdisplay
#chroot /mnt/sysimage
#lvm lvdisplay
#lvm display | more
#mkdir /mnt/sysimage/var
#ls /mmnt/sysimage/
#mount /dev/rootvg/var /mnt/sysimage/var

Same for usr
usr

#Even I found the /mnt/sysimage/etc/fstab is blank, hence I populated the entries so that the OS comes up in normal boot. Open the fstab file in vi editor run r!blkid in command mode, it will import all the block devices, just compare with a relevant working server and keep the required entries. 



#lvm lvdipslay | grep "LV Path"
#mount /dev/rootvg/tmp /mnt/sysimage/tmp
#mount
#cat /etc/fstab
exit
#cat /mnt/sysimage/etc/fstab
#ifconfig
#cat message | tail -200 | more
#df -h
#cat /etc/selinux/config
#cat /etc/fstab


Learning Ansible : PART 3

Services: apache2_module, handlers, notify:


apache2_module: Enables or disables a specified module of the Apache2 webserver.


Handler are tasks that are defined in a playbook and can be called by the notify property in case of state change during task execution.



[root@licvdo1000 ansible]# cat webcomponents.yml
---
 - hosts: testserver
   become: true
   tasks:
     - name: install web components
       yum: name={{item}} state=latest update_cache=yes
       with_items:
       - httpd
       - mod_wsgi
       - python2-pip
       - python-virtualenv
     - name: ensure httpd is running
       service: name=httpd state=started enabled=yes
     - name: ensure mod_wsgi enabled
       apache2_module: state=present name=wsgi
       notify: restart httpd

   handlers:
       - name: restart httpd
         service: name=httpd state=restarted



[root@licvdo1000 ansible]# ansible-playbook webcomponents.yml

PLAY [testserver] **********************************************************************************************

TASK [Gathering Facts] *****************************************************************************************
ok: [licvdo1001]

TASK [install web components] **********************************************************************************
[DEPRECATION WARNING]: Invoking "yum" only once while using a loop via squash_actions is deprecated. Instead of
 using a loop to supply multiple items and specifying `name: "{{item}}"`, please use `name: ['httpd',
'mod_wsgi', 'python2-pip', 'python-virtualenv']` and remove the loop. This feature will be removed in version
2.11. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
changed: [licvdo1001] => (item=[u'httpd', u'mod_wsgi', u'python2-pip', u'python-virtualenv'])

TASK [ensure httpd is running] *********************************************************************************
ok: [licvdo1001]

TASK [ensure mod_wsgi enabled] *********************************************************************************
ok: [licvdo1001]

PLAY RECAP *****************************************************************************************************
licvdo1001                 : ok=4    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0


Copy Module:


It is used to copy a file from the control machine to the target machine. 


[root@licvdo1000 ansible]# cat webserver.yml
---
 - hosts: testserver
   become: true
   tasks:
     - name: install webserver
       yum: name=httpd state=latest update_cache=yes
     - name: ensure httpd is running
       service: name=httpd state=started enabled=yes
     - name: copy demo html file
       copy: src=index.html dest=/var/www/html/index.html mode=0755
       notify: restart httpd

   handlers:
       - name: restart httpd
         service: name=httpd state=restarted


Before running the playbook, the URL is displaying the below webpage:



Now, We run this playbook and when We try to open the same URL, it should show the new page which is copied to the destination.

[root@licvdo1000 ansible]# ansible-playbook webserver.yml

PLAY [testserver] **********************************************************************************************

TASK [Gathering Facts] *****************************************************************************************
ok: [licvdo1001]

TASK [install webserver] ***************************************************************************************
ok: [licvdo1001]

TASK [ensure httpd is running] *********************************************************************************
ok: [licvdo1001]

TASK [copy demo html file] *************************************************************************************
changed: [licvdo1001]

RUNNING HANDLER [restart httpd] ********************************************************************************
changed: [licvdo1001]

PLAY RECAP *****************************************************************************************************
licvdo1001                 : ok=5    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0



Boom!!! We can see the new webpage which we have created.








Learning Ansible: PART 2

Writing and Executing Playbooks [Contd..]


There are several modules are available in ansible documentation. Please refer the below link and try to understand at-least the popular ones.

https://docs.ansible.com/ansible/latest/modules/modules_by_category.html

Installing a package on testserver group

[root@licvdo1000 ansible]# cat testserver.yml
---
- hosts: testserver
  tasks:
   - name: install nginx
     yum: name=nginx state=present update_cache=yes


[root@licvdo1001 ~]# rpm -q nginx
package nginx is not installed

[root@licvdo1000 ansible]# ansible-playbook testserver.yml

PLAY [testserver] ********************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************
ok: [licvdo1001]

TASK [install nginx] *****************************************************************************************************************************************

changed: [licvdo1001]

PLAY RECAP ***************************************************************************************************************************************************
licvdo1001                 : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0


[root@licvdo1001 ~]# rpm -q nginx
nginx-1.12.2-3.el7.x86_64


Using jinja in your playbooks: {{with_items}}


Note: Invoking "yum" only once while using a loop via squash_actions is deprecated. Instead of using a loop to supply multiple items and specifying `name: "{{item}}"`, please use `name: ['pkg1', 'pkg2', 'pkg3']` and remove the loop. This feature will be removed in version 2.11.

Here "with_items" is used to refer multiple package names in a single "yum" statement. It can be referred as loop as we use in conventional programming languages.

[root@licvdo1000 ansible]# cat webcomponents.yml
---
 - hosts: testserver
   become: true
   tasks:
     - name: install web components
       yum: name={{item}} state=latest update_cache=yes
       with_items:
       - httpd
       - python2-pip
       - python-virtualenv



[root@licvdo1000 ansible]# ansible-playbook webcomponents.yml

PLAY [testserver] **********************************************************************************************

TASK [Gathering Facts] *****************************************************************************************
ok: [licvdo1001]

TASK [install web components] **********************************************************************************
[DEPRECATION WARNING]: Invoking "yum" only once while using a loop via squash_actions is deprecated. Instead of
 using a loop to supply multiple items and specifying `name: "{{item}}"`, please use `name: ['httpd', 'python-
pip', 'python-virtualenv']` and remove the loop. This feature will be removed in version 2.11. Deprecation
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
changed: [licvdo1001] => (item=[u'httpd', u'python-pip', u'python-virtualenv'])

PLAY RECAP *****************************************************************************************************
licvdo1001                 : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0


Use of Service Module in Ansible playbook:


[root@licvdo1000 ansible]# cat webcomponents.yml
---
 - hosts: testserver
   become: true
   tasks:
     - name: install web components
       yum: name={{item}} state=latest update_cache=yes
       with_items:
       - httpd
       - python2-pip
       - python-virtualenv
     - name: ensure httpd is running
       service: name=httpd state=started enabled=yes
[root@licvdo1000 ansible]# ansible-playbook webcomponents.yml

PLAY [testserver] **********************************************************************************************

TASK [Gathering Facts] *****************************************************************************************
ok: [licvdo1001]

TASK [install web components] **********************************************************************************
[DEPRECATION WARNING]: Invoking "yum" only once while using a loop via squash_actions is deprecated. Instead of
 using a loop to supply multiple items and specifying `name: "{{item}}"`, please use `name: ['httpd',
'python2-pip', 'python-virtualenv']` and remove the loop. This feature will be removed in version 2.11.
Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [licvdo1001] => (item=[u'httpd', u'python2-pip', u'python-virtualenv'])

TASK [ensure httpd is running] *********************************************************************************
ok: [licvdo1001]

PLAY RECAP *****************************************************************************************************
licvdo1001                 : ok=3    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0


[root@licvdo1000 ansible]# cat loadbalancer.yml
---
- hosts: testserver
  tasks:
   - name: install nginx
     yum: name=nginx state=present update_cache=yes
   - name: ensure nginx gets started and enabled
     service: name=nginx state=started enabled=yes

[root@licvdo1000 ansible]# ansible-playbook loadbalancer.yml

PLAY [testserver] **********************************************************************************************

TASK [Gathering Facts] *****************************************************************************************
ok: [licvdo1001]

TASK [install nginx] *******************************************************************************************
ok: [licvdo1001]

TASK [ensure nginx getss started and enabled] ******************************************************************
changed: [licvdo1001]

PLAY RECAP *****************************************************************************************************
licvdo1001                 : ok=3    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

[root@licvdo1000 ansible]#


Note: Earlier it failed with error "unable to start nginx.service, failed to bind port 80", as the TCP port  80 is occupied by httpd. So, for nginx I have changed the default port to 81 from 80 and boom.. it's started.


Learning Ansible: PART 1


Installing Ansible:



[root@licvdo1000 ~]# yum install ansible
[root@licvdo1000 ~]# ansible --version
ansible 2.8.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Nov  1 2018, 03:12:47) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36.0.1)]
[root@licvdo1000 ~]#
[root@licvdo1000 ~]#
[root@licvdo1000 ~]#
[root@licvdo1000 ~]#

Ansible Version Check:


[root@licvdo1000 ~]# ansible-playbook --version
ansible-playbook 2.8.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.5 (default, Nov  1 2018, 03:12:47) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36.0.1)]
[root@licvdo1000 ~]# ansible-galaxy --version
ansible-galaxy 2.8.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-galaxy
  python version = 2.7.5 (default, Nov  1 2018, 03:12:47) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36.0.1)]

Default Ansible Configuration:


[root@licvdo1000 ansible]# pwd
/etc/ansible
[root@licvdo1000 ansible]# more ansible.cfg
# config file for ansible -- https://ansible.com/
# ===============================================

# nearly all parameters can be overridden in ansible-playbook
# or with command line flags. ansible will read ANSIBLE_CONFIG,
# ansible.cfg in the current working directory, .ansible.cfg in
# the home directory or /etc/ansible/ansible.cfg, whichever it
# finds first

[defaults]

# some basic default values...

#inventory      = /etc/ansible/hosts
#library        = /usr/share/my_modules/
#module_utils   = /usr/share/my_module_utils/
#remote_tmp     = ~/.ansible/tmp
#local_tmp      = ~/.ansible/tmp
#plugin_filters_cfg = /etc/ansible/plugin_filters.yml
#forks          = 5
#poll_interval  = 15
#sudo_user      = root
#ask_sudo_pass = True
#ask_pass      = True
#transport      = smart
#remote_port    = 22
#module_lang    = C
#module_set_locale = False


[root@licvdo1000 ansible]# more hosts
# This is the default ansible 'hosts' file.
#
# It should live in /etc/ansible/hosts
#
#   - Comments begin with the '#' character
#   - Blank lines are ignored
#   - Groups of hosts are delimited by [header] elements
#   - You can enter hostnames or ip addresses
#   - A hostname/ip can be a member of multiple groups

# Ex 1: Ungrouped hosts, specify before any group headers.

## green.example.com
## blue.example.com
## 192.168.100.1
## 192.168.100.10

# Ex 2: A collection of hosts belonging to the 'webservers' group

## [webservers]
## alpha.example.org
## beta.example.org
## 192.168.1.100
## 192.168.1.110

# If you have multiple hosts following a pattern you can specify
# them like this:

## www[001:006].example.com

Creating your own configuration:


[root@licvdo1000 ansible]# pwd
/home/f776xb6/ansible
[root@licvdo1000 ansible]# ll
total 8
-rw-r--r--. 1 root root 59 Aug 16 12:04 ansible.cfg
-rw-r--r--. 1 root root 71 Aug 16 12:30 hosts
[root@licvdo1000 ansible]#

[root@licvdo1000 ansible]# cat ansible.cfg
[defaults]

inventory      = /home/f776xb6/ansible/hosts

[root@licvdo1000 ansible]# cat hosts
[testserver]
licvdo1001

[control]
licvdo1000 ansible_connection=local
[root@licvdo1000 ansible]#


Listing hosts from inventory and using wild characters:


[root@licvdo1000 ansible]# ansible --list-hosts all
  hosts (2):
    licvdo1000
    licvdo1001
[root@licvdo1000 ansible]# ansible --list-hosts '*'
  hosts (2):
    licvdo1000
    licvdo1001
[root@licvdo1000 ansible]# pwd
/home/f776xb6/ansible
[root@licvdo1000 ansible]# ansible --list-hosts testserver
  hosts (1):
    licvdo1001
[root@licvdo1000 ansible]# ansible --list-hosts licvdo1001
  hosts (1):
    licvdo1001
[root@licvdo1000 ansible]# ansible --list-hosts test*
  hosts (1):
    licvdo1001
[root@licvdo1000 ansible]# ansible --list-hosts testserver:control
  hosts (2):
    licvdo1001
    licvdo1000
[root@licvdo1000 ansible]# ansible --list-hosts testserver,control
  hosts (2):
    licvdo1001
    licvdo1000
[root@licvdo1000 ansible]# ansible --list-hosts testserver[1]
 [WARNING]: No hosts matched, nothing to do

  hosts (0):
[root@licvdo1000 ansible]# ansible --list-hosts testserver[0]
  hosts (1):
    licvdo1001
[root@licvdo1000 ansible]# ansible --list-hosts \!control
  hosts (1):
    licvdo1001
[root@licvdo1000 ansible]# ansible --list-hosts \!test*
  hosts (1):
    licvdo1000
[root@licvdo1000 ansible]#

Running Ad-hoc commands:


[root@licvdo1000 ansible]# ansible -m ping all
 [WARNING]: Platform linux on host licvdo1000 is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python
interpreter could change this. See https://docs.ansible.com/ansible/2.8/reference_appendices/interpreter_discovery.html for more information.

licvdo1000 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}
 [WARNING]: Platform linux on host licvdo1001 is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python
interpreter could change this. See https://docs.ansible.com/ansible/2.8/reference_appendices/interpreter_discovery.html for more information.

licvdo1001 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}
[root@licvdo1000 ansible]# ansible -m command -a "hostname" all
 [WARNING]: Platform linux on host licvdo1000 is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python
interpreter could change this. See https://docs.ansible.com/ansible/2.8/reference_appendices/interpreter_discovery.html for more information.

licvdo1000 | CHANGED | rc=0 >>
licvdo1000

 [WARNING]: Platform linux on host licvdo1001 is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python
interpreter could change this. See https://docs.ansible.com/ansible/2.8/reference_appendices/interpreter_discovery.html for more information.

licvdo1001 | CHANGED | rc=0 >>
licvdo1001

[root@licvdo1000 ansible]#


#### command is the default module ###############


[root@licvdo1000 ansible]# ansible -a "hostname" all
 [WARNING]: Platform linux on host licvdo1000 is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python
interpreter could change this. See https://docs.ansible.com/ansible/2.8/reference_appendices/interpreter_discovery.html for more information.

licvdo1000 | CHANGED | rc=0 >>
licvdo1000

 [WARNING]: Platform linux on host licvdo1001 is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python
interpreter could change this. See https://docs.ansible.com/ansible/2.8/reference_appendices/interpreter_discovery.html for more information.

licvdo1001 | CHANGED | rc=0 >>
licvdo1001

[root@licvdo1000 ansible]#


Writing and executing playbooks:


[root@licvdo1000 ansible]# cat hostname.yml
---
 - hosts: all
   tasks:
     - name : get server hostname
       command: hostname


[root@licvdo1000 ansible]# ansible-playbook hostname.yml

PLAY [all] ***************************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************
ok: [licvdo1000]
ok: [licvdo1001]

TASK [get server hostname] ***********************************************************************************************************************************
changed: [licvdo1000]
changed: [licvdo1001]

PLAY RECAP ***************************************************************************************************************************************************
licvdo1000                 : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
licvdo1001                 : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0


Installation of Jenkins on Linux and Deployment NGINX through Jenkins

Installation of Jenkins: [root@worker1 ~]# useradd -c "jenkins user" jenkins [root@worker1 ~]# passwd jenkins Changing passw...