diff --git a/playbooks/enroll-dynamic.yaml b/playbooks/enroll-dynamic.yaml index 452d7fbeb..95ff6d92a 100644 --- a/playbooks/enroll-dynamic.yaml +++ b/playbooks/enroll-dynamic.yaml @@ -10,3 +10,4 @@ become: no roles: - role: ironic-enroll-dynamic + - { role: ironic-inspect-node, when: inspect_nodes | default('false') | bool } diff --git a/playbooks/roles/ironic-inspect-node/README.md b/playbooks/roles/ironic-inspect-node/README.md new file mode 100644 index 000000000..bcc730008 --- /dev/null +++ b/playbooks/roles/ironic-inspect-node/README.md @@ -0,0 +1,57 @@ +ironic-inspect-node +=================== + +Invokes ironic node introspection logic using the os_ironic_inspect module. + +Requirements +------------ + +None at this time. See Dependencies. + +Role Variables +-------------- + +uuid: The UUID of the node to invoke ironic node introspection upon. + This variable is not required if the node name is supplied as + ironic requires unique names. + +name: A node name to invoke inspection upon. This variable is not + required if the node uuid value is supplied. + +Dependencies +------------ + +This role is dependent upon the os_ironic_inspect module being +available for use. + +Example Playbook +---------------- + +hosts: testvm + name: "Introspect node" + sudo: no + gather_facts: no + roles: + - role: ironic-inspect-node + +License +------- + +Copyright (c) 2015 Hewlett-Packard Development Company, L.P. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Author Information +------------------ + +Ironic Developers diff --git a/playbooks/roles/ironic-inspect-node/defaults/main.yml b/playbooks/roles/ironic-inspect-node/defaults/main.yml new file mode 100644 index 000000000..8ee09e96e --- /dev/null +++ b/playbooks/roles/ironic-inspect-node/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for ironic-inspect-node diff --git a/playbooks/roles/ironic-inspect-node/handlers/main.yml b/playbooks/roles/ironic-inspect-node/handlers/main.yml new file mode 100644 index 000000000..5e4baa880 --- /dev/null +++ b/playbooks/roles/ironic-inspect-node/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for ironic-inspect-node diff --git a/playbooks/roles/ironic-inspect-node/meta/main.yml b/playbooks/roles/ironic-inspect-node/meta/main.yml new file mode 100644 index 000000000..2ba6c89c3 --- /dev/null +++ b/playbooks/roles/ironic-inspect-node/meta/main.yml @@ -0,0 +1,24 @@ +--- +galaxy_info: + author: Ironic Developers + description: Invoke ironic node hardware introspection. + company: OpenStack + license: Apache + min_ansible_version: 1.9 + platforms: + - name: EL + versions: + - 7 + - name: Fedora + versions: + - 20 + - name: Ubuntu + versions: + - trusty + - name: Debian + versions: + - wheezy + categories: + - cloud + - cloud:openstack +dependencies: [] diff --git a/playbooks/roles/ironic-inspect-node/tasks/main.yml b/playbooks/roles/ironic-inspect-node/tasks/main.yml new file mode 100644 index 000000000..452585ce3 --- /dev/null +++ b/playbooks/roles/ironic-inspect-node/tasks/main.yml @@ -0,0 +1,21 @@ +# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +--- +- name: "Execute node introspection" + os_ironic_inspect: + auth_type: None + auth: None + ironic_url: "{{ ironic_url }}" + uuid: "{{ uuid }}" + delegate_to: localhost diff --git a/playbooks/roles/ironic-inspect-node/vars/main.yml b/playbooks/roles/ironic-inspect-node/vars/main.yml new file mode 100644 index 000000000..c3db09f90 --- /dev/null +++ b/playbooks/roles/ironic-inspect-node/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for ironic-inspect-node diff --git a/playbooks/test-bifrost-dynamic.yaml b/playbooks/test-bifrost-dynamic.yaml index d7ab75f16..b9a76ff43 100644 --- a/playbooks/test-bifrost-dynamic.yaml +++ b/playbooks/test-bifrost-dynamic.yaml @@ -68,6 +68,7 @@ connection: local roles: - role: ironic-enroll-dynamic + - { role: ironic-inspect-node, when: inspect_nodes | default('false') | bool } - hosts: baremetal name: "Creat configuration drive files and deploy machines." become: no diff --git a/scripts/test-bifrost-build-images.sh b/scripts/test-bifrost-build-images.sh index 6f086ee27..d9ea5bcb2 100755 --- a/scripts/test-bifrost-build-images.sh +++ b/scripts/test-bifrost-build-images.sh @@ -48,7 +48,9 @@ ansible-playbook -vvvv -i inventory/bifrost_inventory.py \ test-bifrost-dynamic.yaml \ -e testing_user=root \ -e download_ipa=false \ - -e create_ipa_image=true + -e create_ipa_image=true \ + -e inspect_nodes=true \ + -e enable_inspector=true EXITCODE=$? if [ $EXITCODE != 0 ]; then @@ -67,4 +69,6 @@ sudo cp /var/log/upstart/ironic-api.log .${LOG_LOCATION}/ sudo chown $USER ${LOG_LOCATION}/ironic-api.log sudo cp /var/log/upstart/ironic-conductor.log ${LOG_LOCATION}/ sudo chown $USER ${LOG_LOCATION}/ironic-conductor.log +sudo cp /var/log/upstart/ironic-inspector.log ${LOG_LOCATION}/ +sudo chown $USER ${LOG_LOCATION}/ironic-inspector.log exit $EXITCODE