blob: e6767fa5d36dde60929c3b54b6f1621742251c8a [file] [log] [blame]
---
- hosts: localhost
connection: local
vars:
ansible_config: ~/.ansible
apigee_config: ~/.apigee
workspaces:
- ~/apigee-workspace/opdk-workspace
tasks:
- name: Create ansible configuration folders
file:
path: '{{ item }}'
state: directory
with_items:
- '{{ ansible_config }}/configurations'
- '{{ ansible_config }}/inventory'
- '{{ ansible_config }}/tmp/logs'
- '{{ apigee_config }}'
- name: Yum packages
become: yes
yum:
name: '{{ item }}'
state: present
with_items:
- git
- tree
when: ansible_os_family | lower == 'redhat'
- name: Git checkout of sample configurations
ignore_errors: yes
git:
repo: https://github.com/carlosfrias/apigee-opdk-ansible-configuration-samples.git
dest: "{{ ansible_config }}/configurations"
- name: Git checkout of sample inventories
ignore_errors: yes
git:
repo: https://github.com/carlosfrias/apigee-opdk-ansible-inventory-samples.git
dest: "{{ ansible_config }}/inventory"
- name: Git checkout of sample playbooks
ignore_errors: yes
git:
repo: https://github.com/carlosfrias/apigee-opdk-playbook-samples.git
dest: "{{ item }}/apigee-opdk-playbook-samples"
with_items: "{{ workspaces }}"
- name: Add empty credentials.yml file to .apigee
copy:
src: resources/credentials.yml
dest: '{{ apigee_config }}/credentials.yml'
force: no