1.

Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this. Please add this host's fingerprint to your known_hosts file to
manage this host.

解决方法:

export ANSIBLE_HOST_KEY_CHECKING=False

2. 如何生成user模块需要的password

python -c 'import crypt; print crypt.crypt("123456")'

3. 只指定一台主机执行

ansible -i '10.102.95.28,' all  --list-host

4. ansible手动指定密码

ansible -i '192.168.244.20,' all -m 'shell' -a 'df -h' -uroot -e "ansible_ssh_pass=123456"

5. ControlPersist自动登陆

#ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s

Ansible配置文件里面的选项,默认开启,这样,在60s内不用重复输入密码。SSH版本必须是5.6或以上版本才可使用ControlPersist特性。

6. 获取IP地址

hostvars[inventory_hostname]['ansible_default_ipv4']['address']

7. {"changed": false, "msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\"

# vim /etc/ansible/ansible.cfg
remote_tmp = /tmp

8. Timeout (12s) waiting for privilege escalation prompt

1. 带上-K参数

    -K, --ask-become-pass
ask for privilege escalation password

2. -c paramiko

https://github.com/ansible/ansible/issues/14426

最新文章

  1. javaScript基础语法(上)
  2. django 模板语法和三种返回方式
  3. 动画--问题追踪:ImageView执行缩放动画ScaleAnimation之后,图像显示不全的问题。
  4. C语言break和continue
  5. linux远程XP
  6. codevs3732 解方程
  7. [记录]ns_error_unexpected firefox tinymce
  8. C#敏感关键词过滤代码
  9. You don't have permission to access / on this server for debian_8
  10. C++ 虚函数机制学习
  11. SharePoint迁移数据到生产环境
  12. matlab 2014a 改为英文版本号
  13. HDU 4917 Permutation
  14. ACM 树形数组
  15. C语言之字符串
  16. # hadoop入门第六篇:Hive实例
  17. 局域网下访问其他计算机搭建的django网页
  18. 《剑指offer》两个链表中的第一个公共节点
  19. thinkphp5和thinkphp3.2.3中URL重写出现No input file specified
  20. 最简单的Spring Security配置示例

热门文章

  1. 爬取bilibili首页菜单获取li内容
  2. MongoDB系列---集合与文档操作03
  3. Java开发桌面程序学习(13)——Javafx多线程 下载功能
  4. MySQL 联表查询
  5. javascript构造函数深度克隆递归
  6. Java生鲜电商平台-Java后端生成Token架构与设计详解
  7. Python【day 15-3】函数部分
  8. node开发基础概念
  9. C++ 赋值运算符'='的重载(浅拷贝、深拷贝)
  10. Dynamics CRM 2015/2016新特性之三十三:有了ExecuteTransactionRequest,再也不用担心部分成功部分失败了