Open tadeboro opened 6 years ago
Files identified in the description:
If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
Can you detail how you check "tftp.socket is not modified at all." ?
When tftp
-related services are disabled and stopped, systemctl
has this to say about the system:
$ systemctl status tftp
● tftp.service - Tftp Server
Loaded: loaded (/usr/lib/systemd/system/tftp.service; indirect; vendor preset: disabled)
Active: inactive (dead)
Docs: man:in.tftpd
$ systemctl status tftp.socket
● tftp.socket - Tftp Server Activation Socket
Loaded: loaded (/usr/lib/systemd/system/tftp.socket; disabled; vendor preset: disabled)
Active: inactive (dead)
Listen: [::]:69 (Datagram)
Running the sample playbook against this host outputs:
$ ansible-playbook -i inventory x.yml
PLAY [all] ***********************************************************
TASK [Gathering Facts] ***********************************************
ok: [172.16.93.126]
TASK [start tftp server] *********************************************
ok: [172.16.93.126]
PLAY RECAP ***********************************************************
172.16.93.126 : ok=2 changed=0 unreachable=0 failed=0
Ansible reported no change, which is not right, since it should enable tftp.socket
. If I query systemd
for service statuses again, I get back the same statuses as before, confirming that ansible skipped the enable part:
$ systemctl status tftp
● tftp.service - Tftp Server
Loaded: loaded (/usr/lib/systemd/system/tftp.service; indirect; vendor preset: disabled)
Active: inactive (dead)
Docs: man:in.tftpd
$ systemctl status tftp.socket
● tftp.socket - Tftp Server Activation Socket
Loaded: loaded (/usr/lib/systemd/system/tftp.socket; disabled; vendor preset: disabled)
Active: inactive (dead)
Listen: [::]:69 (Datagram)
Enabling tftp
service using systemd
reports this:
# systemctl enable tftp
Created symlink /etc/systemd/system/sockets.target.wants/tftp.socket → /usr/lib/systemd/system/tftp.socket.
And this is the status output after that command:
$ systemctl status tftp
● tftp.service - Tftp Server
Loaded: loaded (/usr/lib/systemd/system/tftp.service; indirect; vendor preset: disabled)
Active: inactive (dead)
Docs: man:in.tftpd
$ systemctl status tftp.socket
● tftp.socket - Tftp Server Activation Socket
Loaded: loaded (/usr/lib/systemd/system/tftp.socket; enabled; vendor preset: disabled)
Active: inactive (dead)
Listen: [::]:69 (Datagram)
As can be seen from the output, enabling tftp.service
automatically enabled tftp.socket
as instructed by the service file.
Ansible fails to perform this because it interprets the indirect state of the tftp.service
as enabled and skips the enable part of the task.
I noticed this bug when tftp server stopped responding after the reboot.
I can reproduce this issue.
+1
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
Can confirm the same issue in ansible 2.10.4
Is this something which is being worked on?
SUMMARY
Actions that systemd module takes when enabling/disabling a service differ from the actions that calling systemctl from console produces.
ISSUE TYPE
COMPONENT NAME
systemd
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Ansible versions tested:
Hosts being managed were Fedora 28 and CentOS 7.
STEPS TO REPRODUCE
Run the following playbook (we assume here that
tftp-server
package was installed on Fedora/CentOS):Relevant systemd units:
tftp.service
andtftp.socket
EXPECTED RESULTS
tftp.socket
service should be enabled, since this is whatInstall
section of thetftp.service
dictates.ACTUAL RESULTS
tftp.socket
is not modified at all.