New deploy step for injecting arbitrary files

This change adds a deploy step inject_files that adds a flexible
way to inject files into the instance.
Change-Id: I0e70a2cbc13744195c9493a48662e465ec010dbe
Story: #2008611
Task: #41794 
This commit is contained in:
Dmitry Tantsur
2021年02月12日 17:00:40 +01:00
parent 13c3c60ff1
commit 59cb08fd28

View File

@@ -25,6 +25,52 @@ Deploy steps
and must be used through the :ironic-doc:`ironic RAID feature
<admin/raid.html>`.
Injecting files
~~~~~~~~~~~~~~~
``deploy.inject_files(node, ports, files, verify_ca=True)``
This optional deploy step (introduced in the Wallaby release series) allows
injecting arbitrary files into the node. The list of files is built from the
optional ``inject_files`` property of the node concatenated with the explicit
``files`` argument. Each item in the list is a dictionary with the following
fields:
``path`` (required)
An absolute path to the file on the target partition. All missing
directories will be created.
``partition``
Specifies the target partition in one of 3 ways:
* A number is treated as a partition index (starting with 1) on the root
device.
* A path is treated as a block device path (e.g. ``/dev/sda1`` or
``/dev/disk/by-partlabel/<something>``.
* If missing, the agent will try to find a partition containing the first
component of the ``path`` on the root device. E.g. for
``/etc/sysctl.d/my.conf``, look for a partition containing ``/etc``.
``deleted``
If ``True``, the file is deleted, not created.
Incompatible with ``content``.
``content``
Data to write. Incompatible with ``deleted``. Can take two forms:
* A URL of the content. Can use Python-style formatting to build a node
specific URL, e.g. ``http://server/{node[uuid]}/{ports[0][address]}``.
* Base64 encoded binary contents.
``mode``, ``owner``, ``group``
Numeric mode, owner ID and group ID of the file.
``dirmode``
Numeric mode of the leaf directory if it has to be created.
This deploy step is disabled by default and can be enabled via a deploy
template or via the ``ipa-inject-files-priority`` kernel parameter.
Known limitations:
* Names are not supported for ``owner`` and ``group``.
* LVM is not supported.
Clean steps
-----------
Reference in New Issue
openstack/ironic-python-agent
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.