good night

This commit is contained in:
2023-09-25 01:17:05 +02:00
parent 7563ddb880
commit 2948da5d2f
3 changed files with 49 additions and 28 deletions

View File

@@ -7,34 +7,51 @@
# # @author Stéphane Gratias (2021).
#
# pre_tasks:
# - name: Start the tempory chisel server in docker
# community.docker.docker_container:
# name: chisel-server
# image: jpillora/chisel
# network_mode: host
# command: ["server", "--socks5", "--reverse", "--port", "8080"]
# published_ports:
# - "8080:8080"
# - "8081:1080"
# when: "{{ chisel_server }} is true"
# tags:
# - chisel
# - test
roles:
# manage docker-compose@dev systemd unit file
- { role: justin_p.chisel, tags: chisel }
- { role: justin_p.chisel, tags: chisel-server }
tasks:
# Need to install proxychains
- name: Change settings in chisel and proxychains conf files
- name: Change settings in chisel and proxychains conf files | Server
ansible.builtin.lineinfile:
path: "{{ item.path }}"
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
state: "{{ item.state }}"
loop: "{{ chisel_proxychains_conf }}"
when: "{{ chisel_server|default(false) }} is true"
tags: chisel
tags: chisel-server
# - name: Ensure gzip is installed | Client
# ansible.builtin.apt:
# name: gzip
# state: present
# when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
# - name: "Download chisel {{ chisel_version }}"
# ansible.builtin.get_url:
# url: "{{ chisel_download_url_linux_amd64 }}"
# dest: "{{ chisel_download_destination }}"
# checksum: "sha256:{{ chisel_linux_amd64_sha256 }}"
# mode: '0600'
# when: not chisel.stat.exists or chisel_version != chisel_installed_version
- name: Unarchive a file that needs to be downloaded (added in 2.0)
ansible.builtin.unarchive:
src: https://example.com/example.zip
dest: /usr/local/bin
remote_src: yes
tags: chisel-client
# - name: Change the working directory to somedir/ and run the command as db_owner if /path/to/database does not exist
# ansible.builtin.command: /usr/bin/make_database.sh db_user db_name
# become: yes
# become_user: db_owner
# args:
# chdir: somedir/
# creates: /path/to/database
# - name: "Unpack chisel to {{ chisel_install_destination }}" # noqa: no-changed-when
# ansible.builtin.shell: "gunzip -c {{ chisel_download_destination }} > {{ chisel_install_destination }}"
# register: gunzip_output
# when: not chisel.stat.exists or chisel_version != chisel_installed_version

View File

@@ -11,4 +11,8 @@ apt_repositories_sources:
- deb http://nova.clouds.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
- deb http://security.ubuntu.com/ubuntu focal-security main restricted
- deb http://security.ubuntu.com/ubuntu focal-security universe
- deb http://security.ubuntu.com/ubuntu focal-security multiverse
- deb http://security.ubuntu.com/ubuntu focal-security multiverse
chisel_server: false

View File

@@ -125,11 +125,11 @@ chisel_server_host: 163.172.84.28
chisel_server_port: 8080
chisel_proxychains_conf:
- path: "/etc/chisel/{{ chisel_config_name }}"
regexp: "^# SOCK5"
line: "SOCK5=--sock5"
regexp: "^SOCK5=--sock5"
state: present
- path: "/etc/proxychains.conf"
regexp: "^socks4"
line: "#socks4"
regexp: "^socks4 127.0.0.1 9050"
state: "absent"
- path: "/etc/proxychains.conf"
regexp: "^# meanwile"
line: "socks5 {{ chisel_server_host }} 1080"
regexp: "^socks5 {{ chisel_server_host }} 1080"
state: present