ansible 自动化部署之 ansible 配置
第一步 :管理节点上安装ansible环境 略 第二步 :管理节点上配置 hosts文件 /etc/ansible/hosts testserver ansible_ssh_host=127.0.0.1 ansible_ssh_user=root targetserver ansible_ssh_host=192.168.137.4 ansible_ssh_user=root 第三步 :管理节点上配置 ansible.cfg touch /etc/ansible/ansible.cfg
inventory = /etc/ansible/hosts library = /usr/share/ansible/ forks = 5 sudo_user = root remote_port = 22 roles_path = /root/ansible_playbook/roles host_key_checking = False timeout = 20 log_path = /var/log/ansible.log
deprecation_warnings=False host_key_checking = False
第四步 : 管理节点生成pub-key ssh-keygen
第五步 :copy 相关Key到目标节点 #ssh-copy-id root@目标节点IP
第六步 :test ansible -m ping all
