ansible报错

报错:
[root@jenkins ~]# ansible go_activity -m cron -a "name='log_clear' minute=0 hour=2 job=find /home/golanger/log/ -type f -name 'log$(date +\%d -d -1day)' -delete"

    ERROR! this task 'cron' has extra params, which is only allowed in the following modules: command, win_command, shell, win_shell, script, include, include_vars, add_host, group_by, set_fact, raw, meta

解决:
这个需要在job上加引号,另外如下,如果有一些特殊符号的话,需要转义
[root@jenkins ~]# ansible go_activity -m cron -a "name=log_clear minute=0 hour=2 job='find /home/golanger/log/ -type f -name \"log\$(date +%d -d -1day)\" -delete'"

相关文章

----name:setpublickeyonremotehosts&setreomtehostssud...
环境准备#cat/etcedhat-releaseCentOSLinuxrelease7.9.2009(...
准备好环境,在安装之前请先了解openshift提供的ansible有大...
Ansible:运维工作:系统安装(物理机、虚拟机)-->程序包...
ansible与salt对比相同都是为了同时在多台机器上执行相同的命...
[root@node1playbook]#catnginx.yml-hosts:test\\主...