Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Enable service doesn't work with chroot connection #21026
OS / ENVIRONMENT
In chroot environment, ansible fails to enable since this commit ansible/ansible-modules-core@2f50979
STEPS TO REPRODUCE
Try to enable a service with chroot connection in systemd environment
- hosts: /mnt user: root connection: chroot tasks: - name: Enable systemd-timesyncd.service systemd: name: systemd-timesyncd.service enabled: yes
Enable the service (symlink created)
"found" is set from the output of
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
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:
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.