Project

General

Profile

Actions

Feature #28288

closed

Feature #32080: Support running ansible with --tags and --skip-tags

Support option to "skip-tags" on Ansible runs

Added by Ondřej Pražák over 5 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1761421

We would like to have support for option to "skip-tags" on Ansible runs,

If you run OpenScap and create an Ansible Role from the results to fix the issues, then you get tags for each task. If you want to rewrite everything to "when" statements, it will be a lot of work and quite impossible to handle.

The reason to get that skip-task stuff is easy to describe. When you have a compliance role and there is a server where you need an "exec" mount option on /tmp you have to skip the tag instead of rewriting the task to use when statements for each sinlge CVE.

For Example, the following. You need a lot of when statements if you like to set "low" or "CCE-80150-6" or "mount_option_tmp_noexec".
The other point is, that you configure a variable which are global in Ansible which means, you must ensure to not reuse them in any way.

Tags are helpful. (the following is part of the openscap output which has been added to the ansible role)

- name: "Ensure permission noexecS are set on /tmp"
mount:
path: "/tmp"
src: "{{device_name.stdout}}"
opts: "{{device_cur_mountoption.stdout}},noexec"
state: "mounted"
fstype: "{{device_fstype.stdout}}"
when: device_cur_mountoption.stdout is not search("nodev")
tags:
- mount_option_tmp_noexec
- low
- CCE-80150-6


Related issues 1 (0 open1 closed)

Related to Ansible - Feature #25459: Support running playbooks with tagsClosedActions
Actions #1

Updated by Ondřej Pražák over 5 years ago

  • Subject changed from Support option to "skip-tags" on Ansible runs to Support option to "skip-tags" on Ansible runs
  • Priority changed from High to Normal
Actions #2

Updated by Mark deJong over 4 years ago

  • Related to Feature #25459: Support running playbooks with tags added
Actions #3

Updated by Ondřej Ezr about 4 years ago

  • Is duplicate of Feature #32080: Support running ansible with --tags and --skip-tags added
Actions #4

Updated by Ondřej Ezr about 4 years ago

  • Is duplicate of deleted (Feature #32080: Support running ansible with --tags and --skip-tags)
Actions #5

Updated by Ondřej Ezr about 4 years ago

  • Parent task set to #32080
Actions #6

Updated by Ondřej Ezr about 4 years ago

  • Triaged changed from No to Yes
Actions #7

Updated by Ondřej Ezr almost 4 years ago

  • Status changed from New to Closed

Resolved in parent

Actions #8

Updated by Ondřej Ezr almost 4 years ago

  • Fixed in Releases foreman_ansible-6.4.0 added
Actions

Also available in: Atom PDF