Bug 1761421
| Summary: | [RFE] Option to "skip-tags" on Ansible runs from Red Hat Satellite server. | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Amaani S Karimi <akarimi> |
| Component: | Ansible - Configuration Management | Assignee: | satellite6-bugs <satellite6-bugs> |
| Status: | CLOSED ERRATA | QA Contact: | Danny Synk <dsynk> |
| Severity: | medium | Docs Contact: | |
| Priority: | high | ||
| Version: | 6.5.0 | CC: | arunas.vaznevicius, bkearney, dsynk, jsenkyri, oezr, pcreech, stefan.schwiedel |
| Target Milestone: | 6.11.0 | Keywords: | FutureFeature, Triaged |
| Target Release: | Unused | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-07-05 14:27:54 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Comment 5
Ondřej Pražák
2019-11-18 15:20:57 UTC
This will be present in next Foreman release - 3.0, and so present in Satellite 7.0 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.
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 |