use diff intermediate var to preserve functionality (#83738)

add tests
pull/83756/head
Brian Coca 4 months ago committed by GitHub
parent 797e6bb220
commit e4d7286298
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -29,8 +29,9 @@ from ansible.utils.sentinel import Sentinel
# modules formated for user msg
FREEFORM_ACTIONS = set(C.MODULE_REQUIRE_ARGS_SIMPLE)
RAW_PARAM_MODULES = FREEFORM_ACTIONS.union(set([
FREEFORM_ACTIONS_SIMPLE = set(C.MODULE_REQUIRE_ARGS_SIMPLE)
FREEFORM_ACTIONS = frozenset(add_internal_fqcns(FREEFORM_ACTIONS_SIMPLE))
RAW_PARAM_MODULES = FREEFORM_ACTIONS_SIMPLE.union(set([
'include_vars',
'include_tasks',
'include_role',

@ -0,0 +1,17 @@
- hosts: localhost
gather_facts: false
vars:
output_dir: '{{ lookup("env", "OUTPUT_DIR") }}'
tasks:
- name: set tempfile
tempfile:
path: '{{output_dir}}'
prefix: 'ansible-test'
state: file
register: mktemp
- name: ensure 'command' can use raw args
command: dd if=/dev/zero of="{{mktemp.path}}" bs=1K count=1
- name: ensure fqcn 'command' can use raw args
ansible.legacy.command: dd if=/dev/zero of="{{mktemp.path}}" bs=1K count=1

@ -4,3 +4,14 @@ set -eux
# test running module directly
python.py library/test.py args.json
TMPFILE=$(shell mktemp -p "${OUTPUT_DIR}" 2>/dev/null || mktemp -t 'ansible-testing-XXXXXXXXXX' -p "${OUTPUT_DIR}")
# ensure 'command' can use 'raw args'
ansible -m command -a "dd if=/dev/zero of=\"${TMPFILE}\" bs=1K count=1" localhost
# ensure fqcn 'command' can use 'raw args'
ansible -m ansible.legacy.command -a "dd if=/dev/zero of=\"${TMPFILE}\" bs=1K count=1" localhost
# same in playbook
ansible-playbook run_raw_args.yml "$@"

Loading…
Cancel
Save