我正在使用我的 vm 加载以下 cloud-init 脚本:
#cloud-config
# Add groups to the system
# The following example adds the ubuntu group with members foo and bar and
# the group cloud-users.
groups:
- ugroup
# Add users to the system. Users are added after groups are added.
users:
- default
- name: user
gecos: Testbed as a Service
primary-group: ugroup
groups: admin
passwd: $6$rounds=4096$4pFvtqM5ldfLzR0hE9r7XSOoCO22lN7OB49IopWQ7SQrB5GBTR8X8okMpxXXQZ0jqUOuy4wKY.iYzwQTo7vH6zKx0DqjTFe6jh1
runcmd:
- [passwd, user, '-u']
但似乎我做错了什么
由于我收到以下错误:
passwd: user 'user' does not exist
run-parts: /var/lib/cloud/instance/scripts/runcmd exited with return code 1
2013-12-16 15:15:09,028 - cc_scripts_user.py[WARNING]: failed to run-parts in /var/lib/cloud/instance/scripts
2013-12-16 15:15:09,087 - __init__.py[WARNING]: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/__init__.py", line 108, in run_cc_modules
cc.handle(name, run_args, freq=freq)
File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/__init__.py", line 72, in handle
[ name, self.cfg, self.cloud, cloudinit.log, args ])
File "/usr/lib/python2.7/dist-packages/cloudinit/__init__.py", line 309, in sem_and_run
func(*args)
File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/cc_scripts_user.py", line 27, in handle
util.runparts(runparts_path)
File "/usr/lib/python2.7/dist-packages/cloudinit/util.py", line 140, in runparts
raise subprocess.CalledProcessError(sp.returncode,cmd)
CalledProcessError: Command '['run-parts', '--regex', '.*', '/var/lib/cloud/instance/scripts']' returned non-zero exit status 1
2013-12-16 15:15:09,100 - __init__.py[ERROR]: config handling of scripts-user, None, [] failed
对我的问题有任何提示或解决方案吗?