ANSIBLE SERVER CENTOS 7 LIVE

[liveuser@localhost ~]$ sudo su - root

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[root@localhost ~]# yum install ansible*
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.mirrors.estointernet.in
 * extras: centos.mirrors.estointernet.in
 * updates: centos.mirrors.estointernet.in
Resolving Dependencies
--> Running transaction check
---> Package ansible.noarch 0:2.4.2.0-2.el7 will be installed
--> Processing Dependency: sshpass for package: ansible-2.4.2.0-2.el7.noarch
--> Processing Dependency: python2-jmespath for package: ansible-2.4.2.0-2.el7.noarch
--> Processing Dependency: python-passlib for package: ansible-2.4.2.0-2.el7.noarch
--> Processing Dependency: python-paramiko for package: ansible-2.4.2.0-2.el7.noarch
--> Processing Dependency: python-jinja2 for package: ansible-2.4.2.0-2.el7.noarch
--> Processing Dependency: python-httplib2 for package: ansible-2.4.2.0-2.el7.noarch
---> Package ansible-doc.noarch 0:2.4.2.0-2.el7 will be installed
--> Running transaction check
---> Package python-httplib2.noarch 0:0.9.2-1.el7 will be installed
---> Package python-jinja2.noarch 0:2.7.2-3.el7_6 will be installed
--> Processing Dependency: python-babel >= 0.8 for package: python-jinja2-2.7.2-3.el7_6.noarch
--> Processing Dependency: python-markupsafe for package: python-jinja2-2.7.2-3.el7_6.noarch
---> Package python-paramiko.noarch 0:2.1.1-9.el7 will be installed
---> Package python-passlib.noarch 0:1.6.5-2.el7 will be installed
---> Package python2-jmespath.noarch 0:0.9.0-3.el7 will be installed
---> Package sshpass.x86_64 0:1.06-2.el7 will be installed
--> Running transaction check
---> Package python-babel.noarch 0:0.9.6-8.el7 will be installed
---> Package python-markupsafe.x86_64 0:0.11-10.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================
 Package                   Arch           Version                Repository       Size
=======================================================================================
Installing:
 ansible                   noarch         2.4.2.0-2.el7          extras          7.6 M
 ansible-doc               noarch         2.4.2.0-2.el7          extras          763 k
Installing for dependencies:
 python-babel              noarch         0.9.6-8.el7            base            1.4 M
 python-httplib2           noarch         0.9.2-1.el7            extras          115 k
 python-jinja2             noarch         2.7.2-3.el7_6          updates         518 k
 python-markupsafe         x86_64         0.11-10.el7            base             25 k
 python-paramiko           noarch         2.1.1-9.el7            updates         269 k
 python-passlib            noarch         1.6.5-2.el7            extras          488 k
 python2-jmespath          noarch         0.9.0-3.el7            extras           39 k
 sshpass                   x86_64         1.06-2.el7             extras           21 k

Transaction Summary
=======================================================================================
Install  2 Packages (+8 Dependent packages)

Total download size: 11 M
Installed size: 53 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/extras/packages/python-httplib2-0.9.2-1.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for python-httplib2-0.9.2-1.el7.noarch.rpm is not installed
(1/10): python-httplib2-0.9.2-1.el7.noarch.rpm                  | 115 kB  00:00:01   
Public key for python-jinja2-2.7.2-3.el7_6.noarch.rpm is not installedkB  --:--:-- ETA
(2/10): python-jinja2-2.7.2-3.el7_6.noarch.rpm                  | 518 kB  00:00:01   
(3/10): ansible-doc-2.4.2.0-2.el7.noarch.rpm                    | 763 kB  00:00:01   
Public key for python-babel-0.9.6-8.el7.noarch.rpm is not installed
(4/10): python-babel-0.9.6-8.el7.noarch.rpm                     | 1.4 MB  00:00:02   
(5/10): python-paramiko-2.1.1-9.el7.noarch.rpm                  | 269 kB  00:00:00   
(6/10): python-passlib-1.6.5-2.el7.noarch.rpm                   | 488 kB  00:00:00   
(7/10): python-markupsafe-0.11-10.el7.x86_64.rpm                |  25 kB  00:00:00   
(8/10): python2-jmespath-0.9.0-3.el7.noarch.rpm                 |  39 kB  00:00:00   
(9/10): sshpass-1.06-2.el7.x86_64.rpm                           |  21 kB  00:00:00   
(10/10): ansible-2.4.2.0-2.el7.noarch.rpm                       | 7.6 MB  00:00:04   
---------------------------------------------------------------------------------------
Total                                                     2.1 MB/s |  11 MB  00:05   
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-6.1810.2.el7.centos.x86_64 (@base/$releasever)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : python-httplib2-0.9.2-1.el7.noarch                                 1/10
  Installing : sshpass-1.06-2.el7.x86_64                                          2/10
  Installing : python-babel-0.9.6-8.el7.noarch                                    3/10
  Installing : python-paramiko-2.1.1-9.el7.noarch                                 4/10
  Installing : python2-jmespath-0.9.0-3.el7.noarch                                5/10
  Installing : python-passlib-1.6.5-2.el7.noarch                                  6/10
  Installing : python-markupsafe-0.11-10.el7.x86_64                               7/10
  Installing : python-jinja2-2.7.2-3.el7_6.noarch                                 8/10
  Installing : ansible-2.4.2.0-2.el7.noarch                                       9/10
  Installing : ansible-doc-2.4.2.0-2.el7.noarch                                  10/10
  Verifying  : python-markupsafe-0.11-10.el7.x86_64                               1/10
  Verifying  : ansible-doc-2.4.2.0-2.el7.noarch                                   2/10
  Verifying  : python-passlib-1.6.5-2.el7.noarch                                  3/10
  Verifying  : python2-jmespath-0.9.0-3.el7.noarch                                4/10
  Verifying  : python-paramiko-2.1.1-9.el7.noarch                                 5/10
  Verifying  : python-babel-0.9.6-8.el7.noarch                                    6/10
  Verifying  : ansible-2.4.2.0-2.el7.noarch                                       7/10
  Verifying  : python-jinja2-2.7.2-3.el7_6.noarch                                 8/10
  Verifying  : sshpass-1.06-2.el7.x86_64                                          9/10
  Verifying  : python-httplib2-0.9.2-1.el7.noarch                                10/10

Installed:
  ansible.noarch 0:2.4.2.0-2.el7           ansible-doc.noarch 0:2.4.2.0-2.el7         

Dependency Installed:
  python-babel.noarch 0:0.9.6-8.el7         python-httplib2.noarch 0:0.9.2-1.el7     
  python-jinja2.noarch 0:2.7.2-3.el7_6      python-markupsafe.x86_64 0:0.11-10.el7   
  python-paramiko.noarch 0:2.1.1-9.el7      python-passlib.noarch 0:1.6.5-2.el7     
  python2-jmespath.noarch 0:0.9.0-3.el7     sshpass.x86_64 0:1.06-2.el7             

Complete!
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.45.141  netmask 255.255.255.0  broadcast 192.168.45.255
        inet6 fe80::8a2d:10ff:6799:e8f8  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:82:f1:27  txqueuelen 1000  (Ethernet)
        RX packets 20174  bytes 29197435 (27.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5622  bytes 350429 (342.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 70  bytes 5600 (5.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 70  bytes 5600 (5.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost ~]# service sshd status
Redirecting to /bin/systemctl status sshd.service
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:sshd(8)
           man:sshd_config(5)
[root@localhost ~]# service sshd start
Redirecting to /bin/systemctl start sshd.service
[root@localhost ~]# chkconfig sshd on
Note: Forwarding request to 'systemctl enable sshd.service'.
Created symlink from /etc/systemd/system/multi-user.target.wants/sshd.service to /usr/lib/systemd/system/sshd.service.
[root@localhost ~]# passwd
Changing password for user root.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
[

[root@localhost ~]# yum install openssh*
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.mirrors.estointernet.in
 * extras: centos.mirrors.estointernet.in
 * updates: centos.mirrors.estointernet.in
Package openssh-server-7.4p1-16.el7.x86_64 already installed and latest version
Package openssh-7.4p1-16.el7.x86_64 already installed and latest version
Package openssh-clients-7.4p1-16.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package openssh-askpass.x86_64 0:7.4p1-16.el7 will be installed
---> Package openssh-cavs.x86_64 0:7.4p1-16.el7 will be installed
---> Package openssh-keycat.x86_64 0:7.4p1-16.el7 will be installed
---> Package openssh-ldap.x86_64 0:7.4p1-16.el7 will be installed
---> Package openssh-server-sysvinit.x86_64 0:7.4p1-16.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================
 Package                        Arch          Version                Repository   Size
=======================================================================================
Installing:
 openssh-askpass                x86_64        7.4p1-16.el7           base         76 k
 openssh-cavs                   x86_64        7.4p1-16.el7           base        229 k
 openssh-keycat                 x86_64        7.4p1-16.el7           base         96 k
 openssh-ldap                   x86_64        7.4p1-16.el7           base        112 k
 openssh-server-sysvinit        x86_64        7.4p1-16.el7           base         71 k

Transaction Summary
=======================================================================================
Install  5 Packages

Total download size: 585 k
Installed size: 645 k
Is this ok [y/d/N]: y
Downloading packages:
(1/5): openssh-keycat-7.4p1-16.el7.x86_64.rpm                   |  96 kB  00:00:00   
(2/5): openssh-ldap-7.4p1-16.el7.x86_64.rpm                     | 112 kB  00:00:00   
(3/5): openssh-askpass-7.4p1-16.el7.x86_64.rpm                  |  76 kB  00:00:00   
(4/5): openssh-server-sysvinit-7.4p1-16.el7.x86_64.rpm          |  71 kB  00:00:00   
(5/5): openssh-cavs-7.4p1-16.el7.x86_64.rpm                     | 229 kB  00:00:00   
---------------------------------------------------------------------------------------
Total                                                     643 kB/s | 585 kB  00:00   
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : openssh-ldap-7.4p1-16.el7.x86_64                                    1/5
  Installing : openssh-server-sysvinit-7.4p1-16.el7.x86_64                         2/5
  Installing : openssh-askpass-7.4p1-16.el7.x86_64                                 3/5
  Installing : openssh-keycat-7.4p1-16.el7.x86_64                                  4/5
  Installing : openssh-cavs-7.4p1-16.el7.x86_64                                    5/5
  Verifying  : openssh-cavs-7.4p1-16.el7.x86_64                                    1/5
  Verifying  : openssh-keycat-7.4p1-16.el7.x86_64                                  2/5
  Verifying  : openssh-askpass-7.4p1-16.el7.x86_64                                 3/5
  Verifying  : openssh-server-sysvinit-7.4p1-16.el7.x86_64                         4/5
  Verifying  : openssh-ldap-7.4p1-16.el7.x86_64                                    5/5

Installed:
  openssh-askpass.x86_64 0:7.4p1-16.el7           openssh-cavs.x86_64 0:7.4p1-16.el7 
  openssh-keycat.x86_64 0:7.4p1-16.el7            openssh-ldap.x86_64 0:7.4p1-16.el7 
  openssh-server-sysvinit.x86_64 0:7.4p1-16.el7 

Complete!
[root@localhost ~]# ssh-copy-id root@192.168.45.142

/bin/ssh-copy-id: ERROR: failed to open ID file '/root/.pub': No such file or directory
(to install the contents of '/root/.pub' anyway, look at the -f option)
[root@localhost ~]# service sshd restart
Restarting sshd (via systemctl):                           [  OK  ]
[root@localhost ~]# ssh-copy-id root@192.168.45.142

/bin/ssh-copy-id: ERROR: failed to open ID file '/root/.pub': No such file or directory
(to install the contents of '/root/.pub' anyway, look at the -f option)
[root@localhost ~]# ssh-copy-id 192.168.45.142

/bin/ssh-copy-id: ERROR: failed to open ID file '/root/.pub': No such file or directory
(to install the contents of '/root/.pub' anyway, look at the -f option)
[root@localhost ~]# ssh-copy-id
Usage: /bin/ssh-copy-id [-h|-?|-f|-n] [-i [identity_file]] [-p port] [[-o <ssh -o options>] ...] [user@]hostname
-f: force mode -- copy keys without trying to check if they are already installed
-n: dry run    -- no keys are actually copied
-h|-?: print this help
[root@localhost ~]# ssh-copy-id 192.168.45.141

/bin/ssh-copy-id: ERROR: failed to open ID file '/root/.pub': No such file or directory
(to install the contents of '/root/.pub' anyway, look at the -f option)
[root@localhost ~]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:hW3tnkBfjoWChzWwyrkrAStUW8Z4DMVLFNZPXA6O1kM root@localhost
The key's randomart image is:
+---[RSA 2048]----+
|   .O=o oE+.     |
|   o.O .=Xoo .   |
|  . * .oB+B.o o  |
| ... o.o *.+ =   |
|.  o  + S . + .  |
|. . .  .   o .   |
| .   ..     o    |
|    .  .         |
|     ..          |
+----[SHA256]-----+
[root@localhost ~]# ssh-copy-id 192.168.45.141
/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '192.168.45.141 (192.168.45.141)' can't be established.
ECDSA key fingerprint is SHA256:rA7kTGM4/Hy8WcbMPjVQ5Xa6mxSmIaPrHYRqeJazWdQ.
ECDSA key fingerprint is MD5:fb:61:32:71:48:c0:1e:8a:a4:df:3c:12:87:8a:4e:7b.
Are you sure you want to continue connecting (yes/no)? yes
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.45.141's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '192.168.45.141'"
and check to make sure that only the key(s) you wanted were added.


[root@localhost ~]# ansible localhost -m ping
 [WARNING]: Could not match supplied host pattern, ignoring: all

 [WARNING]: provided hosts list is empty, only localhost is available

localhost | SUCCESS => {
    "changed": false,
    "ping": "pong"
}

[root@localhost ~]# service firewalld status
Redirecting to /bin/systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-08-21 12:50:33 UTC; 33min ago
     Docs: man:firewalld(1)
 Main PID: 7022 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─7022 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Aug 21 12:50:28 localhost systemd[1]: Starting firewalld - dynamic firewall daemon...
Aug 21 12:50:33 localhost systemd[1]: Started firewalld - dynamic firewall daemon.
[root@localhost ~]# service firewalld stop
Redirecting to /bin/systemctl stop firewalld.service
[root@localhost ~]# chkconfig firewalld off
Note: Forwarding request to 'systemctl disable firewalld.service'.
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.


[root@localhost ~]# service network restart
Restarting network (via systemctl):                        [  OK  ]


[root@localhost ~]# ssh-copy-id 192.168.45.142
/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '192.168.45.142 (192.168.45.142)' can't be established.
ECDSA key fingerprint is SHA256:IlFpuumB2+m4aRihyDGWkoQnVGSrK2wfzsW5YSpfn6g.
ECDSA key fingerprint is MD5:28:92:12:eb:02:e9:b2:9c:1c:0a:52:05:e7:96:31:7b.
Are you sure you want to continue connecting (yes/no)? yes
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.45.142's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '192.168.45.142'"
and check to make sure that only the key(s) you wanted were added.


[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
[
[root@localhost ~]# ssh 192.168.45.142
Enter passphrase for key '/root/.ssh/id_rsa':
Last login: Wed Aug 21 13:15:29 2019
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.45.142  netmask 255.255.255.0  broadcast 192.168.45.255
        inet6 fe80::be3e:647f:728a:936  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:10:52:ce  txqueuelen 1000  (Ethernet)
        RX packets 20772  bytes 29362199 (28.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6967  bytes 455656 (444.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 70  bytes 5600 (5.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 70  bytes 5600 (5.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost ~]# ansible localhost -m ping
 [WARNING]: Could not match supplied host pattern, ignoring: all

 [WARNING]: provided hosts list is empty, only localhost is available

localhost | SUCCESS => {
    "changed": false,
    "ping": "pong"

[root@localhost ~]# ssh 192.168.45.141
Enter passphrase for key '/root/.ssh/id_rsa':
Last failed login: Wed Aug 21 13:02:24 UTC 2019 from 192.168.45.140 on ssh:notty
There was 1 failed login attempt since the last successful login.
Last login: Wed Aug 21 12:58:33 2019
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.45.141  netmask 255.255.255.0  broadcast 192.168.45.255
        inet6 fe80::8a2d:10ff:6799:e8f8  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:82:f1:27  txqueuelen 1000  (Ethernet)
        RX packets 21933  bytes 29962942 (28.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6439  bytes 453549 (442.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 166  bytes 23806 (23.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 166  bytes 23806 (23.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.45.141  netmask 255.255.255.0  broadcast 192.168.45.255
        inet6 fe80::8a2d:10ff:6799:e8f8  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:82:f1:27  txqueuelen 1000  (Ethernet)
        RX packets 22135  bytes 29983167 (28.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6604  bytes 471554 (460.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 166  bytes 23806 (23.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 166  bytes 23806 (23.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
[root@localhost ~]# ssh-copy-id root@192.168.45.142
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
Enter passphrase for key '/root/.ssh/id_rsa':

/usr/bin/ssh-copy-id: WARNING: All keys were skipped because they already exist on the remote system.
(if you think this is a mistake, you may want to use -f option)

[root@localhost ~]# ansible 192.168.45.142 -m ping
 [WARNING]: Could not match supplied host pattern, ignoring: all

 [WARNING]: provided hosts list is empty, only localhost is available

 [WARNING]: Could not match supplied host pattern, ignoring: 192.168.45.142

 [WARNING]: No hosts matched, nothing to do

[root@localhost ~]# ansible 192.168.45.141 -m ping
 [WARNING]: Could not match supplied host pattern, ignoring: all

 [WARNING]: provided hosts list is empty, only localhost is available

 [WARNING]: Could not match supplied host pattern, ignoring: 192.168.45.141

 [WARNING]: No hosts matched, nothing to do

[root@localhost ~]# vi /etc/ansible/hosts
[root@localhost ~]# vi /etc/ansible/hosts
[root@localhost ~]# ansible 192.168.45.141 -m ping
Enter passphrase for key '/root/.ssh/id_rsa':
192.168.45.141 | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
[root@localhost ~]# ansible 192.168.45.142 -m ping
Enter passphrase for key '/root/.ssh/id_rsa':
192.168.45.142 | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
[root@localhost ~]#



[root@localhost ~]# vi /etc/ansible/hosts

192.168.45.141
192.168.45.142

Comments

Popular posts from this blog

ansible redhat cluster qorum qdevice

PE 3.9.0 on centos 6

gfs2 cluster