2015-12-08 18:24:42 +01:00
|
|
|
- hosts: all
|
|
|
|
connection: local
|
|
|
|
vars:
|
|
|
|
slaves:
|
|
|
|
- distribution: "Ubuntu"
|
|
|
|
version: "12.04"
|
2015-12-18 23:36:17 +01:00
|
|
|
image: "ami-309ddf5a"
|
2015-12-08 18:24:42 +01:00
|
|
|
ssh_user: "ubuntu"
|
|
|
|
platform: "ubuntu-12.04-x86_64"
|
|
|
|
- distribution: "Ubuntu"
|
|
|
|
version: "14.04"
|
2015-12-18 23:36:17 +01:00
|
|
|
image: "ami-d06632ba"
|
2015-12-08 18:24:42 +01:00
|
|
|
ssh_user: "ubuntu"
|
|
|
|
platform: "ubuntu-14.04-x86_64"
|
|
|
|
- distribution: "CentOS"
|
|
|
|
version: "6.5"
|
|
|
|
image: "ami-8997afe0"
|
|
|
|
ssh_user: "root"
|
|
|
|
platform: "centos-6.5-x86_64"
|
|
|
|
- distribution: "CentOS"
|
|
|
|
version: "7"
|
|
|
|
image: "ami-96a818fe"
|
|
|
|
ssh_user: "centos"
|
|
|
|
platform: "centos-7-x86_64"
|
2015-12-18 17:10:57 +01:00
|
|
|
- distribution: "Fedora"
|
|
|
|
version: "23"
|
|
|
|
image: "ami-518bfb3b"
|
|
|
|
ssh_user: "fedora"
|
|
|
|
platform: "fedora-23-x86_64"
|
|
|
|
|
2015-12-08 18:24:42 +01:00
|
|
|
tasks:
|
|
|
|
- debug: var=ansible_version
|
|
|
|
- include: ec2.yml
|
|
|
|
when: groups['dynamic_hosts'] is not defined
|
|
|
|
|
2015-12-18 23:04:51 +01:00
|
|
|
# Have to hardcode these per-slave. We can't even run setup yet so we can't
|
|
|
|
# introspect what they have.
|
|
|
|
- hosts: dynamic_hosts
|
|
|
|
sudo: true
|
2015-12-18 23:38:54 +01:00
|
|
|
gather_facts: False
|
2015-12-18 23:04:51 +01:00
|
|
|
tasks:
|
|
|
|
- name: Install packages that let setup and package manager modules run
|
|
|
|
raw: dnf install -y python2 python2-dnf libselinux-python
|
2015-12-19 00:42:41 +01:00
|
|
|
when: "'fedora-23' in '{{ inventory_hostname }}'"
|
2015-12-18 23:04:51 +01:00
|
|
|
|
2015-12-08 18:24:42 +01:00
|
|
|
- hosts: dynamic_hosts
|
|
|
|
sudo: true
|
|
|
|
vars:
|
|
|
|
credentials_file: ''
|
|
|
|
test_flags: ""
|
|
|
|
make_target: "non_destructive"
|
|
|
|
#pre_tasks:
|
|
|
|
roles:
|
2015-12-09 13:52:43 +01:00
|
|
|
- { role: ansible_test_deps, tags: ansible_test_deps }
|
2015-12-08 18:24:42 +01:00
|
|
|
- { role: run_integration,
|
|
|
|
tags: run_integration,
|
|
|
|
run_integration_test_flags: "{{ test_flags }}",
|
|
|
|
run_integration_credentials_file: "{{ credentials_file }}",
|
|
|
|
run_integration_make_target: "{{ make_target }}", }
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- name: Kill ec2 instances
|
|
|
|
sudo: false
|
|
|
|
local_action:
|
|
|
|
module: ec2
|
|
|
|
state: absent
|
|
|
|
region: 'us-east-1'
|
|
|
|
instance_ids: "{{ hostvars[item]['ec2_instance_ids'] }}"
|
|
|
|
when: hostvars[item]['ec2_instance_ids'] is defined and item == inventory_hostname
|
|
|
|
with_items: groups['dynamic_hosts']
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
ansible_connection: local
|
|
|
|
|
|
|
|
- name: Fail
|
|
|
|
shell: 'echo "{{ inventory_hostname }}, Failed" && exit 1'
|
2015-12-19 18:49:06 +01:00
|
|
|
when: "'rc' not in test_results or test_results.rc != 0"
|