correct chisel role

This commit is contained in:
vincent 2020-11-25 10:50:28 +01:00
parent cb41f18097
commit 0d46068413
3 changed files with 4 additions and 3 deletions

View File

@ -29,6 +29,7 @@
template: template:
src: chisel-server.conf.j2 src: chisel-server.conf.j2
dest: "{{ chisel_config_location }}/chisel-server.conf" dest: "{{ chisel_config_location }}/chisel-server.conf"
mode: 0740
notify: notify:
- restart daemon service - restart daemon service
when: chisel_server == true when: chisel_server == true
@ -47,3 +48,4 @@
name: chisel-server # required. Name of the service. 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.) 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. 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

View File

@ -5,9 +5,8 @@ HOST={{chisel_server_host}}
PORT={{chisel_server_port}} PORT={{chisel_server_port}}
{% endif %} {% endif %}
{% if chisel_server_auth %} {% if chisel_server_auth %}
AUTH={{chisel_server_auth.user}}:{{chisel_server_auth.pass}} #AUTH={{chisel_server_auth.user}}:{{chisel_server_auth.pass}}
{% endif %} {% endif %}
chisel_server_key
{% if chisel_server_key %} {% if chisel_server_key %}
KEY={{chisel_server_key}} KEY={{chisel_server_key}}
{% endif %} {% endif %}

View File

@ -8,7 +8,7 @@ Type=simple
User={{chisel_user}} User={{chisel_user}}
Group={{chisel_group}} Group={{chisel_group}}
EnvironmentFile={{chisel_config_location}}/chisel-server.conf 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] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target