LOGBOOK

HELP

Quiz Entry - updated: 2026.11.12

In the lab's certificate block, the rescue prints "one or more configuration changes failed, but the web service is still active". Is that true at the end of the play?

Not necessarily. A successful rescue lets the play continue, and the restart that a2ensite already queued still runs at the end; Apache then restarts with a site that points to a certificate that was never copied, and the restart fails.

The copy fails, rescue prints its message and the play continues; the queued restart runs at the end and Apache fails on the missing certificate

* Rescue handles the failure, but not the restart that is still queued. *

Follow one run where copying the key fails (say files/itia.key was never generated):

  1. Earlier tasks enabled mod_ssl and the HTTPS site and notified Restart web service.
  2. In the block, the key copy fails; rescue prints its message. The failure is now handled, so the host stays in the play.
  3. The remaining tasks run, and at the end the queued handler restarts Apache.
  4. Apache reads the enabled site, can't open /etc/ssl/private/itia.key, and refuses to start. The handler task fails, and the web service is down, despite the message.

The message is true only while the play runs. A rescue should undo what depends on the failed step (for example a2dissite itia-lhe-ssl.conf) or fail the host on purpose (ansible.builtin.fail) after logging. Alternatively, copy the certificates before enabling the site that needs them.

Go deeper:

From Quiz: ITIA / Ansible Task Control: Loops, Conditionals, Handlers and Error Handling | Updated: Nov 12, 2026