Command task with args

I have a task like this:

  • name: Run migrations
    sudo: yes
    sudo_user: postgres
    command: “goose -env foo up”
    args:
    chdir: “{{ migrations_dir }}”

when I updated to the head of ansible/devel (1d04e4b3d27b0ae16619eda4136a939fe6f3299c) it returns an error (from the executed command, not ansible), as if the working dir is being ignored. If I change it to this:

  • name: Run migrations
    sudo: yes
    sudo_user: postgres
    command: goose -env foo up chdir=“{{ migrations_dir }}”

it works as expected. Is the first version still valid syntax?

Core modules is at: 8614ef8d6f90a2d292721d0f6fab328aa16d7589, and Extras is at: a0df36c6ab257281cbaae00b8a4590200802f571.

args should still work on this version, but may be an invalid keyword in the future.

I can see why you would want to pass args since it’s unclear how to send the rest of the parameter as a hash though.

Can you file a ticket?

Thanks!

On the main repo, or modules-core? I have no idea where the code for that would be.

Yeah it’s not obvious - Main repo. This should be a language issue.

Thanks!

Done.