• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • ansible-tower-plugin
    • None
    • Ansible Tower Plugin version 0.5.3
      Ansible AWX version 1.0.1

      Typing in single Job Tags or comma-separated multiple Job Tags in the Job Tags field of the Plugin don't pass through to the corresponding AWX/Ansible Tower Job Template.  The other fields like limits and extra vars, however, have been tested to work okay.

      Expected Results:

      Tasks should be limited to run based on their specific job tags.

      Actual Results:

      The entire playbook is running, with the job unaware of job tags being specified.

      Note: Job Tags specified directly in AWX Job Templates will run the tasks as expected.

          [JENKINS-48377] Job Tags don't pass to Ansible Tower/AWX

          Alvin Wong created issue -
          Alvin Wong made changes -
          Description Original: Typing in single Job Tags or comma-separated multiple Job Tags in the Job Tags field of the Plugin don't pass through to the corresponding AWX/Ansible Tower Job Template.  The other fields like limits and extra vars, however, have been tested to work okay.

          Expected Results:

          Tasks should be limited to run based on their specific job tags.

          Actual Results:

          The entire playbook is running, with the job unaware of job tags being specified.
          New: Typing in single Job Tags or comma-separated multiple Job Tags in the Job Tags field of the Plugin don't pass through to the corresponding AWX/Ansible Tower Job Template.  The other fields like limits and extra vars, however, have been tested to work okay.

          Expected Results:

          Tasks should be limited to run based on their specific job tags.

          Actual Results:

          The entire playbook is running, with the job unaware of job tags being specified.

          Note: Job Tags specified directly in AWX Job Templates will run the tasks as expected.

          Alvin Wong added a comment -

          I am not sure what happened, but the scheduled  jenkins jobs successfully passed job tags into AWX.  Will keep monitoring over the next couple days seeing if it's an issue with my environment.

          Alvin Wong added a comment - I am not sure what happened, but the scheduled  jenkins jobs successfully passed job tags into AWX.  Will keep monitoring over the next couple days seeing if it's an issue with my environment.

          John Westcott added a comment -

          Let me know. In my testing tonight (on Tower 3.2.1) I needed to start the tags with a ',' to get tower to accept it (this was true even when launching the job from Tower itself). If this works for you I can make a change to check for a leading ',' and add one if its not there.

          Also, I'm thinking about changing the code so that it will print a warn message if one of the fields is defined (like Tags) but the Prompt on Launch option is not checked for that type of input.

          Let me know your thoughts and how your testing works out.

          John Westcott added a comment - Let me know. In my testing tonight (on Tower 3.2.1) I needed to start the tags with a ',' to get tower to accept it (this was true even when launching the job from Tower itself). If this works for you I can make a change to check for a leading ',' and add one if its not there. Also, I'm thinking about changing the code so that it will print a warn message if one of the fields is defined (like Tags) but the Prompt on Launch option is not checked for that type of input. Let me know your thoughts and how your testing works out.
          Alvin Wong made changes -
          Attachment New: image-2017-12-06-10-41-13-434.png [ 40596 ]
          Alvin Wong made changes -
          Attachment New: image-2017-12-06-10-41-47-305.png [ 40597 ]

          Alvin Wong added a comment - - edited

          I'm still not exactly sure why this is happening now, but if I try to build jobs manually, it looks like the plugin will kick off the job template in AWX, but won't override the extra variables, limits, or job tags.  Here are some picture examples:

          Jenkins Job:

          AWX Job:

          Again, when jobs are triggered automatically by polling the SCM upstream in Jenkins, then settings pass through to AWX.  However, I can't even recreate that scenario manually as when I simply try to kick off the plugin from an upstream Jenkins job manually, it seems that nothing really happens other than triggering the existing job template with its existing settings in AWX.

           

          Alvin Wong added a comment - - edited I'm still not exactly sure why this is happening now, but if I try to build jobs manually, it looks like the plugin will kick off the job template in AWX, but won't override the extra variables, limits, or job tags.  Here are some picture examples: Jenkins Job: AWX Job: Again, when jobs are triggered automatically by polling the SCM upstream in Jenkins, then settings pass through to AWX.  However, I can't even recreate that scenario manually as when I simply try to kick off the plugin from an upstream Jenkins job manually, it seems that nothing really happens other than triggering the existing job template with its existing settings in AWX.  

          Code changed in jenkins
          User: John Westcott IV
          Path:
          src/main/java/org/jenkinsci/plugins/ansible_tower/util/TowerConnector.java
          http://jenkins-ci.org/commit/ansible-tower-plugin/885e792ca71d185e911764b6ca92cf120d978a60
          Log:
          Changes for JENKINS-48438 and JENKINS-48377.
          Added method to get job template and options for logging different types of events in a workflow. Tower running now will let you know if you set a variable that is not set as prompt on launch in Tower.

          Compare: https://github.com/jenkinsci/ansible-tower-plugin/compare/db71a93388c5...885e792ca71d

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: John Westcott IV Path: src/main/java/org/jenkinsci/plugins/ansible_tower/util/TowerConnector.java http://jenkins-ci.org/commit/ansible-tower-plugin/885e792ca71d185e911764b6ca92cf120d978a60 Log: Changes for JENKINS-48438 and JENKINS-48377 . Added method to get job template and options for logging different types of events in a workflow. Tower running now will let you know if you set a variable that is not set as prompt on launch in Tower. Compare: https://github.com/jenkinsci/ansible-tower-plugin/compare/db71a93388c5...885e792ca71d
          John Westcott made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          John Westcott added a comment -

          The logic behind a scheduled job/upstream job/etc should be identical for a manually kicked off job. I've added some logic which tries to detect if Jenkins can't pass values to Tower. Can you try the latest version and let me know if you get any messages in the logs? If not, and its still not working can you send me a screen grab of your template? Also, what version of AWX are you on? If its still not working I'll see if I can grab that and test with that specific version.

          John Westcott added a comment - The logic behind a scheduled job/upstream job/etc should be identical for a manually kicked off job. I've added some logic which tries to detect if Jenkins can't pass values to Tower. Can you try the latest version and let me know if you get any messages in the logs? If not, and its still not working can you send me a screen grab of your template? Also, what version of AWX are you on? If its still not working I'll see if I can grab that and test with that specific version.
          John Westcott made changes -
          Assignee Original: John Westcott [ johnwestcottiv ] New: Alvin Wong [ ziggyeye ]

            tokiwong Alvin Wong
            tokiwong Alvin Wong
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: