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

updated 1.2.2-1.2.5 improved regex #425 #426

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tasks/section_1/cis_1.2.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
- name: "1.2.2 | PATCH | Ensure gpgcheck is globally activated | Update yum.repos"
ansible.builtin.replace:
name: "{{ item.path }}"
regexp: "^gpgcheck=0"
regexp: ^gpgcheck\s*=\s*0
replace: "gpgcheck=1"
loop: "{{ discovered_yum_repos.files }}"
loop_control:
Expand All @@ -48,7 +48,7 @@
- name: "1.2.2 | PATCH | Ensure gpgcheck is globally activated | Update dnf.conf"
ansible.builtin.lineinfile:
path: /etc/dnf/dnf.conf
regexp: ^(#|)gpgcheck=
regexp: ^(#|)gpgcheck\s*=
line: gpgcheck=1

- name: "1.2.3 | PATCH | Ensure repo_gpgcheck is globally activated"
Expand All @@ -72,7 +72,7 @@
- name: "1.2.3 | PATCH | Ensure repo_gpgcheck is globally activated | Update yum.repos"
ansible.builtin.replace:
name: "{{ item.path }}"
regexp: "^repo_gpgcheck=0"
regexp: ^repo_gpgcheck\s*=\s*0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be a rogue quote here, at the very end of line 75: regexp: ^repo_gpgcheck\s*=\s*0"

replace: "repo_gpgcheck=1"
loop: "{{ discovered_yum_repos.files }}"
loop_control:
Expand All @@ -81,7 +81,7 @@
- name: "1.2.3 | PATCH | Ensure repo_gpgcheck is globally activated | Update dnf.conf"
ansible.builtin.lineinfile:
path: /etc/dnf/dnf.conf
regexp: ^(#|)repo_gpgcheck=
regexp: ^(#|)repo_gpgcheck\s*=
line: repo_gpgcheck=1

- name: "1.2.4 | AUDIT | Ensure package manager repositories are configured"
Expand Down