2c6b462383
Added support for split out playbook executions based on use of ipmi_bridging, along with remaining columns that are presently known to be the minimum required items for deployment to be feasible.
27 lines
1.4 KiB
YAML
27 lines
1.4 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 no ipmi_bridging value set, or a value of no exists, execute standard sequence."
|
|
include: standard_enroll.yaml
|
|
when: 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: 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: ipmi_bridging is defined and ipmi_bridging == "dual"
|