Added split('\n')
This commit is contained in:
parent
b4c14b9168
commit
721414ce29
|
|
@ -0,0 +1,10 @@
|
|||
Added
|
||||
# Please enter the commit message for your changes. Lines starting
|
||||
# with '#' will be ignored, and an empty message aborts the commit.
|
||||
#
|
||||
# On branch main
|
||||
# Your branch is up to date with 'origin/main'.
|
||||
#
|
||||
# Changes to be committed:
|
||||
# modified: run_python_script.yml
|
||||
#
|
||||
|
|
@ -18,13 +18,13 @@
|
|||
virtualenv: /tmp/ansible_venv
|
||||
virtualenv_command: "python3 -m venv"
|
||||
|
||||
- name: Check installed Python packages
|
||||
command: bash -c "source /tmp/ansible_venv/bin/activate && pip list"
|
||||
register: installed_packages
|
||||
# - name: Check installed Python packages
|
||||
# command: bash -c "source /tmp/ansible_venv/bin/activate && pip list"
|
||||
# register: installed_packages
|
||||
|
||||
- name: Show installed packages
|
||||
debug:
|
||||
msg: "{{ installed_packages.stdout }}"
|
||||
# - name: Show installed packages
|
||||
# debug:
|
||||
# msg: "{{ installed_packages.stdout }}"
|
||||
|
||||
- name: Run the Python script
|
||||
command: /tmp/ansible_venv/bin/python3 scripts/my_script.py
|
||||
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
- name: Show script output
|
||||
debug:
|
||||
msg: "{{ script_output.stdout }}"
|
||||
|
||||
msg: "{{ script_output.stdout.split('\n') }}"
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue