From a170e0c37dbe23fe02b3760ed81e5fba9e9331c0 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Fri, 19 Jun 2015 17:55:51 -0400 Subject: [PATCH] Addition of dynamic enrollment and deployment playbooks Adding dynamic enrollment and deployment playbooks that leverage the dynamic inventory functionality. Additionally updated the README to represent these newer playbooks. Change-Id: I072b0d053048843521c4258655c212399a96d83f --- README.rst | 36 ++++++++++++++++++++++------------- playbooks/deploy-dynamic.yaml | 13 +++++++++++++ playbooks/enroll-dynamic.yaml | 12 ++++++++++++ 3 files changed, 48 insertions(+), 13 deletions(-) create mode 100644 playbooks/deploy-dynamic.yaml create mode 100644 playbooks/enroll-dynamic.yaml diff --git a/README.rst b/README.rst index cc21627a1..1552f462e 100644 --- a/README.rst +++ b/README.rst @@ -198,9 +198,17 @@ An example file can be found at inventory/baremetal.csv.example. How this works? --------------- -The enroll.yaml playbook requires a variable (baremetal_csv_file) be set or -passed into the playbook execution. NOTE: This MUST be the full path to the -CSV file to be consumed by the Ansible playbooks and loaded into ironic. +Utilizing the dynamic inventory module, enrollment is as simple as setting +the BIFROST_INVENTORY_SOURCE environment variable to your inventory data +source, and then executing the the enrollment playbook.:: + + export BIFROST_INVENTORY_SOURCE=/tmp/baremetal.json + ansible-playbook -vvvv -i inventory/bifrost_inventory.py enroll-dynamic.yaml + +The legacy enroll.yaml playbook requires a variable (baremetal_csv_file) be +set or passed into the playbook execution. NOTE: This MUST be the full path +to the CSV file to be consumed by the Ansible playbooks and loaded into +ironic. Example:: @@ -216,18 +224,20 @@ split into three separate playbooks based up the setting of ipmi_bridging. Hardware Deployment =================== -Requirements: - -- The baremetal.csv file that was utilized for the enrollment process. - How this works? --------------- -The deploy.yaml playbook is intended to create configdrives for servers, and -initiate the node deployments through Ironic. IPs are injected into the config -drive and are statically assigned. +After the nodes are enrolled, they can be deployed upon. Bifrost is geared to +utilize configuration drives to convey basic configuration information to the +each host. This case is the same between the newer deploy-dynamic.yaml +playbook and the older legacy deploy.yaml playbook. -Example:: +To utilize the newer dynamic inventory based deployment:: + + export BIFROST_INVENTORY_SOURCE=/tmp/baremetal.json + ansible-playbook -vvvv -i inventory/bifrost_inventory.py enroll-dynamic.yaml + +To utilize the legacy csv file based playbook:: ansible-playbook -i inventory/localhost -vvvv deploy.yaml -e baremetal_csv_file=inventory/baremetal.csv @@ -246,8 +256,8 @@ Note: - Cleaning mode is explicitly disabled in the test-bifrost.yaml playbook due to the fact that is an IO intensive operation that can take a great deal of time. -Testing with Virtual Machines -============================= +Legacy - Testing with Virtual Machines +====================================== Bifrost supports using virtual machines to emulate the hardware. All of the steps mentioned above are mostly the same. diff --git a/playbooks/deploy-dynamic.yaml b/playbooks/deploy-dynamic.yaml new file mode 100644 index 000000000..04950621b --- /dev/null +++ b/playbooks/deploy-dynamic.yaml @@ -0,0 +1,13 @@ +--- +- hosts: localhost + connection: local + name: "Collect facts" + sudo: no + gather_facts: yes +- hosts: baremetal + name: "Create configuration drive files and deploy machines from inventory" + sudo: no + connection: local + roles: + - role: bifrost-configdrives-dynamic + - role: bifrost-deploy-nodes-dynamic diff --git a/playbooks/enroll-dynamic.yaml b/playbooks/enroll-dynamic.yaml new file mode 100644 index 000000000..f00f68274 --- /dev/null +++ b/playbooks/enroll-dynamic.yaml @@ -0,0 +1,12 @@ +--- +- hosts: localhost + connection: local + name: "Collect facts" + sudo: no + gather_facts: yes +- hosts: baremetal + connection: local + name: "Enroll hardware from inventory into Ironic" + sudo: no + roles: + - role: ironic-enroll-dynamic