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

Running ansible playbook on multiple hosts gives wrong host parameter result

XMLWordPrintable

    • 0
    • False
    • Hide

      None

      Show
      None
    • False
    • 0
    • Endeavour
    • Moderate
    • No

      Description of problem:

      Job template created as ansible playbook. When the end user selects multiple hosts and runs the playbook on multiple hosts, all the hosts give the same result as the first host selected in the list though the configured 'host parameter' value is different on other hosts. While selecting 1 host and running the same ansible-playbook it gives the correct result. 

      ===========================================================

      When we select multiple hosts to run a playbook the result is as below.

      =============================================================

        1:
      [WARNING]: Callback disabled by environment. Disabling the Foreman callback
         2:
      plugin.
         3:

         4:
      PLAY [all] *********************************************************************
         5:

         6:
      TASK [Gathering Facts] *********************************************************
         7:
      ok: [satellite.example.com]
         8:

         9:
      TASK [shell] *******************************************************************
        10:
      changed: [satellite.example.com]
        11:

        12:
      TASK [debug] *******************************************************************
        13:
      ok: [satellite.example.com] =>

      {   14:     "msg": "false"   15: }

        16:
      PLAY RECAP *********************************************************************
        17:
      satellite.example.com : ok=3    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
        18:
      Exit status: 0

       

      =============================================================

      While running the same ansible-playbook on that same single host.

      =========================================================

      1:
      [WARNING]: Callback disabled by environment. Disabling the Foreman callback
         2:
      plugin.
         3:

         4:
      PLAY [all] *********************************************************************
         5:

         6:
      TASK [Gathering Facts] *********************************************************
         7:
      ok: [satellite.example.com]
         8:

         9:
      TASK [shell] *******************************************************************
        10:
      changed: [satellite.example.com]
        11:

        12:
      TASK [debug] *******************************************************************
        13:
      ok: [satellite.example.com] =>

      {   14:     "msg": "true"   15: }

        16:
      PLAY RECAP *********************************************************************
        17:
      satellite.example.com : ok=3    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
        18:
      Exit status: 0

       

      How reproducible:

      Steps to Reproduce:

      1. On your satellite WEB UI -> Hosts -> Job template -> Create a Job template with this below example playbook as this one has host-parameter included.

      hosts: all

      tasks:

         - shell:

               cmd: | echo <%= host_param_true?('host_registration_insights') %>

               register: output

          - debug: msg: "{{ output.stdout }}" 

      2.  On your satellite WEB UI -> Hosts -> All Hosts -> click on a host name -> Click on 'Parameters' tab -> 'host_registration_insights' edit it to false.

      Repeat the same on 2 hosts.

      3.  On your satellite WEB UI -> Hosts -> All Hosts -> click on 1 host name -> Click on 'Parameters' tab -> 'host_registration_insights' edit it to true.

      Taking 3 hosts to test this issue.

      4. Now on your satellite WEB UI -> Hosts -> All Hosts -> Select the 3rd host with true parameter first -> Then select other 2 hosts -> Select actions -> Schedule Remote job -> Jobs - Ansible Playbook -> Select the custom template from dropdown -> Run on selected hosts 

      Actual behavior:

      All the hosts will populate the result 'true'.

      Expected behavior:

      The first Host will show 'host_registration_insights' as true and the other 2 hosts will populate 'host_registration_insights' as false.

      Business Impact / Additional info:

       

      I am seeing the same issue on satellite 6.15 as well.

            Unassigned Unassigned
            rhn-support-sussen Susmita Sen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: