gluster / gdeploy

gdeploy - an Ansible based tool to deploy GlusterFS
GNU General Public License v3.0
91 stars 69 forks source link

base_dir missing for geo-replication #360

Open tsailiming opened 7 years ago

tsailiming commented 7 years ago

In georep_common_public_key.yml, base_url is not defined in georep.py

This causes an error:

TASK [Copy the public key to the local] ****************************************
fatal: [gluster1]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'base_dir' is undefined\n\nThe error appears to have been in '/tmp/tmpD3mnaq/georep_common_public_key.yml': line 10, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n  - name: Copy the public key to the local\n    ^ here\n"}

And in georep_common_public_key.yml

- name: Copy the public key to the local
    fetch: src=~/.ssh/id_rsa.pub
           dest="{{ base_dir }}/id_rsa.tmp"
           flat=yes

I had to quote the entire dest directory, otherwise it ended up like /tmp/foo/tmp/foo/id_rsa.tmp

johnsimcall commented 7 years ago

This is affecting me as well. I'm not able to use gdeploy to create geo-replication configurations. I've tried both absolute and relative paths. Neither works... Is there a workaround?

[root@rhvm gdeploy]# rpm -qf /usr/share/ansible/gdeploy/playbooks/georep_common_public_key.yml
gdeploy-2.0.1-11.el7rhgs.noarch
[root@rhvm gdeploy]# cat geo-rep-setup.conf 
[geo-replication]
base_dir=/root/gdeploy/tmp/
action=create
mastervol=gluster1:vol1
slavevol=gluster-geo1:geo-vol1
force=yes
TASK [Copy the public key to the local] ****************************************
task path: /tmp/tmp5ZWsrS/georep_common_public_key.yml:10
changed: [gluster1] => {"changed": true, "checksum": "c566f74da2682dc318a19027fe2186caf1505aa8", "dest": "/tmp/tmp5ZWsrS/\"/root/gdeploy/tmp/\"/id
_rsa.tmp", "md5sum": "567167a3a89a60076ec13d9964925c85", "remote_checksum": "c566f74da2682dc318a19027fe2186caf1505aa8", "remote_md5sum": null}

TASK [Copying local key to slave node] *****************************************
task path: /tmp/tmp5ZWsrS/georep_common_public_key.yml:15
changed: [gluster1 -> localhost] => (item=gluster-geo1) => {"changed": true, "cmd": "cat \"/root/gdeploy/tmp/\"/id_rsa.tmp | ssh \"root\"@gluster-geo1 \"cat >> ~/.ssh/authorized_keys\"", "delta": "0:00:00.197111", "end": "2017-06-05 20:21:51.127053", "item": "gluster-geo1", "rc": 0, "start": "2017-06-05 20:21:50.929942", "stderr": "cat: /root/gdeploy/tmp//id_rsa.tmp: No such file or directory", "stdout": "", "stdout_lines": [], "warnings": []}
[root@rhvm gdeploy]# tree /tmp/tmp5ZWsrS
/tmp/tmp5ZWsrS
├── "
│   └── root
│       └── gdeploy  
│           └── tmp  
│               └── "
<snip>
sac commented 7 years ago

@tsailiming @johnsimcall Ack! I will fix this.

sac commented 7 years ago

@tsailiming @johnsimcall latest master updates to gdeploy should fix this. Please find example configuration at: https://github.com/gluster/gdeploy/blob/master/examples/geo-replication.conf

You can find more example configuration files at: https://github.com/gluster/gdeploy/tree/master/examples