diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2023-12-20 16:58:05 -0800 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2023-12-27 18:17:55 -0800 |
commit | dcc705b50d72d48fd13dd162d2c4522691f4ef31 (patch) | |
tree | 8b663bbfcc7f6d7af63ac472329170bb5b044309 /modules/openssh/manifests | |
parent | b2a295dfb0324038a8952c7ee06bf4ed22ebd75d (diff) | |
download | puppet-dcc705b50d72d48fd13dd162d2c4522691f4ef31.tar puppet-dcc705b50d72d48fd13dd162d2c4522691f4ef31.tar.gz puppet-dcc705b50d72d48fd13dd162d2c4522691f4ef31.tar.bz2 puppet-dcc705b50d72d48fd13dd162d2c4522691f4ef31.tar.xz puppet-dcc705b50d72d48fd13dd162d2c4522691f4ef31.zip |
Port ldap-sshkey2file.py to Python 3
It now also passes pytype and (mostly) flake8 checks.
Diffstat (limited to 'modules/openssh/manifests')
-rw-r--r-- | modules/openssh/manifests/ssh_keys_from_ldap.pp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/modules/openssh/manifests/ssh_keys_from_ldap.pp b/modules/openssh/manifests/ssh_keys_from_ldap.pp index 5528c700..9ea6c139 100644 --- a/modules/openssh/manifests/ssh_keys_from_ldap.pp +++ b/modules/openssh/manifests/ssh_keys_from_ldap.pp @@ -1,24 +1,13 @@ class openssh::ssh_keys_from_ldap inherits server { -if versioncmp($::lsbdistrelease, '7') < 0 { - package { 'python-ldap': } -} else { - package { 'python2-ldap': } -} + package { 'python3-ldap': } $ldap_pwfile = '/etc/ldap.secret' $nslcd_conf_file = '/etc/nslcd.conf' $ldap_servers = get_ldap_servers() -if versioncmp($::lsbdistrelease, '7') < 0 { mga_common::local_script { 'ldap-sshkey2file.py': content => template('openssh/ldap-sshkey2file.py'), - require => Package['python-ldap'] + require => Package['python3-ldap'] } -} else { - mga_common::local_script { 'ldap-sshkey2file.py': - content => template('openssh/ldap-sshkey2file.py'), - require => Package['python2-ldap'] - } -} cron { 'sshkey2file': command => '/bin/bash -c "/usr/local/bin/ldap-sshkey2file.py && ( [[ -f /usr/bin/mgagit && -d /var/lib/git/.gitolite ]] && /bin/su -c \'/usr/bin/mgagit glrun\' - git ) ||:"', |