gdeploy
gdeploy copied to clipboard
gdeploy_setup script does not handle ANSIBLE_LBRARY setting right?
This line, https://github.com/gluster/gdeploy/blob/master/gdeploy_setup.sh#L11 reads, echo "export ANSIBLE_LIBRARY=$ANSIBLE_LIBRARY:'$DIR/modules/'" >> ~/.bashrc
2 problems with this,
-
if $ANSIBLE_LIBRARY is not set, this generates, DIR='/test'; echo "export ANSIBLE_LIBRARY=$ANSIBLE_LIBRARY:'$DIR/modules/'" export ANSIBLE_LIBRARY=:'/test/modules/' There is an unwanted ":" at the head of the export (this may not cause a problem)
-
There are unwanted ' in the ANSIBLE_LIBRARY variable. This caused some problems in my CentOS 7.2 default setup, as during execution of any gdeply conf, it was unable to find the required modules. Post removing the leading and trailing ' characters this worked as expected.
Request that the script be enhanced to address these issues.
First issue as you said will not cause any problem. Leaving it as is.
I have enhanced this script already and is part of another branch, I will merge this to master soon.
https://github.com/gluster/gdeploy/blob/api/gdeploy_setup.sh
I've addressed the second issue of single quote now.
could we rename the modules
directory to library
? That way Ansible would pick up the modules automatically without the need to set an environment variable...
@zeichenanonym we copy the playbooks to /tmp/
That sounds weird... why would you need to copy playbooks around? And even if you do, you could just copy the library folder with...
@zeichenanonym that is because the group_vars and host_vars have to be in the same directory where playbooks reside. So, /tmp/
One of the other reasons to copy the playbooks to /tmp/ is gdeploy can be run as any regular user and creating group_vars and host_vars under standard directories like /usr/ would not be possible as a regular user due to permission problems.
isn't gdeploy installed as a rpm package? That way you can configure yourself which users are needed and which access rights it needs.
Additionally you can select a specific hosts file for your group and host variables:
You can specify a different inventory file using the -i <path> option on the command line.
Source: http://docs.ansible.com/ansible/intro_inventory.html In the hosts file you can then define variables for hosts and groups.
Would that help you avoid copying things back and forth?