chore: интерфесы бота
This commit is contained in:
1 parent
5f53cadf89
commit
6d322f36a9
42 files changed
+1731
-111
No files matched your search
@@ -0,0 +1,33 @@
|
||||
# extravars: target_ip
|
||||
#
|
||||
# Превращает сервер в прозрачный прокси: весь трафик, кроме ssh, уходит на target_ip.
|
||||
- name: Redirect traffic to target
|
||||
hosts: target
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- ansible.builtin.import_tasks: tasks/firewall.yml
|
||||
vars:
|
||||
firewall_tcp_ports: [ "{{ ansible_port }}" ]
|
||||
firewall_forward: true
|
||||
|
||||
- name: Enable ip forwarding
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/sysctl.d/90-serverus-forward.conf
|
||||
mode: "0644"
|
||||
content: |
|
||||
net.ipv4.ip_forward = 1
|
||||
|
||||
- name: Apply sysctl
|
||||
ansible.builtin.command: sysctl --system
|
||||
changed_when: false
|
||||
|
||||
- name: Install redirect script
|
||||
ansible.builtin.copy:
|
||||
src: files/redirect.sh
|
||||
dest: /usr/local/sbin/serverus-redirect
|
||||
mode: "0755"
|
||||
|
||||
- name: Redirect traffic
|
||||
ansible.builtin.command: "/usr/local/sbin/serverus-redirect {{ target_ip }}"
|
||||
environment:
|
||||
SSH_PORT: "{{ ansible_port }}"
|
||||
Reference in new issue
Block a user