---
- hosts: all
  become: true
  tasks:
  - include_tasks: common.yml

  - name: Copy the join command to server location
    copy: 
      src: join-command
      dest: /tmp/join-command.sh
      mode: 0777

  - name: Join the node to cluster
    command: sh /tmp/join-command.sh

  - name: docker status
    service:
       name: docker
       state: started