aboutsummaryrefslogtreecommitdiffstats
path: root/modules/openssh/templates
diff options
context:
space:
mode:
authorDan Fandrich <danf@mageia.org>2024-10-04 19:28:06 -0700
committerDan Fandrich <danf@mageia.org>2024-10-04 19:28:06 -0700
commit2c7da66570999dcd21f11f976dc6ec27d820f45c (patch)
treeb97dd9f25df691c66b2be31b658cc6fec638d47e /modules/openssh/templates
parenta69863ece1973cf3eae488f30c657b57dfb89779 (diff)
downloadpuppet-2c7da66570999dcd21f11f976dc6ec27d820f45c.tar
puppet-2c7da66570999dcd21f11f976dc6ec27d820f45c.tar.gz
puppet-2c7da66570999dcd21f11f976dc6ec27d820f45c.tar.bz2
puppet-2c7da66570999dcd21f11f976dc6ec27d820f45c.tar.xz
puppet-2c7da66570999dcd21f11f976dc6ec27d820f45c.zip
Use @ when accessing variables in templates
Access without the @ symbol is the older method and is discouraged.
Diffstat (limited to 'modules/openssh/templates')
-rwxr-xr-xmodules/openssh/templates/ldap-sshkey2file.py10
-rw-r--r--modules/openssh/templates/sshd_config2
2 files changed, 6 insertions, 6 deletions
diff --git a/modules/openssh/templates/ldap-sshkey2file.py b/modules/openssh/templates/ldap-sshkey2file.py
index 6718b053..e59545b3 100755
--- a/modules/openssh/templates/ldap-sshkey2file.py
+++ b/modules/openssh/templates/ldap-sshkey2file.py
@@ -15,18 +15,18 @@ except ImportError:
print("Please install python-ldap before running this program")
sys.exit(1)
-basedn = "<%= dc_suffix %>"
+basedn = "<%= @dc_suffix %>"
peopledn = f"ou=people,{basedn}"
<%-
ldap_servers.map! { |l| "'ldaps://#{l}'" }
-%>
-uris = [<%= ldap_servers.join(", ") %>]
+uris = [<%= @ldap_servers.join(", ") %>]
random.shuffle(uris)
uri = " ".join(uris)
timeout = 5
-binddn = f"cn=<%= fqdn %>,ou=Hosts,{basedn}"
-ldap_secret_file = "<%= ldap_pwfile %>"
-nslcd_conf_file = "<%= nslcd_conf_file %>"
+binddn = f"cn=<%= @fqdn %>,ou=Hosts,{basedn}"
+ldap_secret_file = "<%= @ldap_pwfile %>"
+nslcd_conf_file = "<%= @nslcd_conf_file %>"
# filter out disabled accounts also
# too bad uidNumber doesn't support >= filters
objfilter = "(&(objectClass=inetOrgPerson)(objectClass=ldapPublicKey)(objectClass=posixAccount)(sshPublicKey=*))"
diff --git a/modules/openssh/templates/sshd_config b/modules/openssh/templates/sshd_config
index 43c3f9c5..31a9e1f7 100644
--- a/modules/openssh/templates/sshd_config
+++ b/modules/openssh/templates/sshd_config
@@ -124,7 +124,7 @@ UsePrivilegeSeparation yes
# override default of no subsystems
<% if scope.function_versioncmp([lsbdistrelease, '6']) < 0 -%>
-Subsystem sftp <%= path_to_sftp %>/sftp-server
+Subsystem sftp <%= @path_to_sftp %>/sftp-server
<% else %>
Subsystem sftp /usr/libexec/openssh/sftp-server
<% end %>