bifrost/playbooks/test-bifrost-dynamic.yaml
Julia Kreger 2d8127aa17 Add initial dynamic deployment role
Addition of a basic role to support dynamic deployment from
an inventory as opposed to a CSV file.

This contains an additional conceptual feature of allowing a user
to override the default instance_info by defining it as a variable.

Updated test-bifrost-dynamic.yaml to incorporate the dynamic
deployment role.

Change-Id: I5e95c4963b3deff74243126385713ac678f38759
2015-06-11 16:43:42 -04:00

82 lines
2.4 KiB
YAML

# Example command line to use:
# ansible-playbook -vvvv -i inventory/bifrost_inventory.py test-bifrost-dynamic.yaml -e use_cirros=true -e testing_user=cirros
---
- hosts: localhost
connection: local
name: "Executes install, enrollment, and testing in one playbook"
sudo: yes
gather_facts: yes
pre_tasks:
- name: "Set default baremetal.csv file if not already defined"
set_fact:
baremetal_csv_file: "/tmp/baremetal.csv"
when: baremetal_csv_file is not defined
- name: "Set ci_testing flag if a list of changes are found in the environment variables"
set_fact:
ci_testing: true
when: lookup('env', 'ZUUL_CHANGES') != ""
- name: "Set ci_testing_zuul if it appears we are running in upstream OpenStack CI"
set_fact:
ci_testing_zuul: true
when: "'bare-trusty' in ansible_hostname"
- name: "Collect process list if running in OpenStack CI"
command: ps aux
when: ci_testing_zuul is defined
- name: "Collect list of listening network sockets if running in OpenStack CI"
shell: netstat -apn|grep LISTEN
when: ci_testing_zuul is defined
roles:
- role: bifrost-create-vm-nodes
- role: ironic-install
cleaning: false
testing: true
- hosts: baremetal
name: "Enroll node with Ironic"
sudo: no
connection: local
roles:
- role: ironic-enroll-dynamic
- hosts: localhost
connection: local
name: "Validates prior to deployment"
sudo: yes
roles:
- role: bifrost-validate-host-for-deploy
- hosts: baremetal
name: "Creat configuration drive files and deploy machines."
sudo: no
connection: local
roles:
- role: bifrost-configdrives-dynamic
- role: bifrost-deploy-nodes-dynamic
- hosts: localhost
connection: local
name: "Executes install, enrollment, and testing in one playbook"
sudo: no
gather_facts: yes
roles:
- role: bifrost-prepare-for-test
# The testvm Host group is added by bifrost-prepare-for-test based
# on the contents of the CSV file.
- hosts: testvm
name: "Tests connectivity to the VM"
sudo: no
gather_facts: no
remote_user: "{{ testing_user }}"
roles:
- role: bifrost-test-vm
- hosts: localhost
connection: local
name: "Unprovisions the test node"
sudo: no
gather_facts: no
roles:
- role: bifrost-unprovision-nodes
- hosts: localhost
connection: local
name: "Unprovisions the test node"
sudo: no
gather_facts: no
roles:
- role: ironic-delete