'__galaxy_user_group' is undefined"


We are attempting to install galaxy following the “Galaxy Installation with Ansible” tutorial (Galaxy Installation with Ansible). Everything is working fine through the galaxy installation. However, when we try to complete the systemd setup and execute “ansible-playbook -vvv galaxy.yml”, we get the following error:

<galaxy-dev.classe.cornell.edu> EXEC /bin/sh -c ‘rm -f -r /home/galaxy/.ansible/tmp/ansible-tmp-1630271534.663397-13888-233149462200077/ > /dev/null 2>&1 && sleep 0’
The full traceback is:
Traceback (most recent call last):
File “/mnt/galaxy/ansible/venv/lib/python3.6/site-packages/ansible/template/init.py”, line 1100, in do_template
res = j2_concat(rf)
File “”, line 24, in root
File “/mnt/galaxy/ansible/venv/lib/python3.6/site-packages/jinja2/runtime.py”, line 903, in _fail_with_undefined_error
raise self._undefined_exception(self._undefined_message)
jinja2.exceptions.UndefinedError: ‘__galaxy_user_group’ is undefined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/mnt/galaxy/ansible/venv/lib/python3.6/site-packages/ansible/plugins/action/template.py”, line 146, in run
resultant = templar.do_template(template_data, preserve_trailing_newlines=True, escape_backslashes=False)
File “/mnt/galaxy/ansible/venv/lib/python3.6/site-packages/ansible/template/init.py”, line 1137, in do_template
raise AnsibleUndefinedVariable(e)
ansible.errors.AnsibleUndefinedVariable: ‘__galaxy_user_group’ is undefined
fatal: [galaxy-dev.classe.cornell.edu]: FAILED! => {
“changed”: false,
“msg”: “AnsibleUndefinedVariable: ‘__galaxy_user_group’ is undefined”

Any help would be greatly appreciate.

Many thanks,

Hey @Devin_Bougie

would you mind providing some extra information for us to help you?

  1. Do you set galaxy_manage_user?
  2. What layout method are you using?
  3. What version of ansible are you using?
1 Like

Specifically `__galaxy_user_group` is undefined if `galaxy_manage_paths` is not enabled · Issue #137 · galaxyproject/ansible-galaxy · GitHub might be related to your issue

1 Like

Thank you, that does appear to be the issue as we do have galaxy_manage_paths disabled. A workaround was to set __galaxy_user_group in group_vars/galaxyservers.yml.

Hey @Devin_Bougie great to hear there’s a workaround that works for you. We’ll try and get the role fixed to be a bit more forgiving in that situation.

1 Like