- name: Install required packages apt: pkg: - firejail - npm update_cache: yes - name: Create cyberchef user user: name: cyberchef system: yes - name: Install grunt-cli become_user: cyberchef command: npm install -g grunt-cli - name: Clone CyberChef repo git: repo: https://github.com/gchq/CyberChef.git dest: "{{ cyberchef_root_dir }}" clone: yes update: yes force: yes - name: Patch Gruntfile.js lineinfile: path: "{{ cyberchef_root_dir }}Gruntfile.js" regexp: "fixCryptoApiImports" line: "fixCryptoApiImports: { options: { shell: \"/bin/bash\" }," - name: Set permissions on repo become: yes file: path: "{{ cyberchef_root_dir }}" owner: cyberchef recurse: yes - name: Install CyberChef become_user: cyberchef command: cmd: "npm install" chdir: "{{ cyberchef_root_dir }}" - name: Perform npm audit and fix become_user: cyberchef command: cmd: "npm audit fix" chdir: "{{ cyberchef_root_dir }}" - name: Set systemd service become: yes template: src: cyberchef.service.j2 dest: /etc/systemd/system/cyberchef.service - name: Enable & start cyberchef service: name: cyberchef state: restarted enabled: yes daemon_reload: yes