Files
metalsmith/metalsmith_ansible/roles/metalsmith_deployment/tasks/main.yml
Steve Baker a7bd8fe1ae metalsmith_deployment role switch to metalsmith_instances
Instead of wrapping the metalsmith CLI, the metalsmith_deployment role
now uses the metalsmith_instances module. There are differences between
the instances formats of the role and the module which are partially
resolved with a simple transformation module called
metalsmith_deployment_defaults.

A 'candidates' attribute is added to metalsmith_instances, but keeping
the single 'name' attribute to remain compatible with the TripleO
usage.

Unresolved differences between the 2 are described below:

metalsmith_instances doesn't have a per-instance state attribute,
instead it has one state attribute for all instances. I propose that
support for per-instance state is dropped. This was never documented
in the README.rst anyway.

extra_args only applies to a CLI. Apart from --dry-run these arguments
are either for output formatting or Ironic API authentication. I propose
that this option is dropped. A metalsmith_debug arg is added to make
the ouput more verbose.

Change-Id: Ia30620821182c58050813e807cdde50a27d03c15
2020-10-08 09:48:20 +13:00

43 lines
1.4 KiB
YAML

---
- name: Build instance defaults
metalsmith_deployment_defaults:
instances: "{{ metalsmith_instances }}"
defaults:
candidates: "{{ metalsmith_candidates }}"
capabilities: "{{ metalsmith_capabilities }}"
conductor_group: "{{ metalsmith_conductor_group }}"
extra_args: "{{ metalsmith_extra_args }}"
image: "{{ metalsmith_image }}"
image_checksum: "{{ metalsmith_image_checksum }}"
image_kernel: "{{ metalsmith_image_kernel }}"
image_ramdisk: "{{ metalsmith_image_ramdisk }}"
netboot: "{{ metalsmith_netboot }}"
nics: "{{ metalsmith_nics }}"
resource_class: "{{ metalsmith_resource_class }}"
root_size: "{{ metalsmith_root_size }}"
ssh_public_keys: "{{ metalsmith_ssh_public_keys }}"
swap_size: "{{ metalsmith_swap_size }}"
traits: "{{ metalsmith_traits }}"
user_name: "{{ metalsmith_user_name }}"
register: instances
- name: Show instances data
debug:
msg: "{{ instances.instances | to_yaml }}"
when: metalsmith_debug|bool
- name: Provision instances
metalsmith_instances:
instances: "{{ instances.instances }}"
state: "{{ metalsmith_state }}"
wait: true
timeout: "{{ metalsmith_provisioning_timeout }}"
log_level: "{{ 'debug' if metalsmith_debug|bool else 'info' }}"
register: baremetal_reserved
- name: Metalsmith log for reserve instances
debug:
var: baremetal_reserved.logging
when: metalsmith_debug|bool