From 2948da5d2f4883dd7287a84db4060b58c0a1de84 Mon Sep 17 00:00:00 2001 From: staffadmin Date: Mon, 25 Sep 2023 01:17:05 +0200 Subject: [PATCH] good night --- chisel.yml | 59 +++++++++++++++++++++++++-------------- host_vars/ovh_fr.yml | 6 +++- host_vars/scaleway_fr.yml | 12 ++++---- 3 files changed, 49 insertions(+), 28 deletions(-) diff --git a/chisel.yml b/chisel.yml index fe64dd4..209414d 100644 --- a/chisel.yml +++ b/chisel.yml @@ -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 \ No newline at end of file diff --git a/host_vars/ovh_fr.yml b/host_vars/ovh_fr.yml index 338df82..4783db9 100644 --- a/host_vars/ovh_fr.yml +++ b/host_vars/ovh_fr.yml @@ -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 \ No newline at end of file + - deb http://security.ubuntu.com/ubuntu focal-security multiverse + + + +chisel_server: false \ No newline at end of file diff --git a/host_vars/scaleway_fr.yml b/host_vars/scaleway_fr.yml index 6e6f649..5dddf80 100644 --- a/host_vars/scaleway_fr.yml +++ b/host_vars/scaleway_fr.yml @@ -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" \ No newline at end of file + regexp: "^socks5 {{ chisel_server_host }} 1080" + state: present \ No newline at end of file