Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1761421 - [RFE] Option to "skip-tags" on Ansible runs from Red Hat Satellite server.
Summary: [RFE] Option to "skip-tags" on Ansible runs from Red Hat Satellite server.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible - Configuration Management
Version: 6.5.0
Hardware: All
OS: All
high
medium
Target Milestone: 6.11.0
Assignee: satellite6-bugs
QA Contact: Danny Synk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-14 11:23 UTC by Amaani S Karimi
Modified: 2022-07-05 14:28 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-05 14:27:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 28288 0 'Normal' 'New' 'Support option to "skip-tags" on Ansible runs' 2019-12-03 11:25:14 UTC
Red Hat Knowledge Base (Solution) 4498331 0 None None None 2019-10-14 11:34:46 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:28:06 UTC

Comment 5 Ondřej Pražák 2019-11-18 15:20:57 UTC
Created redmine issue https://projects.theforeman.org/issues/28288 from this bug

Comment 6 Ondřej Ezr 2021-06-11 11:08:42 UTC
This will be present in next Foreman release - 3.0, and so present in Satellite 7.0

Comment 8 Danny Synk 2022-01-12 22:29:30 UTC
Verified on Satellite 7.0, snap 4 running on RHEL 7 and RHEL 8.

Steps to Test:
1. Register a host to Satellite and configure it for remote execution.
2. Schedule a remote job on the host using the `Ansible Playbook` job category, the `Ansible - Run playbook` job template, and the following playbook pasted in the `playbook` field:

```
- hosts: host.example.com
  tasks:
    - name: create a test file
      file:
        path: /root/test_file_created
        state: touch
        mode: '0644'
      tags:
      - run

    - name: this task should be skipped
      file:
        path: /root/do_not_create
        state: touch
        mode: '0644'
      tags:
      - do_not_run
```
3. Run the job multiple times with the following modifications to the advanced fields on the job invocations page:
  - `do_not_run` entered in the `tags` field and `tags_flag` set to `exclude`
  - `run` entered in the `tags` field and `tags_flag` set to `include`
  - no text entered in the `tags` field and `tags_flag` set to `include`
  - no text entered in the `tags` field and `tags_flag` set to `exclude`
  - `do_not_run, run` entered in the `tags` field and `tags_flag set to `include`
  - `do_not_run, run` entered in the `tags` field and `tags_flag set to `exclude`

Expected Results:
- When `tags_flag` is set to `include`, only tasks tagged with the tags entered in the `tags` field should be run. 
- When `tags_flag` is set to `exclude`, all tasks should be run except those tagged with the tags entered in the `tags` field.
- When no text is entered in the `tags` field, the `tags_flag` setting has no effect.

Actual Results:
- When `tags_flag` is set to `include`, only tasks tagged with the tags entered in the `tags` field should be run. 
- When `tags_flag` is set to `exclude`, all tasks should be run except those tagged with the tags entered in the `tags` field.
- When no text is entered in the `tags` field, the `tags_flag` setting has no effect.

Note:
When entering multiple tags, the tags must be formatted as a comma-separated list. Separating tags with line breaks causes the tag options to be ignored.

Comment 11 errata-xmlrpc 2022-07-05 14:27:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498


Note You need to log in before you can comment on or make changes to this bug.