Gus*_*uss 5 ubuntu cloud-init ubuntu-14.04
我正在使用 cloud-init 设置运行 Ubuntu 14.04 的 AWS EC2 机器。cloud-init 比较有用的功能之一是write_files
允许我在虚拟机初始化期间安装附加文件的模块。
write_files
有几个有用的功能,其中的设置文件的所有者,作为记录在这里。不幸的是,我似乎无法write_files
在 Ubuntu 14.04 中使用此功能将文件所有者设置为任何非系统帐户,因为添加用户的 cloud-init 模块 - “用户组”正在该write_files
部分之后运行。如果我将文件所有者设置为在该users
部分中添加的用户(或在我的情况下为 default users
),即使我通过 uid 执行此操作,我也会收到如下错误:
StandardError:('write-files', OSError("Unknown user or group: 'getpwnam(): name not found: ubuntu'",))
Run Code Online (Sandbox Code Playgroud)
这似乎编码到 /etc/cloud/cloud.cfg 中,其中包含以下部分:
cloud_init_modules:
- migrator
- seed_random
- bootcmd
- write-files
- growpart
- resizefs
- set_hostname
- update_hostname
- update_etc_hosts
- ca-certs
- rsyslog
- users-groups
- ssh
Run Code Online (Sandbox Code Playgroud)
我在互联网上看到了一些cloud_init_modules
在 cloud-init 用户数据中设置的示例,但是如果我添加这样一个部分并将其排序write-files
在 下users-groups
,它似乎没有任何影响。
除了放弃write_files
并实施问题 #605670 中runcmd
记录的基于解决方法之外,还有什么可以做的吗?
归档时间: |
|
查看次数: |
1479 次 |
最近记录: |