Bug 240372

Summary: net/cloud-init: Fix set_passwords and network
Product: Ports & Packages Reporter: Andrey Fesenko <andrey>
Component: Individual Port(s)Assignee: Ryan Steinmetz <zi>
Status: Closed Feedback Timeout    
Severity: Affects Only Me CC: zi
Priority: --- Flags: bugzilla: maintainer-feedback? (zi)
koobs: merge-quarterly?
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Add patches for port andrey: maintainer-approval? (zi)

Description Andrey Fesenko 2019-09-06 17:19:07 UTC
Created attachment 207245 [details]
Add patches for port

Apply patches
https://code.launchpad.net/~goneri/cloud-init/+git/cloud-init/+merge/368507
https://code.launchpad.net/~goneri/cloud-init/+git/cloud-init/+merge/365641

This Fix all mode cc_set_passwords (chpasswd:), hash, plain text, random generated.

Second fix start network, without this require reboot vm or restart network/routing services.

testport: OK (poudriere: 113amd64, 120amd64, 120i386, 13amd64 tested)
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2019-09-06 22:33:42 UTC
Thank you for the report and patch Andrey
Comment 2 Ryan Steinmetz freebsd_committer freebsd_triage 2019-09-06 22:34:51 UTC
If this patch looks good/works, it is 100% approved for application.
Comment 3 Andrey Fesenko 2019-09-07 04:05:17 UTC
Full check i'm test cloud freebsd 12.0, all methods chpasswd  work fine. May be need more tests validation, full data or not all user in list. But without this, chpasswd completely not work, set in users-groups work for only new users, root password be horror.
Comment 4 Andrey Fesenko 2019-09-07 06:16:58 UTC
Real log test vm
> 2019-09-06 11:06:43,593 - util.py[DEBUG]: Cloud-init v. 19.2 running 'modules:final' at Fri, 06 Sep 2019 11:06:43 +0000. Up 1567768003.4424992 seconds.
> 2019-09-06 11:06:43,595 - stages.py[DEBUG]: Using distro class <class 'cloudinit.distros.freebsd.Distro'> 
> 2019-09-06 11:06:43,597 - stages.py[DEBUG]: Running module set_passwords (<module 'cloudinit.config.cc_set_passwords' from '/usr/local/lib/python3.6/site-packages/cloudinit/config/cc_set_passwords.py'>) with frequency once-per-instance 
> 2019-09-06 11:06:43,597 - handlers.py[DEBUG]: start: modules-final/config-set_passwords: running config-set_passwords with frequency once-per-instance
> 2019-09-06 11:06:43,598 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/XXX/sem/config_set_passwords - wb: [644] 24 bytes
> 2019-09-06 11:06:43,598 - helpers.py[DEBUG]: Running config-set_passwords using lock (<FileLock using file '/var/lib/cloud/instances/XXX/sem/config_set_passwords'>) 
> 2019-09-06 11:06:43,598 - cc_set_passwords.py[DEBUG]: Handling input for chpasswd as multiline string.
> 2019-09-06 11:06:43,599 - cc_set_passwords.py[DEBUG]: Setting password for: user
> 2019-09-06 11:06:43,599 - util.py[DEBUG]: Running hidden command to protect sensitive input/output logstring: chpasswd for user
> 2019-09-06 11:06:43,637 - cc_set_passwords.py[DEBUG]: Setting password for: root
> 2019-09-06 11:06:43,637 - util.py[DEBUG]: Running hidden command to protect sensitive input/output logstring: chpasswd for root

Without this patch
simple add user without hash (users-groups)
> user:thispassword:1001:1001::0:0:User &:/usr/home/user:/bin/sh


> Stderr: pw: login name `root' already exists
> 2019-09-07 08:47:08,742 - handlers.py[DEBUG]: finish: init-network/config-users-groups: FAIL: running config-users-groups with frequency once-per-instance

> 2019-09-07 08:48:10,187 - util.py[WARNING]: Failed to set passwords with chpasswd for ['user', 'root']
> 2019-09-07 08:48:10,192 - util.py[WARNING]: Running module set-passwords (<module 'cloudinit.config.cc_set_passwords' from '/usr/local/lib/python3.6/site-packages/cloudinit/config/cc_set_passwords.py'>) failed
Comment 5 Andrey Fesenko 2019-10-09 01:00:32 UTC
Maintainer timeout?
Comment 6 Ryan Steinmetz freebsd_committer freebsd_triage 2019-10-09 02:51:06 UTC
If you'd like to be the new maintainer, I'd be happy to pass it on!
Comment 7 Andrey Fesenko 2019-10-09 03:04:50 UTC
Yes, i'm take this port
Comment 8 Andrey Fesenko 2020-02-11 23:25:25 UTC
Make new version 19.4 #244057