不需要配置免密登陆,即可执行/etc/ansible/hosts 文件配置sudo.yml文件配置- hosts: test sudo_user: cloud sudo: yes tasks: - name: echo /root/hosts shell: echo "127.0.0.1 hostna
ansible hosts文件详解# This is the default ansible 'hosts' file.## It should live in /etc/ansible/hosts## - Comments begin with the '#' character# - Blank lines are ignored# &
playbook使用:ansible-playbook test.yaml playbook是由一个或多个“play”组成的列表。play的主要功能在于将事先归并为一组的主机装扮成事先通过ansible中的task定义好的角色。从根本上来讲,所谓task无非是调用ansible的一个module。将多个play组织在一个playbook中,即可以让它们
# This is the default ansible 'hosts' file.## It should live in /etc/ansible/hosts## - Comments begin with the '#' character# - Blank lines are ignored# - Groups of
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号