Ansible’s main goals are simplicity and ease-of-use.

usage of OpenSSH for transport with other transports and pull modes as alternatives

Ansible manages machines in an agent-less manner.

If needed, Ansible can easily connect with Kerberos, LDAP, and other centralized authentication management systems.



Ansible is an agentless automation tool that by default manages machines over the SSH protocol. Once installed, Ansible does not add a database, and there will be no daemons to start or keep running. You only need to install it on one machine and it can manage an entire fleet of remote machines from that central point. When Ansible manages remote machines, it does not leave software installed or running on them, so there’s no real question about how to upgrade Ansible when moving to a new version.

  • Prerequisites (安装要求)

    • Control node requirements (控制节点)

      • Currently Ansible can be run from any machine with Python 2 (version 2.7) or Python 3 (versions 3.5 and higher) installed. This includes Red Hat, Debian, CentOS, macOS, any of the BSDs, and so on. Windows is not supported for the control node.
    • Managed node requirements (被控节点)

      • On the managed nodes, you need a way to communicate, which is normally SSH. By default this uses SFTP. If that’s not available, you can switch to SCP in ansible.cfg. You also need Python 2 (version 2.6 or later) or Python 3 (version 3.5 or later).
  • 不同版本的Ansible对被控节点的python版本要求不一样

  • 如果被控节点上安装开启了SELinux,则需要额外在被控节点安装 libselinux-python

ansible默认认为被控节点的python路径在 /usr/bin/python ,如果不是需要手动调整,常见相关报错如下

"module_stdout": "/bin/sh: /usr/bin/python: No such file or directory\r\n"


  • Installing Ansible on RHEL, CentOS, or Fedora
    • yum 安装方式
    • 编译自己的rpm包
  • Installing Ansible on Ubuntu
  • Installing Ansible on Debian
  • Installing Ansible on Gentoo with portage
  • Installing Ansible on FreeBSD
  • Installing Ansible on macOS
  • Installing Ansible on Solaris
  • Installing Ansible on Arch Linux
  • Installing Ansible on Slackware Linux
  • Installing Ansible on Clear Linux
  • Installing Ansible with pip
    • 为避免干扰 最好安装在virtualenv里
  • Running Ansible from source (devel)
  • Finding tarballs of tagged releases
  • Ansible command shell completion
    • 命令自动补全
  • Ansible on GitHub

This topic describes how to control Ansible settings.

Certain settings in Ansible are adjustable via a configuration file (ansible.cfg).

If installing Ansible from a package manager, the latest ansible.cfg file should be present in /etc/ansible, possibly as a .rpmnew file (or other) as appropriate in the case of updates.

Starting with Ansible version 2.4, you can use the ansible-config command line utility to list your available options and inspect the current values.

Ansible also allows configuration of settings using environment variables. If these environment variables are set, they will override any setting loaded from the configuration file.

Not all configuration options are present in the command line, just the ones deemed most useful or common. Settings in the command line will override those passed through the configuration file and the environment.

配置文件设置优先级 Command line options << Environmental configuration << Configuration file


porting 在计算机英语中是 移植 的含义