Create conf dir befire deploying conf file

master
Daniel Berteaud 5 years ago
parent bcdb5e6280
commit 6977c24d37
  1. 2
      WAPT/control
  2. 4
      setup.py

@ -1,5 +1,5 @@
package : fws-openssh package : fws-openssh
version : 8.0.0.0-2 version : 8.0.0.0-3
architecture : all architecture : all
section : base section : base
priority : optional priority : optional

@ -46,11 +46,13 @@ def install():
run(r'netsh advfirewall firewall add rule name="OpenSSH Server" dir=in action=allow protocol=TCP localport=22 enable=yes') run(r'netsh advfirewall firewall add rule name="OpenSSH Server" dir=in action=allow protocol=TCP localport=22 enable=yes')
print(' Deploy sshd_config') print(' Deploy sshd_config')
conf_dir = makepath(os.getenv('ProgramData',r'C:\ProgramData'),'ssh')
mkdirs(conf_dir)
jinja2 = Environment( jinja2 = Environment(
loader=FileSystemLoader('.'), loader=FileSystemLoader('.'),
trim_blocks=True trim_blocks=True
) )
open(makepath(os.getenv('ProgramData',r'C:\ProgramData'),'ssh','sshd_config'),'w').write( open(makepath(conf_dir,'sshd_config'),'w').write(
jinja2.get_template('sshd_config.j2').render( jinja2.get_template('sshd_config.j2').render(
ssh_ciphers = ('+' if variables['ssh_append_ciphers'] == True else '') + ','.join(variables['ssh_ciphers']), ssh_ciphers = ('+' if variables['ssh_append_ciphers'] == True else '') + ','.join(variables['ssh_ciphers']),
ssh_password_auth = variables['ssh_password_auth'] ssh_password_auth = variables['ssh_password_auth']

Loading…
Cancel
Save