---
  - name: "Push waartaa bundle to app servers"
    synchronize: src=../dist/bundle dest={{ waartaa_deploy_path }} recursive=yes


  - name: "Copy waartaa upstart file"
    template: src=waartaa.conf.j2 dest=/etc/init/waartaa.conf mode=644
    sudo: yes


  - name: "Copy newrelic conf"
    template: src=newrelic.js.j2 dest={{ waartaa_deploy_path }}/newrelic.js
    when: newrelic


  - name: "Copy server settings file for Waartaa"
    template: src=settings_local.js.j2 dest={{ waartaa_deploy_path }}/programs/server/app/server/settings-local.js


  - name: "Install npm deps"
    shell: npm install chdir={{ waartaa_deploy_path }}/programs/server

  - name: "Install npm collections package"
    shell: npm install -g collections
    sudo: yes

  - name: "Install oidentd"
    yum: name=oidentd state=present
    sudo: yes

  - name: "Start oidentd service"
    shell: /usr/sbin/oidentd
    sudo: yes

  - name: "Restart Waartaa service"
    shell: initctl stop waartaa; initctl start waartaa
    sudo: yes

---
  - name: "Ensure deployment path exists"
    file: path={{ waartaa_deploy_path }} state=directory

  - name: "Push waartaa bundle to app servers"
    synchronize: src=../dist/bundle/ dest={{ waartaa_deploy_path }}/ recursive=yes

  - name: "Copy waartaa upstart file"
    template: src=waartaa.conf.j2 dest=/etc/init/waartaa.conf mode=644
    sudo: yes


  - name: "Copy newrelic conf"
    template: src=newrelic.js.j2 dest={{ waartaa_deploy_path }}/newrelic.js
    when: newrelic


  - name: "Copy server settings file for Waartaa"
    template: src=settings_local.js.j2 dest={{ waartaa_deploy_path }}/programs/server/app/server/settings-local.js


  - name: "Install npm deps"
    shell: npm install chdir={{ waartaa_deploy_path }}/programs/server

  - name: "Install npm collections package"
    shell: npm install -g collections
    sudo: yes

  - name: "Install oidentd"
    yum: name=oidentd state=present
    sudo: yes

  - name: "Start oidentd service"
    shell: /usr/sbin/oidentd
    sudo: yes

  - name: "Restart Waartaa service"
    shell: initctl stop waartaa; initctl start waartaa
    sudo: yes

Fix ansible script for pushing waartaa's build.
Fix ansible script for pushing waartaa's build.
