0

I'm running Ubuntu 18.04 LTS and trying to get cloud-init (AWS) via terraform to create system files I need for ldap auth. The files I'm trying to generate are nsswitch.conf and sshd_config. Does cloud-init allow for system file writing on Ubuntu? We use this for our coreOS stack, so I'm not sure what the issue is.

Here is the warning I'm getting

util.py[WARNING]: Running module write-files (<module 'cloudinit.config.cc_write_files' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_write_files.py'>) failed

Here is the nsswitch config

write_files:
 - encoding: b64
   content: ICAgICAgIyAvZXRjL25zc3dpdGNoLmNvbmYKICAgICAgIwogICAgICAjIEV4YW1wbGUgY29uZmlndXJhdGlvbiBvZiBHTlUgTmFtZSBTZXJ2aWNlIFN3aXRjaCBmdW5jdGlvbmFsaXR5LgogICAgICAjIElmIHlvdSBoYXZlIHRoZSBgZ2xpYmMtZG9jLXJlZmVyZW5jZScgYW5kIGBpbmZvJyBwYWNrYWdlcyBpbnN0YWxsZWQsIHRyeToKICAgICAgIyBpbmZvIGxpYmMgIk5hbWUgU2VydmljZSBTd2l0Y2giJyBmb3IgaW5mb3JtYXRpb24gYWJvdXQgdGhpcyBmaWxlLgoKICAgICAgcGFzc3dkOiAgICAgICAgIGZpbGVzIGxkYXAKICAgICAgZ3JvdXA6ICAgICAgICAgIGZpbGVzIGxkYXAKICAgICAgc2hhZG93OiAgICAgICAgIGZpbGVzIGxkYXAKCiAgICAgIGhvc3RzOiAgICAgICAgICBmaWxlcyBkbnMKICAgICAgbmV0d29ya3M6ICAgICAgIGZpbGVzCgogICAgICBwcm90b2NvbHM6ICAgICAgZGIgZmlsZXMKICAgICAgc2VydmljZXM6ICAgICAgIGRiIGZpbGVzCiAgICAgIGV0aGVyczogICAgICAgICBkYiBmaWxlcwogICAgICBycGM6ICAgICAgICAgICAgZGIgZmlsZXMKCiAgICAgIG5ldGdyb3VwOiAgICAgICBuaXM=
   owner: root:root
   path: /etc/nsswitch.conf
   permissions: '0600'

I've tried using just plain text and not the encoding and still the same error.

Any ideas?

E: Solved. When I copied and pasted the info I must have brought over special characters. Make sure to convert to plain text.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.