diff --git a/tasks/main.yml b/tasks/main.yml index 62da5f5..210dd2b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -29,6 +29,7 @@ template: src: chisel-server.conf.j2 dest: "{{ chisel_config_location }}/chisel-server.conf" + mode: 0740 notify: - restart daemon service when: chisel_server == true @@ -47,3 +48,4 @@ name: chisel-server # required. Name of the service. enabled: true # not required. Whether the service should start on boot. B(At least one of state and enabled are required.) state: started # not required. choices: reloaded;restarted;started;stopped. C(started)/C(stopped) are idempotent actions that will not run commands unless necessary. C(restarted) will always bounce the service. C(reloaded) will always reload. B(At least one of state and enabled are required.) Note that reloaded will start the service if it is not already started, even if your chosen init system wouldn't normally. + when: chisel_server == true \ No newline at end of file diff --git a/templates/chisel-server.conf.j2 b/templates/chisel-server.conf.j2 index a79203a..c646ccd 100644 --- a/templates/chisel-server.conf.j2 +++ b/templates/chisel-server.conf.j2 @@ -5,9 +5,8 @@ HOST={{chisel_server_host}} PORT={{chisel_server_port}} {% endif %} {% if chisel_server_auth %} -AUTH={{chisel_server_auth.user}}:{{chisel_server_auth.pass}} +#AUTH={{chisel_server_auth.user}}:{{chisel_server_auth.pass}} {% endif %} -chisel_server_key {% if chisel_server_key %} KEY={{chisel_server_key}} {% endif %} \ No newline at end of file diff --git a/templates/chisel-server.service.j2 b/templates/chisel-server.service.j2 index 8ac9d74..662cdcc 100644 --- a/templates/chisel-server.service.j2 +++ b/templates/chisel-server.service.j2 @@ -8,7 +8,7 @@ Type=simple User={{chisel_user}} Group={{chisel_group}} EnvironmentFile={{chisel_config_location}}/chisel-server.conf -ExecStart={{chisel_bin_location}}/chisel server {{ '--socks5' if chisel_server_socks5}} {{ '--reverse' if chisel_server_reverse}} {{ '--backend {}'.format(chisel_server_backend) if chisel_server_backend}} +ExecStart={{chisel_bin_location}}/chisel server {{ '--socks5' if chisel_server_socks5}} {{ '--reverse' if chisel_server_reverse}} {{ '--backend {}'.format(chisel_server_backend) if chisel_server_backend}} {{ '--auth {0}:{1}'.format(chisel_server_auth.user,chisel_server_auth.pass) if chisel_server_auth }} [Install] WantedBy=multi-user.target \ No newline at end of file