- name: Install required packages apt: pkg: - firejail - npm - node-grunt-cli update_cache: yes #- name: Create cyberchef user's npm config dir # become_user: cyberchef # file: # path: /home/cyberchef/.npm-global # state: directory #- name: Set some npm config # become_user: cyberchef # command: npm config set prefix '~/.npm-global && npm config set fetch-retry-mintimeout 30000 && npm config set fetch-retry-maxtimeout 150000' #- name: Set user's path variable # copy: # dest: /home/cyberchef/.profile # content: export PATH=~/.npm-global/bin:$PATH - name: Clone CyberChef repo become: yes 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