wtsi-hgi/hgi-systems

Executable files in inventory directory not working

Closed this issue · 1 comments

Unless I am missing a inventory plugin, the shell scripts in the inventory directory cause issues:

# ansible-playbook hgi-systems/ansible/site.yml 
 [WARNING]:  * Failed to parse /data/hgi-systems/ansible/production_hosts.d/terraform-delta-hgi-production.sh with ini inventory plugin: /data/hgi-systems/ansible/production_hosts.d/terraform-delta-hgi-production.sh:3: Expected key=value host variable assignment, got:
dirname

 [WARNING]:  * Failed to parse /data/hgi-systems/ansible/production_hosts.d/terraform-delta-hgi-production.sh with script inventory plugin: Unicode-objects must be encoded before hashing

 [WARNING]: Unable to parse /data/hgi-systems/ansible/production_hosts.d/terraform-delta-hgi-production.sh as an inventory source

 [WARNING]:  * Failed to parse /data/hgi-systems/ansible/production_hosts.d/terraform-delta-hgiarvados-production.sh with ini inventory plugin: /data/hgi-systems/ansible/production_hosts.d/terraform-delta-hgiarvados-production.sh:3: Expected key=value host variable
assignment, got: dirname

 [WARNING]:  * Failed to parse /data/hgi-systems/ansible/production_hosts.d/terraform-delta-hgiarvados-production.sh with script inventory plugin: Unicode-objects must be encoded before hashing

 [WARNING]: Unable to parse /data/hgi-systems/ansible/production_hosts.d/terraform-delta-hgiarvados-production.sh as an inventory source

The latest (unstable) versions of Ansible are shaking up the inventory loading system. Despite being merged into the main branch, unfortunately it's peppered with all sorts of bugs, and it's clearly never been ran with Python 3!

Switching back to the latest stable version of Ansible works around this issue for now - luckily, the stable branch has the fixes merged into it that required use of the devel branch previously.

Hopefully issues with the Ansible inventory loading code will be fixed before we have to upgrade!