blob: 3f9a877dce6490fb376a91b5194b751b7c110759 [file] [log] [blame]
---
- hosts: localhost
connection: local
vars:
ansible_config: ~/.ansible
apigee_config: ~/.apigee
playbook_workspace: ~/apigee-workspace/apigee-opdk-playbook-workspace
role_workspace: ~/apigee-workspace/apigee-opdk-role-workspace
host_repo: git@github.com:carlosfrias
repos:
- { workspace: '{{ playbook_workspace }}', repo: apigee-opdk-playbook-installation-single-region }
- { workspace: '{{ playbook_workspace }}', repo: apigee-opdk-playbook-maintenance-aws-management }
- { workspace: '{{ playbook_workspace }}', repo: apigee-opdk-playbook-maintenance-expand-region }
- { workspace: '{{ playbook_workspace }}', repo: local-workspace-maintenance }
- { workspace: '{{ playbook_workspace }}', repo: apigee-opdk-playbook-samples }
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 }}'
- '{{ playbook_workspace }}'
- '{{ role_workspace }}'
- name: Yum packages
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: '{{ host_repo }}/apigee-opdk-ansible-configuration-samples.git'
dest: "{{ ansible_config }}/configurations"
- name: Git checkout of sample inventories
ignore_errors: yes
git:
repo: '{{ host_repo }}/apigee-opdk-ansible-inventory-samples.git'
dest: "{{ ansible_config }}/inventory"
- name: Git checkout of sample playbooks
ignore_errors: yes
git:
repo: '{{ host_repo }}/{{ item.repo }}.git'
dest: "{{ item.workspace }}/{{ item.repo }}"
with_items: "{{ repos }}"
- name: Add empty credentials.yml file to .apigee
copy:
src: resources/credentials.yml
dest: '{{ apigee_config }}/credentials.yml'
force: no