basic playbook fails at `Create slurm user`
Heroico opened this issue · 2 comments
Hi there!
I have to create a high-performance computing server, and I'm trying to use this repo for the slurm step. It fails at the user creation step. It looks like a basic permissions error where some unix commands should be ran as root
.
The error I get is:
TASK [galaxyproject.slurm : Include user creation tasks] **************************************************************************************
included: /home/heroico/.ansible/roles/galaxyproject.slurm/tasks/user.yml for [MY HOST]
TASK [galaxyproject.slurm : Create slurm group] ***********************************************************************************************
skipping: [MY HOST]
TASK [galaxyproject.slurm : Create slurm user] ************************************************************************************************
fatal: [MY HOST]: FAILED! => {"changed": false, "msg": "useradd: Permission denied.\nuseradd: cannot lock /etc/passwd; try again later.\n", "name": "slurm", "rc": 1}
PLAY RECAP ************************************************************************************************************************************
[MY HOST] : ok=2 changed=0 unreachable=0 failed=1 skipped=1 rescued=0 ignored=0
My minimal reproducible playbook is like this:
---
- name: test
hosts: [MY_HOST]
tasks:
- include_role:
name: 'galaxyproject.slurm'
vars:
slurm_roles: ['controller', 'exec', 'dbd']
I'm not sure what to do here. I can use a become
directive at the playbook level to have this work, but I wanted to check with you first if there is a better way to achieve this. (Bear in mind: I'm not a sysadmin/devops person, I'm merely a coder recently forced to maintain infrastructure). Thanks in advance!
Yes, this role needs to be run with root privileges, either by logging in as root directly or by using become in some form at the playbook level. The README should probably be updated to mention this bit of information.
Thanks a lot!