-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Role execution fails if not running under root user #58
Comments
The error actually comes from dnf_module, so it might be better to open issue there . |
Since the issue chrismeyersfsu#58 prevents me to run playbook under non-root user.
@lukas-bednar I am getting this issue as well, is there a way to tell it to run as sudo? Trying to use this role https://github.com/geerlingguy/ansible-role-docker and I get this when running ansible-playbook -K setup_docker.yml: failed: [localhost] (item=docker) => {"changed": false, "cmd": "dnf install -y python2-dnf", "item": "docker", "msg": "Error: This command has to be run under the root user.", "rc": 1, "stderr": "Error: This command has to be run under the root user.\n", "stderr_lines": ["Error: This command has to be run under the root user."], "stdout": "", "stdout_lines": []} |
@NerdsvilleCEO Hi, you can make whole playbook run as a sudo, but I am afraid that you can not do that for particular task which causes failure - I am using patched version of this repository where I use |
TASK [provision_docker : Install libselinux-python package for 'copy' task] ******************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "This command has to be run under the root user."}
I have the libselinux package already installed on my machine, but even for checking if the package is installed it requires root, which is not expected behavior.
I tried to replace the package module with yum module which works on my system and it succeeds as expected, so I guess we can replace it here as well.
Affects only system where
ansible_os_family== "Redhat"
The text was updated successfully, but these errors were encountered: