--- - hosts: service remote_user: "{{ user }}" gather_facts: no vars: user: "zeus" tasks: - name: mkdir /usr/local/src become: true file: path: "/usr/local/src" state: directory owner: root group: root mode: '0755' - name: wget mpich become: true shell: "curl -sL https://deb.nodesource.com/setup_15.x -o nodesource_setup.sh" args: chdir: "/usr/local/src" warn: false - name: cp script become: true copy: src: "./files/node.sh" dest: "/usr/local/src" owner: root group: root mode: 0750 - name: exec script become: true shell: "/bin/bash /usr/local/src/node.sh" args: chdir: "/usr/local/src" warn: false # ------------------------ # apt update # ------------------------- - name: apt update packages become: true apt: update_cache: 'yes' force_apt_get: 'yes' upgrade: 'dist' cache_valid_time: 3600 install_recommends: true autoremove: true # ------------------------ # apt install packages # ------------------------- - name: apt install packages become: true apt: update_cache: 'yes' force_apt_get: 'yes' install_recommends: true autoremove: true name: "{{ packages }}" vars: packages: - build-essential - nodejs - name: rm dir mpi become: true file: path: "/usr/local/src" state: absent