/srv/irclogs.ubuntu.com/2016/06/08/#cloud-init.txt

=== rangerpbzzzz is now known as rangerpb
copumpkinwhich cloud-init cc_X module is responsible for creating the centos user that I find in all the usual AMIs?18:00
copumpkinah, it looks like it isn't a module18:02
copumpkinoh, users_groups, nevermind18:04
TogerIn cloud init 0.7.5 (included in centos 7.2) I’m trying to get a node to rerun cloud-init and the userdata scripts.  Currently I do rm -rf /var/lib/cloud/sem/* /var/lib/cloud/instance /var/lib/cloud/instances/* /var/lib/cloud/data/*; cloud-init --debug init; and cloud-init --debug modules -m final but the chef: block is not being rerun. How do I trigger that?19:00
smoserToger, kill the instances directory too19:50
smosermostly i just do rm -Rf /var/lib/cloud /var/log/cloud-init* /run/cloud-init19:50
smoserfwiw, if you're just trying ot debug things quickly.... lxd is really nice now19:50
Togerhm, when i nuke that directory it no longer uses datasourceec2, falls back to DataSourceNone19:59
Togerif i make it explicit in the cloud.cfg, I get Failed at attempted import of 'DataSourceEc2' due to: No module named DataSourceEc220:02
Togerwhich is preposterous as it worked on the same node 3 mins ago20:03
Togerbefore removing the status file20:03
smoserwhich directory are you removing ?20:31
TogerI tried just the ones you mentioned20:38
TogerAnd the root issue im having is that cc_chef fails in ensure_dir on /var/lib/chef. It calls selinux:restorecon on /var/lib and it fails with                                                      OSError: [Errno 2] No such file or directory. Of course /var/lib exists.  Also I set the boolean to make selinux run in permissive mode, and there are no AVC denieds in the logs for this.20:40
TogerIt is successful for /var/log20:41
Togerand if i newrole into cloud_init_t I am able to see /var/lib and /var/lib/chef as well20:45
copumpkinI'm writing my own cc_* module for cloud-init21:50
copumpkinand am trying to find the most idiomatic way to determine the account ID I'm in21:50
copumpkin169.254.169.254/*/meta-data/network/interfaces/macs/*/owner-id seems like the simplest way if I were to query the metadata service directly21:51
copumpkinbut is that stored somewhere more structured already in cloud-init?21:51
copumpkinoh, I see21:55
copumpkinself.metadata is populated recursively by traversing that path21:55
copumpkinI'm still confused though: NoCloud seems to talk about a key in metadata called network-interfaces, which doesn't correspond directly to anything I see in 169.254.169.25422:00
copumpkinis there an easy way for me to get a python REPL that has that dictionary populated in the same way I would have in cloud-init?22:01
copumpkinoh22:08
copumpkinI just imported it and it worked :)22:08
copumpkinfor anyone following along: next(metadata['network']['interfaces']['macs'].itervalues())['owner-id']22:09
=== rangerpb is now known as rangerpbzzzz

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!