wtsi-hgi / hgi-systems

Orchestration and configuration management of hgi systems (using terraform & ansible)
GNU General Public License v3.0
3 stars 3 forks source link

Executable files in inventory directory not working #30

Closed colin-nolan closed 7 years ago

colin-nolan commented 7 years ago

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
colin-nolan commented 7 years ago

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!