79570279

Date: 2025-04-12 09:56:20
Score: 0.5
Natty:
Report link

Hello and welcome to the community!

  1. You can modify yaml files using builtin modules.
    Multiple examples are provided for another question from 2015: Is there a yaml editing module for ansible?
  2. Based on output and path in error, I can say that module is missed on managed node (torizon@box8). Here's an example of downloading it to your host and installing to managed:
tasks:
  - name: "Download jmespath"
    ansible.builtin.shell:
      executable: "/bin/bash"
      cmd: |
        set -o pipefail
        python3 -m pip \
        download jmespath \
          --dest /tmp/ \
          --no-input \
        | grep /
    become: false
    changed_when: false
    check_mode: false
    delegate_to: "localhost"
    register: "pip_download_jmespath"

  - name: "Copy jmespath"
    ansible.builtin.copy:
      src: "{{ pip_download_jmespath.stdout.split(' ')[-1] }}"
      dest: "/tmp/jmespath/"
      mode: "0664"

  - name: "Install jmespath from downloaded package"
    ansible.builtin.pip:
      name: "jmespath"
      extra_args: >
        --no-index --find-links=file:///tmp/jmespath/
    when: "not ansible_check_mode"
Reasons:
  • Blacklisted phrase (1): another question
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Andrei Andriushin