小程序页面之间进行传值的操作办法
1067
2022-10-10
ansible模块--ping模块
1.ssh等价性
[root@ansible ansible]# ssh-copy-id 192.168.56.88/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"The authenticity of host '192.168.56.88 (192.168.56.88)' can't be established.ECDSA key fingerprint is SHA256:kbb/xaKinLr3YzSaqvkSuYr2x4MgX50QhnIPvZH6bcI.ECDSA key fingerprint is MD5:67:a9:14:9d:8c:8b:35:8c:48:65:eb:ea:61:20:7b:92.Are you sure you want to continue connecting (yes/no)? yes/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keysroot@192.168.56.88's password: Number of key(s) added: 1Now try logging into the machine, with: "ssh '192.168.56.88'"and check to make sure that only the key(s) you wanted were added.
2.将IP加入/etc/ansible/hosts文件
[mysql]192.168.56.88
3.执行命令测试Ping模块
[root@ansible ansible]# ansible -i hosts mysql -m ping192.168.56.88 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "ping": "pong"}
4.指定IP ping
[root@ansible ansible]# ansible 192.168.56.88 -m ping192.168.56.88 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "ping": "pong"}
5.询问输入密码ping
[root@ansible ansible]# ansible 192.168.56.88 -m ping -kSSH password: xxxxxxxxx192.168.56.88 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "ping": "pong"}
-k参数: -K, —ask-become-pass ask for privilege escalation password
ansible
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~