[18:00] <copumpkin> which cloud-init cc_X module is responsible for creating the centos user that I find in all the usual AMIs?
[18:02] <copumpkin> ah, it looks like it isn't a module
[18:04] <copumpkin> oh, users_groups, nevermind
[19:00] <Toger> In 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:50] <smoser> Toger, kill the instances directory too
[19:50] <smoser> mostly i just do rm -Rf /var/lib/cloud /var/log/cloud-init* /run/cloud-init
[19:50] <smoser> fwiw, if you're just trying ot debug things quickly.... lxd is really nice now
[19:59] <Toger> hm, when i nuke that directory it no longer uses datasourceec2, falls back to DataSourceNone
[20:02] <Toger> if i make it explicit in the cloud.cfg, I get Failed at attempted import of 'DataSourceEc2' due to: No module named DataSourceEc2
[20:03] <Toger> which is preposterous as it worked on the same node 3 mins ago
[20:03] <Toger> before removing the status file
[20:31] <smoser> which directory are you removing ?
[20:38] <Toger> I tried just the ones you mentioned
[20:40] <Toger> And 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:41] <Toger> It is successful for /var/log
[20:45] <Toger> and if i newrole into cloud_init_t I am able to see /var/lib and /var/lib/chef as well
[21:50] <copumpkin> I'm writing my own cc_* module for cloud-init
[21:50] <copumpkin> and am trying to find the most idiomatic way to determine the account ID I'm in
[21:51] <copumpkin> 169.254.169.254/*/meta-data/network/interfaces/macs/*/owner-id seems like the simplest way if I were to query the metadata service directly
[21:51] <copumpkin> but is that stored somewhere more structured already in cloud-init?
[21:55] <copumpkin> oh, I see
[21:55] <copumpkin> self.metadata is populated recursively by traversing that path
[22:00] <copumpkin> I'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.254
[22:01] <copumpkin> is 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:08] <copumpkin> oh
[22:08] <copumpkin> I just imported it and it worked :)
[22:09] <copumpkin> for anyone following along: next(metadata['network']['interfaces']['macs'].itervalues())['owner-id']