Skip to content

Commit

Permalink
Drop extra whitespaces from jinja macros
Browse files Browse the repository at this point in the history
  • Loading branch information
teacup-on-rockingchair committed Jun 25, 2023
1 parent 6ae1e6e commit 4f9a9de
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# disruption = medium
{{{ ansible_instantiate_variables("login_banner_text") }}}

{{% if product not in ['sle15'] %}}
{{%- 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 %}}
{{%- else -%}}
- name: {{{ rule_title }}} Ensure issue-generator is Installed
package:
name: "issue-generator"
Expand All @@ -27,4 +27,4 @@
enabled: "yes"
state: "restarted"
masked: "no"
{{% endif %}}
{{%- endif -%}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
{{{ bash_deregexify_banner_backslash("login_banner_text") }}}
formatted=$(echo "$login_banner_text" | fold -sw 80)

{{% if product not in ['sle15'] %}}
{{%- if product not in ['sle15'] -%}}
cat <<EOF >/etc/issue
$formatted
EOF
{{% else %}}
{{%- else -%}}
{{{ bash_package_install("issue-generator") }}}
cat <<EOF >/etc/issue.d/99-oscap-setting
$formatted
EOF
{{{ bash_service_command("restart", "issue-generator") }}}
{{% endif %}}
{{%- endif -%}}
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +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'] %}}
{{%- if product in ['sle15'] -%}}
template:
name: file_groupowner
vars:
filepath: /etc/issue.d/
filegid: '0'
file_regex: ^.*$
recursive: 'true'
{{% else %}}
{{%- else -%}}
template:
name: file_groupowner
vars:
filepath: /etc/issue
gid_or_name: '0'
{{% endif %}}

Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +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'] %}}
{{%- if product in ['sle15'] -%}}
template:
name: file_owner
vars:
filepath: /etc/issue.d/
fileuid: '0'
file_regex: ^.*$
recursive: 'true'
{{% else %}}
{{%- else -%}}
template:
name: file_owner
vars:
filepath: /etc/issue
fileuid: '0'
{{% endif %}}

{{%- endif -%}}

0 comments on commit 4f9a9de

Please sign in to comment.