-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Enable service doesn't work with chroot connection #21026
Comments
is there any way to verify the systemd service exists if systemd itself lies to us? |
"found" is set from the output of
|
Just noting that this prevents folks from using service/systemd modules in an installer environment like kickstart/anaconda -- which is counterintuitive because commands like |
sadly list-unit-files won't find init scripts systemd can also manage .... rock meet hard place also it REQUIRES .service ... which is not required by the other commands |
I didn't test yet, but it seems limited to service unit and doesn't handle the timer, socket, etc units
Maybe, unlike service module, name parameter should be the entire name unit for this module |
probably a 'less friendly' approach is required here. I'll remove the 'auto add of .service' and make note in description: |
updated, less friendly now but there is note in docs hinting at using .service/etc names. |
Sorry, I just have time to test and it doesn't work because the rc of |
Just tested this (on 2.3.0.0-r1), and found it is not working. This is because the message |
Sorry to spam a closed bug, but systemctl supports the "--root" option which can be used to specify the chroot location for these operations. Was hoping something like this would work, but DOES NOT:
Ansible outputs:
Where the symlinks are not created in the chroot area... However, hacking something together with the good ole' shell module:
Does work, and creates the expected symlinks under the chroot area for Arch Linux. |
ISSUE TYPE
COMPONENT NAME
systemd/service module
ANSIBLE VERSION
OS / ENVIRONMENT
Arch Linux
SUMMARY
From http://0pointer.de/blog/projects/changing-roots
In chroot environment, ansible fails to enable since this commit ansible/ansible-modules-core@2f50979
The variable "found" keep false value because "systemctl show" doesn't work
Therefore
fail_if_missing(module, found, unit, "cannot %s" % (action))
is triggeredSTEPS TO REPRODUCE
Try to enable a service with chroot connection in systemd environment
EXPECTED RESULTS
Enable the service (symlink created)
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: