Ansible error on both Foreman 3.17 and 3.18

Problem:

I tried to install a package using Ansible and it complains about an unsupported parameter. This parameter is part of the default job template “Module Action - Ansible Default”, which is used by many (all?) Ansible job templates. it appears that the ‘warn: false’ argument is no longer supported under tasks.shell.

TASK [shell] *******************************************************************
fatal: [host.domain.com]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (ansible.legacy.command) module: warn. Supported parameters include: _raw_params, _uses_shell, argv, chdir, creates, executable, expand_argument_vars, removes, stdin, stdin_add_newline, strip_empty_ends."}

Expected outcome:

Ansible job templates to not throw unsupported parameter errors

Foreman and Proxy versions:

v3.18.1 (same on v3.17.2)

Foreman and Proxy plugin versions:

Foreman Proxy Service - Ansible Version3.7.1

Installed Ansible version: 2.16.14

Distribution and version:

CentOS Stream 9

Using which job template? Module Action - Ansible Default? If so, why use that over Package Action - Ansible Default?

Could you list some of those ansible job templates you’re referring to? On my machine, the module action job template is not used by anything else.

Maybe I made some assumptions, but the stated job template is the only one with that parameter.

This is what I did:

  1. Run job >> Job category: Ansible Packages >> Job Template: Package Action - Ansible Default
  2. Target hosts and inputs: state: installed >> name: acl

Interestingly, I now see different fields for step 2. I had run this first under v3.17.2 and it failed. I then upgraded to v3.18.1 (as that was my target coming from v3.16.3). And just reran the job rather than creating a new job.

So if there’s an issue, it’s likely with v3.17.2, but I can no longer test against that and the issue appears fixed on v3.18.1. So, time to close this off.

Glad to hear you got it to work.

I filed Bug #39427: Module Action - Ansible Default job template passes no-longer-supported parameter to the underlying shell module - Ansible - Foreman just so that it doesn’t get lost.