diff options
author | Dan Fandrich <danf@mageia.org> | 2024-11-20 15:36:06 -0800 |
---|---|---|
committer | Dan Fandrich <danf@mageia.org> | 2024-11-20 15:36:06 -0800 |
commit | 727145ed50d60655590c0199656c2378d32bfffc (patch) | |
tree | 3a95f1ba2f64656879be8c857470155c7bde398d /modules/openssh/templates/ldap-sshkey2file.py | |
parent | 7766681f7ef95a3ad7e6c7c1a26f829ec02d776b (diff) | |
download | puppet-727145ed50d60655590c0199656c2378d32bfffc.tar puppet-727145ed50d60655590c0199656c2378d32bfffc.tar.gz puppet-727145ed50d60655590c0199656c2378d32bfffc.tar.bz2 puppet-727145ed50d60655590c0199656c2378d32bfffc.tar.xz puppet-727145ed50d60655590c0199656c2378d32bfffc.zip |
Use @ when accessing variables in templates
Access without the @ symbol is the older method and is discouraged.
This take leaves alone accesses of variables that are defined within the
template, which don't seem to allow an @.
This is the second batch of files.
Diffstat (limited to 'modules/openssh/templates/ldap-sshkey2file.py')
-rwxr-xr-x | modules/openssh/templates/ldap-sshkey2file.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/openssh/templates/ldap-sshkey2file.py b/modules/openssh/templates/ldap-sshkey2file.py index 6718b053..934e2865 100755 --- a/modules/openssh/templates/ldap-sshkey2file.py +++ b/modules/openssh/templates/ldap-sshkey2file.py @@ -15,7 +15,7 @@ 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}'" } @@ -24,9 +24,9 @@ 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=*))" |