mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-03-26 21:43:02 +00:00
Add baremetal_deploy_template module
This module supports managing deploy template resources in OpenStack Ironic. https: //docs.openstack.org/ironic/latest/admin/node-deployment.html#deploy-templates Change-Id: I2d1b89e7cbd1a7e847f54ffd62778f953ba65863
This commit is contained in:
committed by
Shnaidman Sagi (Sergey)
parent
ad9594dcd7
commit
454a05452b
7
ci/roles/baremetal_deploy_template/defaults/main.yml
Normal file
7
ci/roles/baremetal_deploy_template/defaults/main.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
expected_fields:
|
||||
- created_at
|
||||
- extra
|
||||
- id
|
||||
- name
|
||||
- steps
|
||||
- updated_at
|
||||
58
ci/roles/baremetal_deploy_template/tasks/main.yml
Normal file
58
ci/roles/baremetal_deploy_template/tasks/main.yml
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
# TODO: Actually run this role in CI. Atm we do not have DevStack's ironic plugin enabled.
|
||||
- name: Create baremetal deploy template
|
||||
openstack.cloud.baremetal_deploy_template:
|
||||
cloud: "{{ cloud }}"
|
||||
state: present
|
||||
name: CUSTOM_ANSIBLE_DEPLOY_TEMPLATE
|
||||
steps:
|
||||
- interface: bios
|
||||
step: apply_configuration
|
||||
args:
|
||||
settings:
|
||||
- name: some-setting
|
||||
value: some-value
|
||||
priority: 110
|
||||
register: template
|
||||
|
||||
- debug: var=template
|
||||
|
||||
- name: Assert return values of baremetal_deploy_template module
|
||||
assert:
|
||||
that:
|
||||
# allow new fields to be introduced but prevent fields from being removed
|
||||
- expected_fields|difference(template.template.keys())|length == 0
|
||||
|
||||
- name: Update baremetal deploy template
|
||||
openstack.cloud.baremetal_deploy_template:
|
||||
cloud: "{{ cloud }}"
|
||||
state: present
|
||||
id: "{{ template.template.id }}"
|
||||
extra:
|
||||
foo: bar
|
||||
register: updated_template
|
||||
|
||||
- name: Assert return values of updated baremetal deploy template
|
||||
assert:
|
||||
that:
|
||||
- updated_template is changed
|
||||
- updated_template.template.id == template.template.id
|
||||
|
||||
- name: Update baremetal deploy template again
|
||||
openstack.cloud.baremetal_deploy_template:
|
||||
cloud: "{{ cloud }}"
|
||||
state: present
|
||||
id: "{{ template.template.id }}"
|
||||
register: updated_template
|
||||
|
||||
- name: Assert return values of updated baremetal deploy template
|
||||
assert:
|
||||
that:
|
||||
- updated_template is not changed
|
||||
- updated_template.template.id == template.template.id
|
||||
|
||||
- name: Delete Bare Metal deploy template
|
||||
openstack.cloud.baremetal_deploy_template:
|
||||
cloud: "{{ cloud }}"
|
||||
state: absent
|
||||
id: "{{ template.template.id }}"
|
||||
Reference in New Issue
Block a user