- name: check/create instance
  hosts: 209.132.184.146
  user: root
  gather_facts: False

  vars_files: 
   - /srv/web/infra/ansible/vars/global.yml
   - "{{ private }}/vars.yml"

  tasks:
  - include: "{{ tasks }}/persistent_cloud.yml"
  - include: "{{ tasks }}/growroot_cloud.yml"

- name: provision instance
  hosts: 209.132.184.146
  user: root
  gather_facts: True

  vars_files: 
   - /srv/web/infra/ansible/vars/global.yml
   - "{{ private }}/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  tasks:
  - include: "{{ tasks }}/cloud_setup_basic.yml"

  # packages needed
  - name: add packages for repo
    action: yum state=present name={{ item }}
    with_items:
    - rsync
    - openssh-clients
    - httpd
    - httpd-tools
    - cronie-noanacron


  - name: mount up disk of persistent storage
    action: mount name=/srv/persist src='LABEL=logstash01' fstype=ext4 state=mounted
    tags:
    - mount_disk

  handlers:
  - include: "{{ handlers }}/restart_services.yml"
