---
- name: NextflowWorkbench workflow nodes Playbook
  hosts: workflow_nodes 
  tasks:
  - name: Create target dir
    file: path=/home/ubuntu/config-tools state=directory
    become: yes
    become_user: ubuntu
  - name: Copy installation script to node
    action: copy src="workflow/node-install-packages.sh" dest="/home/ubuntu/config-tools/node-install-packages.sh"
    become: yes
    become_user: ubuntu
  - name: Install workflow packages
    shell: source /home/ubuntu/config-tools/node-install-packages.sh
    args:
      executable: /bin/bash
    become: yes
    become_user: ubuntu
  - name: Add scratch dir
    file: path=/scratch state=directory recurse=yes mode="a+w+r"
    become: yes
    become_user: root
  - name: Hush login messages
    file: path=/home/ubuntu/.hushlogin state=touch
    become: yes
    become_user: ubuntu
  - name: Make sure docker is running
    service: name=docker state=running

---
- name: NextflowWorkbench workflow nodes Playbook
  hosts: workflow_nodes 
  tasks:
  - name: Create target dir
    file: path=/home/ubuntu/config-tools state=directory
    become: yes
    become_user: ubuntu
  - name: Copy installation script to node
    action: copy src="workflow/node-install-packages.sh" dest="/home/ubuntu/config-tools/node-install-packages.sh"
    become: yes
    become_user: ubuntu
  - name: Install workflow packages
    shell: source /home/ubuntu/config-tools/node-install-packages.sh
    args:
      executable: /bin/bash
    become: yes
    become_user: ubuntu
  - name: Add scratch dir
    file: path=/scratch state=directory recurse=yes mode="u+rwx,g+rwx,o+rwx"
    become: yes
    become_user: root
  - name: Hush login messages
    file: path=/home/ubuntu/.hushlogin state=touch
    become: yes
    become_user: ubuntu
  - name: Make sure docker is running
    service: name=docker state=running

Set permissions on scratch dir according to file module requirements.
Set permissions on scratch dir according to file module requirements.
