tenks/ansible/node_enrolment.yml
Will Miller e81eb6d6ca Move deploy image ID finding to enrolment role
The OpenStack client Python package is not necessarily installed in the
Tenks virtualenv until the role is run, so we need to query OpenStack
for the image IDs inside the role.
2018-09-21 16:17:11 +00:00

29 lines
1017 B
YAML

- hosts: localhost
tasks:
- name: Load state from file
include_vars:
file: "{{ state_file_path }}"
name: tenks_state
- name: Check that OpenStack credentials exist in the environment
fail:
msg: >
$OS_USERNAME was not found in the environment. Ensure the OpenStack
credentials exist in your environment, perhaps by sourcing your RC file.
when: not lookup('env', 'OS_USERNAME')
- name: Perform Ironic enrolment for each hypervisor's nodes
include_role:
name: ironic-enrolment
vars:
ironic_deploy_kernel: "{{ deploy_kernel }}"
ironic_deploy_ramdisk: "{{ deploy_ramdisk }}"
ironic_nodes: "{{ alloc.value.nodes }}"
ironic_hypervisor: "{{ alloc.key }}"
ironic_virtualenv_path: "{{ virtualenv_path }}"
ironic_python_upper_constraints_url: >-
{{ python_upper_constraints_url }}
loop: "{{ query('dict', tenks_state) }}"
loop_control:
loop_var: alloc