---
#
# This task sets up fasjson-client on a machine.
# It installs the fasjson-client package and a cron job update.
#

- name: install fasjson-client
  package:
    state: present
    name:
    - fasjson-client
  tags:
  - packages
  - fasjson

- name: fasjson-aliases script
  template: src=fasjson-aliases.j2 dest=/usr/local/bin/fasjson-aliases owner=root mode=0755
  tags:
  - config
  - fasjson
  when: fasjson_aliases is defined

- name: fasjson-aliases cron job
  copy: src=fasjson-aliases.cron dest=/etc/cron.d/fasjson-aliases owner=root mode=0644
  tags:
  - config
  - fasjson
  when: fasjson_aliases is defined

- name: fasjson-aliases base static file
  copy: src=aliases.static dest=/etc/aliases.static owner=root mode=0644
  tags:
  - config
  - fasjson
  when: fasjson_aliases is defined

