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
version : 8.0.0.0-2
version : 8.0.0.0-3
architecture : all
section : base
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')
print(' Deploy sshd_config')
conf_dir = makepath(os.getenv('ProgramData',r'C:\ProgramData'),'ssh')
mkdirs(conf_dir)
jinja2 = Environment(
loader=FileSystemLoader('.'),
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(
ssh_ciphers = ('+' if variables['ssh_append_ciphers'] == True else '') + ','.join(variables['ssh_ciphers']),
ssh_password_auth = variables['ssh_password_auth']

Loading…
Cancel
Save