Hi Parker,

Thanks a lot for your reply. I have tried to add the deployment user to these 
groups but it still failed with the same error.
Then I tried to change the Ansible script to force it to use sudo to do the 
command and it works.

For script [1], change it to be like this:
- name: Configure SSH key for local user
  become: yes
  become_method: sudo
  user:
  …
  …

Regagrds,
Dan

[1] 
https://github.com/opnfv/releng-xci/blob/master/xci/playbooks/configure-localhost.yml#L83


From: Parker Berberian [mailto:[email protected]]
Sent: Friday, July 12, 2019 8:57 PM
To: xudan (N) <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [opnfv-tech-discuss] [XCI] Failed to deploy XCI

Hi Dan Xu,

This seems like a bug if XCI is not using `sudo` to change group settings. 
However, you should be able to work around this by adding the groups to your 
user manually.

In my XCI deploy, the deployment user has these groups: "root, wheel, kvm, 
qemu, docker, libvirt". I'm not sure which are required by xci, but there is no 
harm to adding them all to your user.

If you manually add these groups to your xd user with `sudo usermod -aG 
<group_name> xd` then XCI should skip the step that is giving you trouble.

Best,

Parker Berberian

Lead Developer

UNH InterOperability Laboratory

21 Madbury Rd, Suite 100, Durham, NH 03824

[email protected]<mailto:[email protected]>

www.iol.unh.edu<http://www.iol.unh.edu/>


On Fri, Jul 12, 2019 at 3:42 AM xudan 
<[email protected]<mailto:[email protected]>> wrote:
Hi all,

I tried to deploy with XCI master but failed with error “usermod: Permission 
denied.\nusermod: cannot lock /etc/passwd;”. The detailed error message and 
required ENV can be found in the attachment.
I used user ‘xd’ and have added ‘xd ALL=(ALL) NOPASSWD:ALL’ to sudoers.
Also SSH key are generated before the deploy.
xd@ubuntu:~$ ll ~/.ssh/
total 20
drwxrwxr-x 2 xd xd 4096 Jul 11 15:17 ./
drwxr-xr-x 7 xd xd 4096 Jul 11 15:05 ../
-rw------- 1 xd xd 1675 Jul 11 14:59 id_rsa
-rw-r--r-- 1 xd xd  391 Jul 11 14:59 id_rsa.pub
-rw-r--r-- 1 xd xd  222 Jul 11 15:17 known_hosts

Also I can successfully use command “sudo usermod –d /home/abc abc” to change 
user ‘abc’’s home with user ‘xd’.

Did anyone meet the same problem before? Or do anyone know how to solve this?

BR,
Dan Xu
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#23360): 
https://lists.opnfv.org/g/opnfv-tech-discuss/message/23360
Mute This Topic: https://lists.opnfv.org/mt/32439749/1217375
Group Owner: 
[email protected]<mailto:opnfv-tech-discuss%[email protected]>
Unsubscribe: https://lists.opnfv.org/g/opnfv-tech-discuss/unsub  
[[email protected]<mailto:[email protected]>]
-=-=-=-=-=-=-=-=-=-=-=-
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#23364): 
https://lists.opnfv.org/g/opnfv-tech-discuss/message/23364
Mute This Topic: https://lists.opnfv.org/mt/32439749/21656
Group Owner: [email protected]
Unsubscribe: https://lists.opnfv.org/g/opnfv-tech-discuss/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to