Skip to content

Commit

Permalink
Merge pull request #11151 from Xeicker/update_sshd_lineinfile
Browse files Browse the repository at this point in the history
Update sshd lineinfile
  • Loading branch information
jan-cerny authored Oct 3, 2023
2 parents e09105c + 1c35d98 commit b9b24d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion shared/macros/10-ansible.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ value: :code:`Setting={{ varname1 }}`
{{% if product in ["ol8", "ol9"] %}}
- name: "Find sshd_config included files"
shell: |-
included_files=$(grep -oP "^\s*(?i)include.*" /etc/ssh/sshd_config | sed -e 's/Include\s*//i' | sed -e 's|^[^/]|/etc/ssh/&|')
included_files=$(grep -oP "^\s*(?i)include.*" /etc/ssh/sshd_config | sed -e 's/\s*Include\s*//i' | sed -e 's|^[^/]|/etc/ssh/&|')
[[ -n $included_files ]] && ls $included_files || true
register: sshd_config_included_files

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

source common.sh

{{{ bash_replace_or_append("/etc/ssh/sshd_config", "Include", "sshd_config.d/*.conf", "%s %s") }}}
echo "Include /etc/dummy" >> "/etc/ssh/sshd_config"
{{{ bash_replace_or_append("/etc/ssh/sshd_config", " InCLude", "sshd_config.d/*.conf", "%s %s") }}}
echo " INclUde /etc/dummy" >> "/etc/ssh/sshd_config"

echo "{{{ PARAMETER }}} {{{ VALUE }}}" >> /etc/dummy
echo "{{{ PARAMETER }}} {{{ VALUE }}}" >> /etc/ssh/sshd_config.d/other.conf

0 comments on commit b9b24d4

Please sign in to comment.