diff --git a/linux_os/guide/system/accounts/accounts-banners/banner_etc_issue/ansible/shared.yml b/linux_os/guide/system/accounts/accounts-banners/banner_etc_issue/ansible/shared.yml index 4f6d64fd7ac..1dea09b2f90 100644 --- a/linux_os/guide/system/accounts/accounts-banners/banner_etc_issue/ansible/shared.yml +++ b/linux_os/guide/system/accounts/accounts-banners/banner_etc_issue/ansible/shared.yml @@ -5,7 +5,26 @@ # disruption = medium {{{ ansible_instantiate_variables("login_banner_text") }}} -- name: "{{{ rule_title }}} - ensure correct banner" +{{%- if product not in ['sle15'] -%}} +- name: "{{{ rule_title }}} - Ensure Correct Banner" copy: dest: /etc/issue content: '{{{ ansible_deregexify_banner_etc_issue("login_banner_text") }}}' +{{%- else -%}} +- name: {{{ rule_title }}} Ensure issue-generator is Installed + package: + name: "issue-generator" + state: present + +- name: "{{{ rule_title }}} - Ensure Correct Banner" + copy: + dest: /etc/issue.d/99-oscap-setting + content: '{{{ ansible_deregexify_banner_etc_issue("login_banner_text") }}}' + +- name: {{{ rule_title }}} Retart issue-generator Service on Issue Configration Change + ansible.builtin.systemd: + name: "issue-generator" + enabled: "yes" + state: "restarted" + masked: "no" +{{%- endif -%}} diff --git a/linux_os/guide/system/accounts/accounts-banners/banner_etc_issue/bash/shared.sh b/linux_os/guide/system/accounts/accounts-banners/banner_etc_issue/bash/shared.sh index cdfd9b99449..63ceaaf88f3 100644 --- a/linux_os/guide/system/accounts/accounts-banners/banner_etc_issue/bash/shared.sh +++ b/linux_os/guide/system/accounts/accounts-banners/banner_etc_issue/bash/shared.sh @@ -16,6 +16,14 @@ {{{ bash_deregexify_banner_backslash("login_banner_text") }}} formatted=$(echo "$login_banner_text" | fold -sw 80) +{{%- if product not in ['sle15'] %}} cat </etc/issue $formatted EOF +{{%- else %}} +{{{ bash_package_install("issue-generator") }}} +cat </etc/issue.d/99-oscap-setting +$formatted +EOF +{{{ bash_service_command("restart", "issue-generator") }}} +{{%- endif -%}} diff --git a/linux_os/guide/system/accounts/accounts-banners/file_groupowner_etc_issue/rule.yml b/linux_os/guide/system/accounts/accounts-banners/file_groupowner_etc_issue/rule.yml index 5d2eed70f18..b480a5bad32 100644 --- a/linux_os/guide/system/accounts/accounts-banners/file_groupowner_etc_issue/rule.yml +++ b/linux_os/guide/system/accounts/accounts-banners/file_groupowner_etc_issue/rule.yml @@ -39,8 +39,18 @@ ocil_clause: '{{{ ocil_clause_file_group_owner(file="/etc/issue", group="root") ocil: |- {{{ ocil_file_group_owner(file="/etc/issue", group="root") }}} +{{%- if product in ['sle15'] %}} +template: + name: file_groupowner + vars: + filepath: /etc/issue.d/ + gid_or_name: '0' + file_regex: ^.*$ + recursive: 'true' +{{%- else %}} template: name: file_groupowner vars: filepath: /etc/issue gid_or_name: '0' +{{% endif %}} diff --git a/linux_os/guide/system/accounts/accounts-banners/file_owner_etc_issue/rule.yml b/linux_os/guide/system/accounts/accounts-banners/file_owner_etc_issue/rule.yml index 70b4f392cd7..160192202f0 100644 --- a/linux_os/guide/system/accounts/accounts-banners/file_owner_etc_issue/rule.yml +++ b/linux_os/guide/system/accounts/accounts-banners/file_owner_etc_issue/rule.yml @@ -39,8 +39,18 @@ ocil_clause: '{{{ ocil_clause_file_owner(file="/etc/issue", owner="root") }}}' ocil: |- {{{ ocil_file_owner(file="/etc/issue", owner="root") }}} +{{%- if product in ['sle15'] %}} +template: + name: file_owner + vars: + filepath: /etc/issue.d/ + fileuid: '0' + file_regex: ^.*$ + recursive: 'true' +{{%- else %}} template: name: file_owner vars: filepath: /etc/issue fileuid: '0' +{{%- endif -%}}