- name: Installing Atom
  sudo: no
  homebrew_cask: name=atom state=present

- name: Copying Atom config
  sudo: no
  copy: src=../config_files/ dest=~/.atom/

- name: Add apm symlink
  file: src=/Applications/Atom.app/Contents/Resources/app/apm/node_modules/.bin/apm dest=/usr/local/bin/apm state=link

- name: Add atom symlink
  file: src=/Applications/Atom.app/Contents/Resources/app/atom.sh dest=/usr/local/bin/atom state=link

- name: Install atom packages
  command: apm install {{ item }}
  with_items: atom_packages

- name: Installing Atom
  sudo: no
  homebrew_cask: name=atom state=present

- name: Copying Atom config
  sudo: no
  copy: src=../config_files/ dest=~/.atom/

- name: Add apm symlink
  file: src=/Applications/Atom.app/Contents/Resources/app/apm/node_modules/.bin/apm dest=/usr/local/bin/apm state=link

- name: Add atom symlink
  file: src=/Applications/Atom.app/Contents/Resources/app/atom.sh dest=/usr/local/bin/atom state=link

- name: Check for installed atom packages
  shell: apm list | grep {{ item }}
  with_items: atom_packages
  register: installed_atom_packages
  ignore_errors: true

- name: Install atom packages
  command: apm install {{ item }}
  with_items: atom_packages
  when: item not in installed_atom_packages.results|map(attribute='stdout')

Check for installed atom packages
Check for installed atom packages
