#apt安装

apt-get install software-properties-common
apt-add-repository ppa:ansible/ansible
apt-get update
apt-get install ansible

安装完成以后简单配置 inventory

vim /etc/ansible/hosts

[localip]
192.168.107.150 	ansible_ssh_private_key_file=/root/.ssh/id_rsa
[localhost]
localhost              ansible_connection=local

在命令行测试

root@ubuntu:~#  ansible all -m ping

 [WARNING]: Found both group and host with same name: localhost

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

相关文章:

  • 2021-10-10
  • 2021-12-03
  • 2021-12-05
  • 2021-07-24
  • 2021-09-30
  • 2021-11-17
  • 2021-09-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案