# not working :(
#
#- raw: echo "vagrant" | sudo /var/www/owncloud/occ user:resetpassword vagrant

- name: install required packages
  apt: pkg={{ item }} state=present
  sudo: yes
  with_items:
    - curl
    - git

- name: Retrieve setup script for npm
  get_url: url=https://deb.nodesource.com/setup dest=/tmp/setupnpm

- name: Run setup script for npm
  raw: sudo bash /tmp/setupnpm

- name: install npm
  apt: pkg=npm state=present
  sudo: yes

- name: Install bower through npm
  npm: name=bower global=yes
  sudo: yes

- name: Install required bower packages for ocusagecharts
  raw: cd /var/www/owncloud/apps/ocusagecharts && sudo bower -s install --allow-root | xargs echo

- name: Make ./occ executable
  raw: sudo chmod +x /var/www/owncloud/occ

- name: Enable application ocusagecharts
  raw: sudo /var/www/owncloud/occ app:enable ocusagecharts
# not working :(
#
#- raw: echo "vagrant" | sudo /var/www/owncloud/occ user:resetpassword vagrant

- name: install required packages
  apt: pkg={{ item }} state=present
  sudo: yes
  with_items:
    - curl
    - git


- name: Check if npm is installed
  command: npm --version
  register: npm_check

- name: Retrieve setup script for npm
  get_url: url=https://deb.nodesource.com/setup dest=/tmp/setupnpm
  when: npm_check.stdout.find('1.') != -1

- name: Run setup script for npm
  raw: sudo bash /tmp/setupnpm
  when: npm_check.stdout.find('1.') != -1

- name: install npm
  apt: pkg=npm state=present
  sudo: yes
  when: npm_check.stdout.find('1.') != -1

- name: Install bower through npm
  npm: name=bower global=yes
  sudo: yes
  when: npm_check.stdout.find('1.') != -1

- name: Install required bower packages for ocusagecharts
  raw: cd /var/www/owncloud/apps/ocusagecharts && sudo bower -s install --allow-root | xargs echo

- name: Make ./occ executable
  raw: sudo chmod +x /var/www/owncloud/occ

- name: Enable application ocusagecharts
  raw: sudo /var/www/owncloud/occ app:enable ocusagecharts
Check if npm is installed
Check if npm is installed
