summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/ansible
Commit message (Collapse)AuthorAgeFilesLines
* Finally remove support for netboot and the boot_option capabilityDmitry Tantsur2022-08-021-6/+0
| | | | | | | | | | | Instance network boot (not to be confused with ramdisk, iSCSI or anaconda deploy methods) is insecure, underused and difficult to maintain. This change removes a lot of related code from Ironic. The so called "netboot fallback" is still supported for legacy boot when boot device management is not available or is unreliable. Change-Id: Ia8510e4acac6dec0a1e4f5cb0e07008548a00c52
* Explicit parameter to distinguish partition/whole-disk imagesDmitry Tantsur2022-01-282-3/+3
| | | | | | | | | | Using kernel/ramdisk makes no sense with local boot, we need a better way. We already have an internal image_type instance parameter, let's make it public. Glance support will be added in the next patch. Change-Id: I4ce5f7a2317d952f976194d2022328f4afbb0258
* Add and document high-level helpers for async stepsDmitry Tantsur2021-10-111-4/+2
| | | | | | | | | | The pattern we use right now is too verbose to even put in documentation. This change adds two more helpers: * deploy_utils.prepare_agent_boot replaces the omnipresent 2-line snippet around task.boot.prepare_ramdisk. * deploy_utils.reboot_to_finish_step adds rebooting to it. Change-Id: I88540268d3bacebda775a0e94015c29a82c2c6a0
* Cache AgentClient on Task, not globallyDmitry Tantsur2021-06-251-5/+1
| | | | | | | | | | | | | | In order to avoid potential cache coherency issues when using a globally cached AgentClient, e.g. with TSL certificates from the IPA, cache the AgentClient on a per task basis. Co-Authored-By: Arne Wiebalck <arne.wiebalck@cern.ch> Story: #2009004 Task: #42678 Change-Id: I0c458c8d9ae673181beb6d85c2ee68235ccef239
* Delay rendering configdriveDmitry Tantsur2021-05-191-1/+1
| | | | | | | | | | | | | When the configdrive input is JSON (meta_data, etc), delay the rendering until the ISO image is actually used. It has two benefits: 1) Avoid storing a large ISO image in instance_info, 2) Allow deploy steps to access the original user's input. Fix configdrive masking to correctly mask dicts. Story: #2008875 Task: #42419 Change-Id: I86d30bbb505b8c794bfa6412606f4516f8885aa9
* Clean up deprecated features of the agent deployDmitry Tantsur2021-05-031-2/+13
| | | | | | | Removes support for non-decomposable deploy steps. Removes support for pre-Wallaby agents. Change-Id: I7bb1e58ecbcb1130e64150f26aa5bd347a24f7d5
* Allow ansible deploys to be fast-trackedVladyslav Drok2021-03-161-8/+22
| | | | Change-Id: I117f51de1a95ca1cb5dc8b5f357819967a050d11
* Replace retrying with tenacityBoden R2021-02-151-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are replacing all usages of the 'retrying' package with 'tenacity' as the author of retrying is not actively maintaining the project. Unit tests will be added/removed where applicable. Tenacity [1] is a fork of retrying, but has improved the interface and extensibility. Our end goal here is removing the retrying package from our requirements. Tenacity provides the same functionality as retrying, but has the following major differences to account for: - Tenacity uses seconds rather than ms as retrying did. - Tenacity has different kwargs for the decorator and Retrying class itself. - Tenacity has a different approach for retrying args by using classes for its stop/wait/retry kwargs. - By default tenacity raises a RetryError if a retried callable times out; retrying raises the last exception from the callable. Tenacity provides backwards compatibility here by offering the 'reraise' kwarg. - For retries that check a result, tenacity will raise if the retried function raises, whereas retrying retried on all exceptions. [1] https://github.com/jd/tenacity Co-Authored-By: Dmitry Tantsur <dtantsur@protonmail.com> Co-Authored-By: Riccardo Pittau <elfosardo@gmail.com> Story: #1635390 Task: #10528 Change-Id: Ie5eb3ddc196505e8f58ed14de9952284598586fb
* Ansible deploy - Ignore invalid devicesJulia Kreger2020-08-211-0/+6
| | | | | | | | | | This change updates the ansible deploy driver to exclude devices with "sr", "loop", and "mem" which can appear in the devices list for consideration as the root device. This change effectively causes them to be ignored. Change-Id: I72a422553ee992d313b83df091af2c9deb8393b5
* Decompose the core deploy step on iscsi and ansible deployMark Goddard2020-07-131-28/+30
| | | | | | | | | | Following the decomposition of the core step on the 'direct' deploy interface, this change decomposed the iscsi and ansible deploy. Co-Authored-By: Dmitry Tantsur <dtantsur@protonmail.com> Change-Id: I537c6f6cf66c80b67b9045ea0618b02b7b93d36c Story: #2006963 Task: #40152
* Raise human-friendly messages on attempt to use pre-deploy steps driversDmitry Tantsur2020-03-251-0/+3
| | | | | | | | | | This is a follow up to commit 529c3ff06693d0a1aa13081acff92010fe855c50. It adds a proper exception on missing deploy steps and provides a proper deprecation for the compatibility code when trying to continue deploy for a node in the DEPLOYING state. Change-Id: I6dc176c12a913cb481164a90881bb1c3107b36eb Story: #2006963
* Merge "Remove compatibility with pre-deploy steps drivers"Zuul2020-03-171-8/+1
|\
| * Remove compatibility with pre-deploy steps driversDmitry Tantsur2020-03-121-8/+1
| | | | | | | | | | | | | | It was supposed to be removed in Stein, so should be fine to do now. Change-Id: I4996961b86be5ccc27b6c1066c1560564fe5cd41 Story: #2006963
* | Change readfp to read_fileIury Gregory Melo Ferreira2020-03-131-1/+1
|/ | | | | | | | readfp was deprecated since version 3.2 see [1] [1] https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.readfp Change-Id: I41ef623b662ac7f228ade3a01a2f177f8e64f26c
* Refactoring: rename agent_base_vendor to agent_baseDmitry Tantsur2020-02-191-1/+1
| | | | | | | There is no longer a common vendor passthru, so the current name does not make much sense. Change-Id: I1610e54774826de369be0fef88e98bdf3f64ae1d
* Follow up to root device hints in instance_infoDmitry Tantsur2020-01-211-8/+3
| | | | | | | | | | Follow-up to commit 42dc9787e52670bb1e1baa36f08703dd802804f4: * Refactor root device checking code to be in one place and extend the error message. * Extend unit tests to cover the actual override. * Update documentation. Change-Id: I1d73f2233c766ff52268e242b8071dec12b2daca
* Allow reading root_device from instance_infoDmitry Tantsur2020-01-081-1/+1
| | | | | | | | | | For the future deployment API we need to be able to set root_device per deployment in addition to per node. This change adds it. Change-Id: I1dd046c2e5fca211a84290bac8daa7550b21614f Depends-On: https://review.opendev.org/701043 Story: #2006910 Task: #37556
* Stop using six libraryRiccardo Pittau2019-12-232-4/+3
| | | | | | | | | | Since we've dropped support for Python 2.7, it's time to look at the bright future that Python 3.x will bring and stop forcing compatibility with older versions. This patch removes the six library from requirements, not looking back. Change-Id: Ib546f16965475c32b2f8caabd560e2c7d382ac5a
* Using loop instead of with_XRiccardo Pittau2019-10-241-1/+1
| | | | | | | | | The loop keyword is the current recommended way to handle loops, and supports filters. It's available since Ansible version 2.5 so changing ansible requirement in driver-requirements. Change-Id: Ibff1f07ca00b8f5a5274d73f9e53196f49c33a66
* Use new shiny Devices class instead of old ugly DeviceRiccardo Pittau2019-10-211-1/+1
| | | | | | | | | | The pyudev library migrated teh Device class to Devices and while all the old methods still work, it's marked for removal in one of the next releases. Updating to the new class will probably prevent some headaches. Change-Id: I4a4c7ce7b5139af9c8886a759979d5b3f5bf8b8d
* Merge "Pass target_raid_config field to ironic variable"Zuul2019-08-231-3/+12
|\
| * Pass target_raid_config field to ironic variableGaëtan Trellu2019-08-221-3/+12
| | | | | | | | | | | | | | | | | | | | In order to create/delete RAID configuration via the Ansible driver we should be able to retrieve the JSON target_raid_config data from the node. Change-Id: Ie1bbefbc438a6c7f4592ea96ff84d2d5eb2d412d Story: 2006417 Task: 36307
* | Make ironic_log Ansible callback Python 3 readyGaëtan Trellu2019-08-191-2/+2
|/ | | | | | | | | Add Python version detection to decide which of configparser (3) or ConfigParser (2) should be imported. Change-Id: If80095ca553d98e5e7b7a3818324fd730e9ddc8e Story: 2006418 Task: 36308
* Ansible: fix partition_configdrive for logical root_devicesRaphael Glon2019-08-131-2/+20
| | | | | | | | | If the node root_device is a logical drive (like an md array, or a logical volume), partition_configdrive.sh was not working correctly. Change-Id: Ida4f91efba0f38f20cd80dd6b6162a77af8d6b78 Story: #2006334 Task: #36082
* Ansible driver: fix deployment with serial specified as root device hintRaphael Glon2019-07-261-1/+4
| | | | | | Change-Id: Ie0d56da52ae8476d9f9860c967e8e31253a63c5b Story: #2006275 Task: #35975
* Fix serial/wwn gathering for ansible+python3Raphael Glon2019-07-231-1/+1
| | | | | | Change-Id: Ifd0c3d6be14c9e1369624bb4a02043e7345f4a03 Story: #2006266 Task: #35957
* Ansible module: fix deployment for private and/or shared imagesRaphael Glon2019-07-091-1/+15
| | | | | | | | | | The ansible module deployment was broken for private/shared images because the original request context was not available anymore at the time the image informations were fetched Change-Id: Id35dcf8ddc209bb8318433d6bf26aba848e074ee Story: #2006178 Task: #35702
* Ansible module: fix configdrive partition creation stepRaphael Glon2019-06-061-16/+8
| | | | | | | | | Fix node deployment: failed on configdrive partitioning step on some block types (like NVMe drives) Change-Id: I10fef7b6c0fa45956a31ddbded907af52e12f336 Story: #2005764 Task: #33476
* Merge "Ansible module: fix clean error handling"Zuul2019-04-131-11/+4
|\
| * Ansible module: fix clean error handlingRaphael Glon2019-04-081-11/+4
| | | | | | | | | | | | | | | | | | | | | | It should not be up to the driver to handle the error. The error should reach the manager. Moreover, handling the error in the driver and returning nothing caused the manager to consider the step done and go to the next one instead of interrupting the cleaning workflow Change-Id: I3825838b5507bc735d983466aa3cac0edd4dfaca Story: #2005357 Task: #30315
* | Merge "Ansible module: fix partition_configdrive.sh file"Zuul2019-04-111-2/+3
|\ \
| * | Ansible module: fix partition_configdrive.sh fileRaphael Glon2019-04-111-2/+3
| |/ | | | | | | | | | | | | | | | | | | Images with GPT partition tables could not be deployed correctly The if condition could never be met due to an invalid syntax, leading to partitioning failure Change-Id: I11202b115f9b80e8c853dca36cc66ab0eb8f7dea Story: #2005357 Task: #30317
* | Ansible module fix: stream_urlRaphael Glon2019-04-041-1/+1
|/ | | | | | | | | python-requests api misused (invalid kw). raw images could not be streamed correctly down to the host Change-Id: I2a2d9bd92899c4d93bf7bceefa9a01d80328b762 Story: #2005357 Task: #30316
* Deploy Templates: factor out ironic.conductor.stepsMark Goddard2019-03-151-1/+2
| | | | | | | | | There is enough steps code in conductor.utils to warrant a separate module. Change-Id: I0126e860210bbc56991876f26e64d81d3d7d5c08 Story: 1722275 Task: 29902
* Adding ansible python interpreter as driver_infoRiccardo Pittau2019-03-131-3/+10
| | | | | | | | | | | This patch grants the possibility to change the ansible python interpreter used on remote managed machines as per-node driver_info option. Follw-up of https://review.openstack.org/641376 Change-Id: Ic1a994970a5aef5bbbbaaa747818e7ac402912ad Story: 2005159 Task: 29915
* Add option to set python interpreter for ansibleRiccardo Pittau2019-03-071-0/+3
| | | | | | | | | | | | | | This patch adds the option to configure the python interpreter that is used when deploying machines using the ansible deploy interface. Also set the default interpreter for tinyipa image with ansible deploy interface to /usr/bin/python3 on devstack and marks ironic-standalone job as voting again. Change-Id: I8eb58fb00980c9e8946e3b3ef77611a9f5212668 Story: #2005159 Task: #29877
* Add support for Smart NICsHamdy Khader2019-02-071-0/+17
| | | | | | | | | | | | | | | | Extend Ironic to enable use of Smart NICs to implement generic networking services for baremetal servers. Extending the ramdisk, direct, iscsi and ansible deployment Interfaces to support the Smart NIC use-cases. For Smart NIC use-case the baremetal node must be powered on and booted into bios then wait for agent that runs on the Smart NIC to be alive then do the network changes required. Task: #26932 Story: #2003346 Change-Id: I00d6f13dd991074e4f45ada4d7cf4ccc0edbc7e1
* Deploy steps - conductor & driversMark Goddard2018-07-111-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a 'deploy_step' decorator. A deploy step must take as the only positional argument, a TaskManager object. A step can be executed synchronously or asynchronously. A step should return None if the method has completed synchronously or states.DEPLOYWAIT if the step will continue to execute asynchronously. If the step executes asynchronously, it should issue a call to the 'continue_node_deploy' RPC, so the conductor can begin the next deploy step. Only steps with priorities greater than 0 are used. These steps are ordered by priority from highest value to lowest value. For steps with the same priority, they are ordered by driver interface priority (see conductor.manager.DEPLOYING_INTERFACE_PRIORITY). All in-tree DeployInterfaces are converted to have one big deploy_step (their existing deploy() method). A new RPC method 'continue_node_deploy' (RPC API version 1.45) is used by deploy steps to notify the conductor to continue node deployment (e.g. execute the next deploy step). Similar to cleaning, the conductor gets the node's deploy steps and executes them, one at a time (one deploy step right now). The conductor also handles out-of-tree drivers that don't have deploy steps yet; a warning is logged in these cases. Co-Authored-By: Ruby Loo <rloo@oath.com> Change-Id: I5feac3856cc4b87a850180b7fd0b3b9805f9225f Story: #1753128 Task: #22592
* Remove deprecated ansible driver optionsPavlo Shchelokovskyy2018-06-071-25/+4
| | | | | | | | these are ansible_deploy_username and ansible_deploy_key_file. Operators will have to set ansible_username and ansible_key_file node drover_info fields instead. Change-Id: I12a65aed63e4d1889f403ed8cdff1489ff762628
* Silence F405 errorsJulia Kreger2018-05-093-3/+3
| | | | | | | | | | The F405 errors that were present in our repository are a common pattern for ansible modules. As such, They have been marked for noqa. Change-Id: Ie161bf38b00f5e798a470b16700925f9ef7b322d Story: #2001985
* Make ansible error message clearerJim Rollenhagen2018-04-171-3/+3
| | | | | | | | Given classic drivers are deprecated, it no longer makes sense to log the driver name here. Hardcode it to point at the ansible deploy interface instead. Change-Id: If079f9e9f3e56f730deaf06b0b506b5a48d2ffae
* Fix callback plugin for Ansible 2.5 compatabilityJulia Kreger2018-04-061-3/+7
| | | | | | | | | Ansible 2.5 changed an internal callback method around that is expected in plugins for options. In order for this to work, we needed to make some minor changes. Change-Id: I3801f339511155a4b8ecab91bb06b286b11c0a06 Related-Bug: #1758462
* Merge "[ansible] add defaults to config"Zuul2017-12-211-47/+74
|\
| * [ansible] add defaults to configPavlo Shchelokovskyy2017-12-201-47/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a homogeneous hardware deployment that uses the same ramdisk for all nodes, and possibly the same playbooks for actions with ansible deploy interface, it is benefitial to make defaults of various `ansible_` driver_info fields to be configurable via ironic configuration file to simplify node enrollment. This patch also deprecates `ansible_deploy_username` and `ansible_deploy_key_file` options in node's driver_info in favor of `ansible_username` and `ansible_key_file` respectively. Change-Id: Ib198c07c1d414c0d78950e5d98a5176e12a7df13 Closes-Bug: #1736409
* | ansible: handle mount of /sys the same way IPA does itDmitry Tantsur2017-12-202-3/+12
|/ | | | | | | | | | * Mount with -t sysfs instead of a bind mount * Retry umounting of each directory several times. I'm seeing occasional failures unmounting /sys, as it's still busy. This patch should fix it. Change-Id: I4bc6dfd6939699f7a4ed7cc59e2e503b46bbaeaf
* Add ansible deploy interfacePavlo Shchelokovskyy2017-11-0933-0/+1567
this patch pulls the ansible deploy interface code and related ansible playbooks and auxiliary files from ironic-staging-drivers project into main ironic tree. As discussed in the spec, the use of ramdisk callbacks (lookup and hearbeats) is now mandatory with this deploy interface. Playbooks and modules were updated to require Ansible>=2.4, and custom Ansible module for executing 'parted' was replaced with usage of built-in Ansible module. The custom Ansible callback plugin now uses journald logger by default to adapt to the default DevStack setup. Documentation and devstack plugin changes enabling automated testing of this interface will be proposed in followup patches. Change-Id: I43f54688287953ccb1c2836437aea76236e6560b Related-Bug: #1526308