bifrost/playbooks/test-bifrost-create-vm.yaml
Dmitry Tantsur b51efc140f ansible-lint: fix errors 303, 305, 306
303: Using command rather than module
305: Use shell only when shell functionality is required
306: Shells that use pipes should set the pipefail option

Change-Id: Iac23df907354d0b8c82f51b61e3680f44f3f858c
2020-08-24 14:07:13 +02:00

38 lines
1.4 KiB
YAML

# Create a default VM
---
- hosts: localhost
connection: local
name: "Executes install, enrollment, and testing in one playbook"
become: yes
gather_facts: yes
pre_tasks:
- name: "Warn if baremetal_csv_file is defined"
debug:
msg: >
"WARNING - 'baremetal_csv_file' variable is defined.
Its use is deprecated. The file created will be in JSON format.
Use 'baremetal_json_file' variable instead."
when: baremetal_csv_file is defined
- name: "Re-set baremetal json to csv file if defined"
set_fact:
baremetal_json_file: "{{ baremetal_csv_file }}"
when: baremetal_csv_file is defined
- name: "Set default baremetal.json file if not already defined"
set_fact:
baremetal_json_file: "/tmp/baremetal.json"
when: baremetal_json_file is not defined
- name: "Set ci_testing flag if running in the CI"
set_fact:
ci_testing: true
copy_from_local_path: true
git_url_root: "{{ lookup('env', 'WORKSPACE') }}"
when: lookup('env', 'ZUUL_BRANCH') | length > 0
- name: "Collect process list if running in OpenStack CI"
command: ps aux
when: ci_testing | default(false)| bool
- name: "Collect list of listening network sockets if running in OpenStack CI"
shell: netstat -apn|grep LISTEN # noqa 306
when: ci_testing | default(false)| bool
roles:
- role: bifrost-create-vm-nodes