---
# roles/install-ansible/tasks/main.yml

- name: ensure the provision directory exists
  file: state=directory path={{ auto_provision_base_directory }} owner=www-data group=www-data mode=0775
  when: auto_provision_host is defined
  tags: [auto-provision, install-ansible]

- name: clone the ansible repository
  git: repo=git://github.com/ansible/ansible.git
       dest={{ auto_provision_base_directory }}/ansible
       recursive=yes
       version={{ auto_provision_ansible_version }}
       accept_hostkey=yes
  when: auto_provision_host is defined
  tags: [auto-provision, install-ansible]


---
# roles/install-ansible/tasks/main.yml

- name: create the /etc/ansible directory
  file: state=directory path=/etc/ansible owner=root group=root mode=0755
  tags: [auto-provision, ansible]

- name: ensure the provision directory exists
  file: state=directory path={{ auto_provision_base_directory }} owner=www-data group=www-data mode=0775
  when: auto_provision_host is defined
  tags: [auto-provision, install-ansible]

- name: clone the ansible repository
  git: repo=git://github.com/ansible/ansible.git
       dest={{ auto_provision_base_directory }}/ansible
       recursive=yes
       version={{ auto_provision_ansible_version }}
       accept_hostkey=yes
  when: auto_provision_host is defined
  tags: [auto-provision, install-ansible]


Create ansible directory for storing hosts file.
Create ansible directory for storing hosts file.
