-
Notifications
You must be signed in to change notification settings - Fork 673
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
SLES15 use dropin configuration for issue banner #10605
SLES15 use dropin configuration for issue banner #10605
Conversation
This datastream diff is auto generated by the check Click here to see the full diffbash remediation for rule 'xccdf_org.ssgproject.content_rule_banner_etc_issue' differs.
--- xccdf_org.ssgproject.content_rule_banner_etc_issue
+++ xccdf_org.ssgproject.content_rule_banner_etc_issue
@@ -17,7 +17,6 @@
# 4 - Remove any leftover backslash. (From any parethesis in the banner, for example).
login_banner_text=$(echo "$login_banner_text" | sed 's/\\//g')
formatted=$(echo "$login_banner_text" | fold -sw 80)
-
cat <<EOF >/etc/issue
$formatted
EOF
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_banner_etc_issue' differs.
--- xccdf_org.ssgproject.content_rule_banner_etc_issue
+++ xccdf_org.ssgproject.content_rule_banner_etc_issue
@@ -4,7 +4,7 @@
tags:
- always
-- name: Modify the System Login Banner - ensure correct banner
+- name: Modify the System Login Banner - Ensure Correct Banner
copy:
dest: /etc/issue
content: '{{ login_banner_text | regex_replace("^\^(.*)\$$", "\1") | regex_replace("^\((.*\.)\|.*\)$", |
@@ -5,7 +5,26 @@ | |||
# disruption = medium | |||
{{{ ansible_instantiate_variables("login_banner_text") }}} | |||
|
|||
- name: "{{{ rule_title }}} - ensure correct banner" | |||
{{% if product not in ['sle15'] %}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove some empty lines left by Jinja2 in the resulting file:
https://jinja.palletsprojects.com/en/3.0.x/templates/#whitespace-control
Also valid for other files in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@teacup-on-rockingchair , do you have plans to work on this? This is actually only an aesthetic issue to avoid some extra empty lines in the resulting file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for some reason missed the message long time ago and the PR was displayed in the list as review required, so I thought you don't have time for it :)
Anyways modified those macros fromm {{% %}}
to {{%- -%}}
, but am a bit confused since I can see extra new lines , after build, on my local setup only in the bash files. Could it be because I am using ninja build or something else. I could not find anything in my environment that should cause the ssg build procedure to consider trimming default behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, some new erros appeared now in CI tests. I need to check them.
Indeed it turned out I stripped too much lines broke the shell remediation and also templates in the file_owner/groupowner rules, so 900f57a should fix that |
For sle15 platform make sure to use drop-in configuration for remediation of /etc/issue banner /etc/issue file is symlink in SLES15 and is managed by the issue-generator service, so additional logic added, to make sure issue-generator service is installed and running.
900f57a
to
d52e573
Compare
Code Climate has analyzed commit 7b82d62 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 52.8% (0.0% change). View more on Code Climate. |
/packit test |
2cf241a
into
ComplianceAsCode:master
Description:
Rationale: