Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"2.2.10" task uses the wrong when conditional and tags #176

Closed
RayMcAdmin opened this issue Apr 12, 2022 · 0 comments
Closed

"2.2.10" task uses the wrong when conditional and tags #176

RayMcAdmin opened this issue Apr 12, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@RayMcAdmin
Copy link

Describe the Issue
name: "2.2.10 | PATCH | Ensure a web server is not installed" uses the wrong when conditional and tags

Expected Behavior
rhel8cis_rule_2_2_10 being set False should prevent the task block from running

Actual Behavior
The task runs irregardless because the when conditional is set to;

  when:
      - rhel8cis_rule_2_2_9

Possible Solution

- name: "2.2.10 | PATCH | Ensure a web server is not installed"
  block:
      - name: "2.2.10 | PATCH | Ensure a web server is not installed | Remove httpd server"
        package:
            name: httpd
            state: absent
        when:
            - not rhel8cis_httpd_server
            - "'httpd' in ansible_facts.packages"

      - name: "2.2.10 | PATCH | Ensure a web server is not installed | Remove nginx server"
        package:
            name: nginx
            state: absent
        when:
            - not rhel8cis_nginx_server
            - "'nginx' in ansible_facts.packages"
  when:
      - rhel8cis_rule_2_2_10
  tags:
      - level1-server
      - level1-workstation
      - automated
      - patch
      - httpd
      - nginx
      - webserver
      - rule_2.2.10

@RayMcAdmin RayMcAdmin added the bug Something isn't working label Apr 12, 2022
georgenalen added a commit that referenced this issue Apr 12, 2022
Signed-off-by: George Nalen <georgen@mindpointgroup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants