b241bc9b93
Separate logic to handle OpenStack CI, and initial git clones out from the main logic pathways in order to make them capable of being more modular. Change-Id: I9367f2333849b3947c715b046c488695706ef783
81 lines
2.7 KiB
YAML
81 lines
2.7 KiB
YAML
# Example command line to use:
|
|
# Create a VM:
|
|
# ansible-playbook -vvvv -i inventory/localhost test-bifrost-create-vm.yaml
|
|
# Set BIFROST_INVENTORY_SOURCE
|
|
# export BIFROST_INVENTORY_SOURCE=/tmp/baremetal.csv
|
|
# Execute the installation and VM startup test.
|
|
# 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: no
|
|
gather_facts: yes
|
|
pre_tasks:
|
|
- name: "Set ci_testing_zuul if it appears we are running in upstream OpenStack CI"
|
|
set_fact:
|
|
ci_testing: true
|
|
ci_testing_zuul: true
|
|
ironic_git_url: /opt/git/openstack/ironic
|
|
ironicclient_git_url: /opt/git/openstack/python-ironicclient
|
|
shade_git_url: /opt/git/openstack-infra/shade
|
|
when: lookup('env', 'ZUUL_BRANCH') != ""
|
|
- name: "Set ci_testing_zuul_changes if ZUUL_CHANGES is set"
|
|
set_fact:
|
|
ci_testing_zuul_changes: true
|
|
when: lookup('env', 'ZUUL_CHANGES') != ""
|
|
- name: "Override the ipv4_gateway setting"
|
|
set_fact:
|
|
ipv4_gateway: "192.168.122.1"
|
|
roles:
|
|
- { role: bifrost-prep-for-install, when: skip_install is not defined }
|
|
- { role: bifrost-openstack-ci-prep, when: ci_testing_zuul is defined }
|
|
- hosts: localhost
|
|
connection: local
|
|
name: "Executes install, enrollment, and testing in one playbook"
|
|
sudo: yes
|
|
gather_facts: yes
|
|
pre_tasks:
|
|
- name: "Collect process list if running in a CI System"
|
|
command: ps aux
|
|
when: ci_testing is defined
|
|
- name: "Collect list of listening network sockets if running in a CI system"
|
|
shell: netstat -apn|grep LISTEN
|
|
when: ci_testing 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: baremetal
|
|
name: "Creat configuration drive files and deploy machines."
|
|
sudo: no
|
|
connection: local
|
|
roles:
|
|
- role: bifrost-configdrives-dynamic
|
|
- role: bifrost-deploy-nodes-dynamic
|
|
- role: bifrost-prepare-for-test-dynamic
|
|
# The testvm Host group is added by bifrost-prepare-for-test based
|
|
# on the contents of the CSV file.
|
|
- hosts: test
|
|
name: "Tests connectivity to the VM"
|
|
sudo: no
|
|
gather_facts: no
|
|
remote_user: "{{ testing_user }}"
|
|
roles:
|
|
- role: bifrost-test-vm
|
|
- hosts: baremetal
|
|
connection: local
|
|
name: "Unprovisions the test node"
|
|
sudo: no
|
|
gather_facts: no
|
|
roles:
|
|
- role: bifrost-unprovision-node-dynamic
|
|
- role: ironic-delete-dynamic
|