-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi,

I'm not entirely sure whether this should be considered an ansible or
systemctl bug.
This email mainly targets of making others aware of this problem.

If you want to disable (enabled=no) a service on a systemd host which
is still using legacy sysv init.d scripts, ansible will fail to do so.
Systemd in general has a certain degree of backwards compatibility for
such services.

I had a short look in service.py (ansible v1.9.0.1-1).
The module executes
systemctl is-enabled <service>
in line 486 to

I you do this for a legacy service you will get:

"Failed to get unit file state for FOO.service: No such file or director
y"
(retval=1)

I guess this is why ansible believes the service is disabled already,
if it would actually run 'systemctl disable' on this service it would
achieve what one would expect: (manually invoked)

systemctl disable tor
Synchronizing state for tor.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d tor defaults
Executing /usr/sbin/update-rc.d tor disable
insserv: warning: current start runlevel(s) (empty) of script `tor'
overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script
`tor' overrides LSB defaults (0 1 6).

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJVKtS/AAoJEFv7XvVCELh0RKEP+wVkktwXamUplXUyrvOgVDhm
yJdID4jBtvdEXfjWdCXzH7duia5L5PvNXPRo9VLTh2fKYMoPB/ouN4d+wfP+Hu2c
aJEjCROgeYgdOlhMj4FcHOfSCy0pAFid0Xgl6+venAptHORSuhJEOQC3cMs9wY1m
fVlpiqjloAQU7j0wBDF/SuCpueLEz3sSz4Qd+AABnMQyXneEdg0MDzfC5gnYQ2L4
jkl4rFU63NY9p/5IJPPNd7mPkVkcXWD3NrRSFGF4bCOBObkbBEn0iQBqFcEhnLxM
1iHculRb0aU6DZ7Zu0a28Mx3umkmfDTgQSrdKxBJHOizYVow9l9U5PFmgN9HC/mK
iR6jyxKwGWaE4i1qJjYH5i4/9kpch5A58BMbzlHMbqMRQ0TYC3O8tVoA2LCE90PH
GlnwhvhamvcZhjMWpWzx/qIcABJuuACgbS51q79DM5hxfwmP8LoFSjqWIXgSUCBR
qxTxfZcKYAXm+KC/Q3FwqnlPKWb4PojZmFDPK+A6EN4vdQ0FZfuy7rw+CE+X9Ifp
LS42bmNKBhEtSSgyYQd+x0qfwE+LwR/7DJ2DrC3/qqwDXfsTWHWEUsZM5Myq/UO/
Bn6Sz/+DQ6KavXDq47zl2HTUGa++r0kMOqIiLy4j0JpAQ0gcY7LkfaMwYYurscrU
RNXYQhqzhvPZzggmWVSL
=71On
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/552AD4BF.4060609%40openmailbox.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to