gdeploy icon indicating copy to clipboard operation
gdeploy copied to clipboard

gdeploy_setup script does not handle ANSIBLE_LBRARY setting right?

Open ShyamsundarR opened this issue 8 years ago • 6 comments

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,

  1. 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)

  2. 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.

ShyamsundarR avatar Dec 07 '16 18:12 ShyamsundarR

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.

sac avatar Dec 08 '16 08:12 sac

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...

mulbc avatar Dec 12 '16 17:12 mulbc

@zeichenanonym we copy the playbooks to /tmp/ and generate group_vars relative to that. And gdeploy could be invoked from any directory. So, I'm not sure if this works. I'll investigate further.

sac avatar Dec 13 '16 11:12 sac

That sounds weird... why would you need to copy playbooks around? And even if you do, you could just copy the library folder with...

mulbc avatar Dec 14 '16 15:12 mulbc

@zeichenanonym that is because the group_vars and host_vars have to be in the same directory where playbooks reside. So, /tmp/ would make it easy for us to generate the files and clean them up after the run. And the modules and others libs would be installed to standard directories.

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.

sac avatar Dec 15 '16 05:12 sac

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?

mulbc avatar Dec 15 '16 11:12 mulbc