--- - hosts: gdy become: yes become user: root become method: sudo become flags: -i gather_facts: no vars: - disk_sh_dir: "/home/wangyan/playbook/vm"
ansible -i /etc/ansible/yewu all -m cron -a 'name="clean_log" minute=30 hour=5 job="root sh /home/pe/del_log.sh /dev/null 2>&1"'注意追加crontab条目要修改name名称,否则是替换原有任务
cat modify_pass.yml --- - hosts: stardb become: yes become_user: root become_method: sudo become_flags: -i gather_facts: false tasks: - name: change us
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号