ansible-galaxy icon indicating copy to clipboard operation
ansible-galaxy copied to clipboard

Using role with a `--become-user` call fails 0.8.4 --> 0.9.0

Open pcm32 opened this issue 6 years ago • 2 comments

I used to call this role within a playbook at version 0.8.4 and executing a call in the form of:

ansible-playbook --become --become-user=gxa_galaxy --inventory=hosts playbook/playbook.yml

used to work. I need to do it like this since I ssh with one user but become another one for running things. The error I get now is:

TASK [galaxyproject.galaxy : Set Galaxy user facts] ************************************************************************************************************************************************
fatal: []: FAILED! => {"msg": "The field 'remote_user' has an invalid value, which includes an undefined variable. The error was: '__galaxy_remote_user' is undefined"}
	to retry, use: --limit @/Users/pmoreno/Development/ansible/galaxy-lsf/playbook/playbook.retry

I think that the role now tries to set __galaxy_remote_user from ansible_user. But if I set ansible_user to the user I become (the user I want galaxy to use), I cannot ssh into the target machine.

pcm32 avatar Oct 28 '19 11:10 pcm32

Ansible has really made this difficult for us. I'll revisit privilege separation vars yet again. Presumably #84 broke this for you.

natefoo avatar Oct 28 '19 19:10 natefoo

What's the output of the task Set privilege separation default variables, and, just for fun, can you add a task to the top of tasks/main.yml that does:

- name: Get ansible_user value
  debug:
    var: ansible_user

natefoo avatar Oct 28 '19 19:10 natefoo