system-config/playbooks/test-inline-python.yaml
James E. Blair 3078b54d5f Add inline_python module
I thought this would be a handy module to have in case we have something
we want to do in 3 lines of python but don't want to write all the
boilerplate ansible module.

This just execs a python script which is expected to have an
exit_json or fail_json call at the end.

Change-Id: I10f30828a5086bd639f5caa7b6aa71477f86124e
2022-05-25 18:14:21 +00:00

9 lines
165 B
YAML

- hosts: localhost
tasks:
- inline_python:
args:
foo: 1
bar: 2
script: |
exit_json(changed=True, result=foo+bar)