69 lines
2.3 KiB
YAML
69 lines
2.3 KiB
YAML
---
|
|
- name: Chisel Client - Server playbook
|
|
hosts: all
|
|
become: true
|
|
|
|
# #
|
|
# # @author Stéphane Gratias (2021).
|
|
#
|
|
|
|
|
|
roles:
|
|
- { role: justin_p.chisel, tags: chisel-server }
|
|
|
|
tasks:
|
|
# Need to install proxychains
|
|
- name: Change settings in chisel and proxychains conf files | Server
|
|
ansible.builtin.lineinfile:
|
|
path: "{{ item.path }}"
|
|
regexp: "{{ item.regexp }}"
|
|
state: "{{ item.state }}"
|
|
line: "{{ item.line|default(omit) }}"
|
|
loop: "{{ chisel_proxychains_conf }}"
|
|
when: "{{ chisel_server|default(false) }} is true"
|
|
tags: chisel-server
|
|
|
|
- name: Reload service httpd, in all cases
|
|
ansible.builtin.service:
|
|
name: chisel-server
|
|
state: reloaded
|
|
when: "{{ chisel_server|default(false) }} is true"
|
|
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
|
|
|
|
|
|
# Done chisel Server
|
|
# TODO client (no role) remove-client remove-server |