-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parameter hooks to inventory plugin iocage #9650
Comments
Files identified in the description: If these files are incorrect, please update the |
felixfontein
added a commit
that referenced
this issue
Feb 11, 2025
* Add parameter hooks to inventory plugin iocage. * Add changelog fragment. * Update plugins/inventory/iocage.py Co-authored-by: Felix Fontein <[email protected]> * Parameter renamed to hooks_results * Fix DOCUMENTATION YAML 4-space indentation. * Fix DOCUMENTATION YAML 2-space indentation. * Update changelogs/fragments/9651-iocage-inventory-hooks.yml Co-authored-by: Felix Fontein <[email protected]> * Add note about activated pool mountpoint. --------- Co-authored-by: Felix Fontein <[email protected]>
patchback bot
pushed a commit
that referenced
this issue
Feb 11, 2025
* Add parameter hooks to inventory plugin iocage. * Add changelog fragment. * Update plugins/inventory/iocage.py Co-authored-by: Felix Fontein <[email protected]> * Parameter renamed to hooks_results * Fix DOCUMENTATION YAML 4-space indentation. * Fix DOCUMENTATION YAML 2-space indentation. * Update changelogs/fragments/9651-iocage-inventory-hooks.yml Co-authored-by: Felix Fontein <[email protected]> * Add note about activated pool mountpoint. --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit fdd1331)
felixfontein
pushed a commit
that referenced
this issue
Feb 11, 2025
… hooks to inventory plugin iocage (#9731) Implement #9650 Add parameter hooks to inventory plugin iocage (#9651) * Add parameter hooks to inventory plugin iocage. * Add changelog fragment. * Update plugins/inventory/iocage.py Co-authored-by: Felix Fontein <[email protected]> * Parameter renamed to hooks_results * Fix DOCUMENTATION YAML 4-space indentation. * Fix DOCUMENTATION YAML 2-space indentation. * Update changelogs/fragments/9651-iocage-inventory-hooks.yml Co-authored-by: Felix Fontein <[email protected]> * Add note about activated pool mountpoint. --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit fdd1331) Co-authored-by: Vladimir Botka <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
(Use case: root access on the iocage host is not needed to create inventory.)
The parameter hooks_results is a list of files inside a jail that provide configuration parameters for the inventory. For example,
may provide the IP address of the interface epair0b, obtained by dhclient. Then, the inventory plugin creates the variable iocage_hooks
This can be used to compose ansible_host
Privilege escalation is not needed if the file /var/db/dhclient-hook.address.epair0b is readable by the user logged on to the iocage host.
As a side note: the file in the above example is created by this hook
Issue Type
Feature Idea
Component Name
plugins/inventory/iocage.py
Additional Information
Example 1
Given the jails (as root at iocage host 10.1.0.18)
the configuration
gives
Example 2
This example demonstrates the advantage of silently ignoring failed hooks_results items over explicit error handling.
Given the jails
the below inventory configuration uses iocage_hooks.0 to create ansible_host for the first two DHCP jails. The last jail test_111, with the fixed IP address, defaults to iocage_ip4 because the failed hooks_results item results in iocage_hooks.0 == '-'
Then, the below play
gives (abridged)
Code of Conduct
The text was updated successfully, but these errors were encountered: