I’ve recently started running into a problem that I didn’t have before I upgraded from ansible 2.0.1.0 to 2.0.2.0. I don’t conclusively know whether the upgrade itself is responsible for the new behavior I’m seeing.
When executing a playbook against a vanilla Centos 7 installation, execution of the playbook terminates shortly after the first time I use ansible to enable the firewalld service. A few seconds after firewalld is enabled, whatever playbook step that happens to be running fails with “Failed to transfer file”… “connection closed by remote host”. Re-executing the playbook again works fine.
Setting retry on the playbook will likely fix my problem, although I’d like to understand why this is now necessary, whereas before it wasn’t.
UPDATE: This problem only seems to occur when I’m using an SSH proxy to connect to the target. Introducing a 5 second pause after enabling firewalld seems to prevent the connection from failing, but who knows why I need to do that.
UPDATE: Here’s what appears in my logs when ansible causes my connection to be terminated:
May 13 16:03:51 localhost systemd: Started Session 16 of user root.
May 13 16:03:51 localhost ansible-service: Invoked with name=firewalld pattern=None enabled=True state=started sleep=3 arguments= runlevel=default
May 13 16:03:51 localhost systemd: Reloading.
May 13 16:03:52 localhost systemd: Starting firewalld - dynamic firewall daemon…
May 13 16:03:52 localhost NetworkManager[3050]: nm_connection_get_setting_connection: assertion NM_IS_CONNECTION (connection)' failed May 13 16:03:52 localhost NetworkManager[3050]: nm_connection_get_setting_connection: assertion
NM_IS_CONNECTION (connection)’ failed
May 13 16:03:52 localhost NetworkManager[3050]: nm_connection_get_setting_connection: assertion NM_IS_CONNECTION (connection)' failed May 13 16:03:52 localhost NetworkManager[3050]: nm_connection_get_setting_connection: assertion
NM_IS_CONNECTION (connection)’ failed
May 13 16:03:52 localhost NetworkManager[3050]: nm_connection_get_setting_connection: assertion NM_IS_CONNECTION (connection)' failed May 13 16:03:52 localhost NetworkManager[3050]: nm_connection_get_setting_connection: assertion
NM_IS_CONNECTION (connection)’ failed
May 13 16:03:52 localhost NetworkManager[3050]: nm_connection_get_setting_connection: assertion NM_IS_CONNECTION (connection)' failed May 13 16:03:52 localhost NetworkManager[3050]: nm_connection_get_setting_connection: assertion
NM_IS_CONNECTION (connection)’ failed
May 13 16:03:52 localhost NetworkManager[3050]: nm_connection_get_setting_connection: assertion NM_IS_CONNECTION (connection)' failed May 13 16:03:52 localhost NetworkManager[3050]: nm_connection_get_setting_connection: assertion
NM_IS_CONNECTION (connection)’ failed
May 13 16:03:52 localhost NetworkManager[3050]: nm_connection_get_setting_connection: assertion `NM_IS_CONNECTION (connection)’ failed
May 13 16:03:52 localhost systemd: Started firewalld - dynamic firewall daemon.
May 13 16:03:52 localhost systemd-logind: Removed session 16.
Note that I’ve tried to supply a sleep time of 3. This didn’t help.
UPDATE: Ignore the system logs I reported above. That same output happens even if I execute “systemctl start firewalld” through means other than ansible.