bifrost/enroll/enroll.yaml
2015-03-12 21:06:57 +00:00

30 lines
1.6 KiB
YAML

---
- hosts: localhost
connection: local
name: "Enroll hardware from baremetal.csv into Ironic"
sudo: yes
gather_facts: yes
# Todo: Rip vars out, refactor.
tasks:
- name: "Error if variable baremetal_csv_file is not defined"
local_action: fail msg="baremetal_csv_file must be defined for this playbook to execute, please pass option '-e baremetal_csv_file=<path/to/file>'"
when: baremetal_csv_file is not defined
- name: "Validate that CSV file exists"
local_action: stat path={{ baremetal_csv_file }}
register: test_baremetal_csv_file
- name: "Error if file does not exist."
local_action: fail msg="The variable defined for baremetal_csv_file is not to a file. Please define a file and try again."
when: test_baremetal_csv_file.stat.isreg == false
- name: "If testing, enroll virtual machines."
include: virtual_enroll.yaml
when: testing == true
- name: "If no ipmi_bridging value set, or a value of no exists, execute standard sequence."
include: standard_enroll.yaml
when: testing == false and (ipmi_bridging is not defined or ipmi_bridging == "no")
- name: "If ipmi_bridging is set to single, execute single bridge enrollment sequence.."
include: ipmi_bridging_single_enroll.yaml
when: testing == false and (ipmi_bridging is defined and ipmi_bridging == "single")
- name: "If ipmi_bridging is set to single, execute dual bridge enrollment sequence.."
include: ipmi_bridging_dual_enroll.yaml
when: testing == false and (ipmi_bridging is defined and ipmi_bridging == "dual")