bifrost/playbooks/example-deploy-all-available-nodes.yaml
Riccardo Pittau e4ad94c1ea Follow up on "Fix error 601"
Fixing some nits from the precedent patch.

Change-Id: I4eca6c25d44d3dfebb7ee99bcf206c2a9f8e923b
2020-09-03 13:45:13 +02:00

37 lines
1.3 KiB
YAML

# This is an example playbook utilizing role conditionals to permit
# deployment on available nodes.
#
# To utilize:
# export BIFROST_INVENTORY_SOURCE=ironic
# ansible-playbook -vvvv -i inventory/bifrost_inventory.py example-deploy-all-available-nodes.yaml
#
# NOTE(TheJulia): The format of this example will cause hosts to be deployed
# utilizing DHCP on eth0 of Ubuntu/Debian hosts. It is advisable you build
# your deployment image with the dhcp-all-interfaces element when deploying
# other operating systems or if your target node has multiple ethernet
# interfaces.
#
# NOTE(TheJulia): A user could utilize the os_ironic_node_info module with
# another data source such as a YAML or JSON file formats to query ironic,
# and the example role conditionals below to query current status and
# deploy to nodes.
---
- hosts: localhost
connection: local
name: "Collect facts"
become: no
gather_facts: yes
- hosts: baremetal
name: "Create configuration drive files and deploy machines from inventory"
become: no
connection: local
roles:
- role: bifrost-configdrives-dynamic
when:
- provision_state == "available"
- maintenance | bool
- role: bifrost-deploy-nodes-dynamic
when:
- provision_state == "available"
- maintenance | bool