Node import playbook

Include an example playbook that does node import and introspection into
ironic for the deployment.

Change-Id: I40ef775178f8cc11e21e33e7da236055d5928a4f
This commit is contained in:
Alex Schultz 2020-02-10 16:54:04 -07:00
parent 70df46c335
commit 556f4ba310
2 changed files with 52 additions and 0 deletions

View File

@ -8,5 +8,6 @@ tailored to your specific requirements.
Examples
--------
* `import-nodes.yml` - Baremetal node import and introspection playbook
* `standalone.yml` - Standalone playbook for PoC
* `undercloud.yml` - Undercloud installation playbook

View File

@ -0,0 +1,51 @@
---
###############################################################################
# Overcloud node import and introspection playbook
#
# Description:
# This is a basic playbook to import overcloud nodes and kick off node
# introspection.
#
###############################################################################
- hosts: undercloud
collections:
- tripleo.operator
vars:
node_debug: true
node_introspect: true
node_environment_source_json_file: environment.json
tasks:
- name: Gather the rpm package facts
package_facts:
- name: Check if tripleoclient is installed
fail:
msg: >-
TripleO Client is not installed. Please make sure that the client
has been installed and the repositories are properly configured.
when: (ansible_facts.distribution_major_version|int <= 7 and not 'python2-tripleoclient' in ansible_facts.packages) or
(ansible_facts.distribution_major_version|int >= 8 and not 'python3-tripleoclient' in ansible_facts.packages)
- name: Copy environment file to the undercloud
copy:
src: "{{ node_environment_source_json_file }}"
dest: "{{ ansible_env.HOME }}/environment.json"
owner: "{{ ansible_env.USER }}"
mode: "0600"
- name: Run node import
include_role:
name: tripleo_overcloud_node_import
vars:
tripleo_overcloud_node_import_debug: "{{ node_debug }}"
tripleo_overcloud_node_import_environment_file: "{{ ansible_env.HOME }}/environment.json"
# NOTE(mwhahaha): We can do these actions during import, not sure which is better.
- name: Run node introspection
include_role:
name: tripleo_overcloud_node_introspect
vars:
tripleo_overcloud_node_introspect_debug: "{{ node_debug }}"
tripleo_overcloud_node_introspect_all_manageable: true
tripleo_overcloud_node_introspect_provide: true
when: node_introspect|bool