Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-25285

Running Ansible Remote Execution Jobs Against Multiple Hosts, the Host Parameter from First Host is Being Used to Render Job Template For All Hosts

XMLWordPrintable

    • Sat_docs_8_2024
    • Moderate
    • No

      Description of problem:

      When running Ansible Remote Execution Tasks against multiple hosts, the host parameter from the first host of the batch of hosts is being used to render the job template for all hosts.  The Job Task output shows the correct host parameter for all hosts, however, the job template renders based on the first host, which can cause issues for other hosts that have a different host parameter.

      Eng comment:

      Host parameters are available as variables when the playbook runs so instead of rendering the template differently for different hosts, it is preferred to have the template render to the same playbook for all hosts and let ansible do different things with it.

      > The job template will render according to the very first host's host parameter

      Under the hood the job template gets rendered separately for each host, but then all the rendered variants are ignored except for the first one. As far as I know Ansible itself does not allow running multiple playbooks against multiple hosts with a single ansible-playbook invocation so there's that.

      However, the issue is there, there's no denying that, but we could at least document the recommended way of doing things to prevent people from running into this, especially if we consider the ansible-native way to be superior in probably all regards.

            zuansorg Lena Ansorgová
            rhn-support-myoder Michael Yoder
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: