ansible cron with 2.8rc3

22 views
Skip to first unread message

Michael Ströder

unread,
May 11, 2019, 12:38:33 PM5/11/19
to Ansible Project
HI!

I'm testing my ansible roles with ansible 2.8rc3.
The roles work with ansible 2.7.10.

This cron task fails with 2.8rc3 using Python 2.7.16 (see details
attached at message end):

- name: "Remove obsolete CRON jobs from /etc/cron.d/aedir_tools"
cron:
name: "{{ item }}"
state: absent
cron_file: aedir_tools
with_items:
- aedirpwd_cron
- aedirpwd_expiry_check

What's wrong with that?

Ciao, Michael.

-------------------------------- snip --------------------------------
The full traceback is:
WARNING: The below traceback may *not* be related to the actual failure.
File
"/tmp/ansible_cron_payload_HHWGrW/ansible_cron_payload.zip/ansible/module_utils/basic.py",
line 1529, in _check_required_by
check_required_by(spec, param)
File
"/tmp/ansible_cron_payload_HHWGrW/ansible_cron_payload.zip/ansible/module_utils/common/validation.py",
line 164, in check_required_by
raise TypeError(to_native(msg))

failed: [ae-dir-suse-p1.virtnet1.stroeder.local] (item=aedirpwd_cron) =>
{
"ansible_loop_var": "item",
"changed": false,
"invocation": {
"module_args": {
"backup": false,
"cron_file": "aedir_tools",
"day": "*",
"disabled": false,
"hour": "*",
"minute": "*",
"month": "*",
"name": "aedirpwd_cron",
"reboot": false,
"state": "absent",
"weekday": "*"
}
},
"item": "aedirpwd_cron",
"msg": "missing parameter(s) required by 'cron_file': user"
}

Kai Stian Olstad

unread,
May 11, 2019, 1:15:36 PM5/11/19
to ansible...@googlegroups.com
On 11.05.2019 18:38, Michael Ströder wrote:
> I'm testing my ansible roles with ansible 2.8rc3.
> The roles work with ansible 2.7.10.
>
> This cron task fails with 2.8rc3 using Python 2.7.16 (see details
> attached at message end):
>
> - name: "Remove obsolete CRON jobs from /etc/cron.d/aedir_tools"
> cron:
> name: "{{ item }}"
> state: absent
> cron_file: aedir_tools
> with_items:
> - aedirpwd_cron
> - aedirpwd_expiry_check
>
> What's wrong with that?
>

<snip />

> "msg": "missing parameter(s) required by 'cron_file': user"
> }
>

As the message say you are missing the user parameter, per documentation this is required.

That said, the user parameter is irrelevant when state is absent so I would call this a bug.


--
Kai Stian Olstad

Kai Stian Olstad

unread,
May 11, 2019, 1:37:33 PM5/11/19
to ansible...@googlegroups.com
Here is the culprit PR
https://github.com/ansible/ansible/pull/28662


--
Kai Stian Olstad

Michael Ströder

unread,
May 13, 2019, 7:53:10 AM5/13/19
to ansible...@googlegroups.com
On 5/11/19 7:37 PM, Kai Stian Olstad wrote:
> On 11.05.2019 19:15, Kai Stian Olstad wrote:
>> On 11.05.2019 18:38, Michael Ströder wrote:
>>> I'm testing my ansible roles with ansible 2.8rc3.
>>> The roles work with ansible 2.7.10.
>>>
>>> This cron task fails with 2.8rc3 using Python 2.7.16 (see details
>>> attached at message end):
>>>
>>> - name: "Remove obsolete CRON jobs from /etc/cron.d/aedir_tools"
>>> cron:
>>> name: "{{ item }}"
>>> state: absent
>>> cron_file: aedir_tools
>>> with_items:
>>> - aedirpwd_cron
>>> - aedirpwd_expiry_check
>>>
>>> What's wrong with that?
>>> [..]
>>> "msg": "missing parameter(s) required by 'cron_file': user"
>>
>> As the message say you are missing the user parameter, per documentation this is required.
>>
>> That said, the user parameter is irrelevant when state is absent so I would call this a bug.
>
> Here is the culprit PR
> https://github.com/ansible/ansible/pull/28662

Hmm, should I file a bug?

Ciao, Michael.

Brian Coca

unread,
May 13, 2019, 9:51:47 AM5/13/19
to Ansible Project
yes, please do


--
----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages