bywatersolutions / koha-sandboxes-docker

A Koha sandbox system that only requires Docker to be installed on the sandbox host server.
6 stars 3 forks source link

Deployment failure due to unsupported Ansible module parameter #41

Closed a-roussos closed 3 years ago

a-roussos commented 3 years ago

Hi All! Thanks for creating such an awesome project! This is my first issue here :smiley: Here we go:

In an attempt to have a Koha sandboxes server up and running, I followed the Installation steps outlined in the README and tried to get the latest release of Ansible first. I managed to install version 2.9.15-1ppa~trusty on my Debian 9.13 development system by following the "Installing Ansible on Debian" guide. Then, having cloned this repo as root, I created the ansible/vars/user.yml file using the template provided and edited it to match my configuration. When I finally ran ./setup-sandbox-server.sh to set it all up, the deployment failed and I got the following output during the latter stages of the process:

RUNNING HANDLER [Install koha git config] ******************************************************************************************************************************************************************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "checksum": "1af357630ea0bc892a068736d6d7d67c637b845d", "msg": "Unsupported parameters for (copy) module: update Supported parameters include: _original_basename, attributes, backup, checksum, content, delimiter, dest, directory_mode, follow, force, group, local_follow, mode, owner, regexp, remote_src, selevel, serole, setype, seuser, src, unsafe_writes, validate"}

The failure message did not explicitly point out which parameter of the copy module was to blame. So, I had a look at the YAML segment for the relevant handler:

https://github.com/bywatersolutions/koha-sandboxes-docker/blob/23ad8ee7fb07b8daa7898f9f410cf2bb2669050d/ansible/setup-sandbox-server.yml#L15-L24

Comparing the parameters passed to copy in the code above with those of calls to copy in other Ansible tasks (which completed successfully) within the same file, I noticed there was a single key/value pair of update: yes. No such parameter (update) exists in the official Ansible documentation for the copy module, so this had to be the offending keyword that caused the failure. In fact, to get my sandbox server up and running, I eventually had to replace update with force as per the patch below:

diff --git a/ansible/setup-sandbox-server.yml b/ansible/setup-sandbox-server.yml
index f7a3955..e9db684 100644
--- a/ansible/setup-sandbox-server.yml
+++ b/ansible/setup-sandbox-server.yml
@@ -19,7 +19,7 @@
         mode: 365
         owner: root
         src: files/git/config
-        update: yes
+        force: yes
       notify:
         - "Update koha git repo"
     -

Hopefully other people will find this patch useful, so I'll try to get a pull request submitted for this issue as soon as possible.

Cheers! :+1: