#286 Move all bash scripts into separate files
Opened 5 years ago by bookwar. Modified 5 years ago

All bash scripts longer then one line (example) should be separate files in the role's folder.

This

  • adds readability to the script itself
  • allows to run script outside of ansible framework
  • simplifies ansible logs, as the content of the script is not copied to the the debug log
  • allows to run static analysis tools on bash scripts, fr exampe shellcheck.

allows to run script outside of ansible framework

from the initial Investigation I figure that we need to figure a dir where these scripts to be stored. for example /usr/share/ansible/roles/standard-test-basic/tasks and then call those scripts. We han have the same dir where the scripts are embedded now @bookwar wdut?

the usual location for static files for a role is roles/<rolename>/files/

Files stored there will be available for ansible modules like script module:

https://docs.ansible.com/ansible/latest/modules/script_module.html

So you don't need an absolute path for them

yes those are moved to their

Login to comment on this ticket.

Metadata