updated templates

This commit is contained in:
kashapovd 2021-10-28 10:30:02 +00:00
parent 8002c11f22
commit 60b0bdff25
4 changed files with 32 additions and 12 deletions

View File

@ -19,7 +19,7 @@
- iptraf-ng
when: ansible_os_family == "RedHat"
- block: # debina based distros
- block: # debian based distros
- apt: name={{item}} state=latest update_cache=True
with_items:
- iperf3

View File

@ -9,16 +9,36 @@ tap {{ tap_iface_name }} {{ tap_iface_ip_addr }} {{ tap_iface_ip_mask }}
tun {{ tun_iface_name }} {{ tun_iface_ip_addr }} {{ tun_iface_ip_mask }}
{% endif %}
{% if split_tcp_sessions is defined %}
SPLIT_TCP_SESSIONS {{ split_tcp_sessions }}
print_info {{ en_print_info }}
{% endif %}
{% if max_sessions_threshold is defined %}
MAX_SESSIONS_THRESHOLD {{ max_sessions_threshold }}
{% endif %}
{% if min_sessions_threshold is defined %}
MIN_SESSIONS_THRESHOLD {{ min_sessions_threshold }}
{% endif %}
{% if flush_sort_delay_max is defined %}
FLUSH_SORT_DELAY_MAX {{ flush_sort_delay_max }}
{% endif %}
{% if flush_sort_delay_min is defined %}
FLUSH_SORT_DELAY_MIN {{ flush_sort_delay_min }}
{% endif %}
{% if flush_sort_add_time is defined %}
FLUSH_SORT_ADD_TIME {{ flush_sort_add_time }}
{% endif %}
{% if stcp_http_srv_addr is defined and stcp_http_srv_port is defined %}
server_http {{ stcp_http_srv_addr }} {{ stcp_http_srv_port }}
enable_peer_to_peer {{ en_peer_to_peer }}
{% endif %}
{% if en_peer_to_peer == true %}
enable_peer_to_peer 1
{% endif %}
{% if en_print_info == true %}
print_info 1
{% endif %}
{% if stcp_mtu_size is defined %}
INTERFACE_MTU {{ stcp_mtu_size }}
{% endif %}
{% if use_auth == true %}
users {{ users_file_path }}
{% endif %}

View File

@ -5,9 +5,9 @@
# Required-Stop: $local_fs $network $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Sistematics Server v3 (Sep2021)
# Description: Sistematics Server v3
### END INIT INFO
# Date of installation: {{ ansible_date_time.date }}
# Date of installation {{ ansible_date_time.date }}
BASE_DIR="{{ stcp_base_dir }}"
STCP_INSTANCE_NAME="{{ stcp_instance_name }}"
@ -29,19 +29,19 @@ start() {
return 1
fi
echo -e '\033[0;34m[NOTIFY]\033[0m Starting service…' >&2
local CMD="$LOOP $MULTISRV $CFG $STCP_PIDFILE $EXT_IF $PORT_MIN $MODE"
su -c "$CMD" $RUNAS > $DAEMON_LOGFILE 2>&1 &
echo $! > $DAEMON_PIDFILE
local CMD="$LOOP $MULTISRV $CFG $STCP_PIDFILE $EXT_IF $PORT_MIN $MODE &>\"$DAEMON_LOGFILE\" & echo \$!"
su -s /bin/sh -c "$CMD" $RUNAS > $DAEMON_PIDFILE 2>&1 &
echo -e '\033[0;32m[OK]\033[0m Service started' >&2
}
stop() {
if [ ! -f $DAEMON_PIDFILE ] || ! kill -0 $(cat $DAEMON_PIDFILE); then
if [ ! -f $DAEMON_PIDFILE ] || ! kill -0 $(cat $DAEMON_PIDFILE); then
echo -e '\033[1;33m[WARN]\033[0m Service not running' >&2
return 1
fi
echo -e '\033[0;34m[NOTIFY]\033[0m Stopping service…' >&2
pkill -15 -P $(cat $DAEMON_PIDFILE) && rm -f $DAEMON_PIDFILE
kill $(cat $DAEMON_PIDFILE) && rm -f $DAEMON_PIDFILE
sleep 5
echo -e '\033[0;32m[OK]\033[0m Service stopped' >&2
}

View File

@ -10,6 +10,7 @@ stcp_mode: tun
stcp_runas: root
use_auth: no
use_client_logging: yes
#stcp_tuntaps
en_tap_iface: no
tap_iface_name: 'tap_{{ stcp_instance_name }}'
@ -19,5 +20,4 @@ tap_iface_ip_mask: 255.255.255.0
en_tun_iface: yes
tun_iface_name: 'tun_{{ stcp_instance_name }}'
tun_iface_ip_addr: 10.11.1.1
tun_iface_ip_mask: 255.255.255.0
tun_iface_ip_mask: 255.255.255.0