From 721414ce29adc726e9f0375e70c7115132e01836 Mon Sep 17 00:00:00 2001 From: Vadim Shulkin Date: Tue, 4 Mar 2025 10:59:27 -0500 Subject: [PATCH] Added split('\n') --- 1 | 10 ++++++++++ run_python_script.yml | 15 +++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 1 diff --git a/1 b/1 new file mode 100644 index 0000000..32ef09b --- /dev/null +++ b/1 @@ -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 +# diff --git a/run_python_script.yml b/run_python_script.yml index 86529a2..c72fc0e 100644 --- a/run_python_script.yml +++ b/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') }}"