owncloud-ansible / owncloud

Ansible role for ownCloud 10
https://owncloud-ansible.github.io
Apache License 2.0
6 stars 7 forks source link

Maintenance mode should be activate after successful download of ownCloud tarball #66

Closed d7oc closed 2 years ago

d7oc commented 2 years ago

Currently when the tarball could not be downloaded successfully, the Ansible scripts leave the system behind in maintenance mode. It would be more fail-safe to check the download before putting the system in maintenance mode. Or to gracefully return the system from maintenance mode if the installation couldn't be done.

xoxys commented 2 years ago

Happy to discuss possible solutions. The main issue is that there are a lot of cases where "something" could happen that interrupts a playbook run and keeps a system unfinished. IMO Ansible is designed to just execute the playbook again to bring the system into the desired state, especially in the described case this would only be a temp issue, e.g. network/target unreachable and a re-run will successfully download the artifact and bring the system back into a desired state.

d7oc commented 2 years ago

I agree that there are lot of cases for failures and for sure not all of them can be covered in Ansible due to the way Ansible works. So there is AFAIK no "rollback" which would be needed to cover all of them. Nevertheless I would like to at least cover the low hanging fruits, which means that the system should not start if the "gathering" phase already contains errors. So everything which is part of this phase should happen before the scripts actually make a change.

For the current issue I could offer to send a PR with the solution I had in mind.

xoxys commented 2 years ago

Sure, happy to review.

d7oc commented 2 years ago

See https://github.com/owncloud-ansible/owncloud/pull/68