ansible之cron模块
例:在指定节点上定义一个计划任务,每隔3 分钟到主控端更新一次时间
paramiko: The authenticity of host ‘master.test.com’ can’t be established.
The ssh-rsa key fingerprint is 3d906ef1d450e4cc7031aef5e8c296f6.
Are you sure you want to continue connecting (yes/no)?
agent.test.com | SUCCESS => {
“changed”: false,
“envs”: [],
“jobs”: [
“date”
]
}
client02 | SUCCESS => {
“changed”: false,
“envs”: [],
“jobs”: [
“date”
]
}
master.test.com | UNREACHABLE! => {
“changed”: false,
“msg”: “Authentication failed.”,
“unreachable”: true
}
删除刚才新建的定时任务
ansible all -m cron -a 'name="date" state=absent'

浙公网安备 33010602011771号