=== rangerpbzzzz is now known as rangerpb | ||
copumpkin | which cloud-init cc_X module is responsible for creating the centos user that I find in all the usual AMIs? | 18:00 |
---|---|---|
copumpkin | ah, it looks like it isn't a module | 18:02 |
copumpkin | oh, users_groups, nevermind | 18:04 |
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:00 |
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:50 |
Toger | hm, when i nuke that directory it no longer uses datasourceec2, falls back to DataSourceNone | 19:59 |
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:02 |
Toger | which is preposterous as it worked on the same node 3 mins ago | 20:03 |
Toger | before removing the status file | 20:03 |
smoser | which directory are you removing ? | 20:31 |
Toger | I tried just the ones you mentioned | 20:38 |
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:40 |
Toger | It is successful for /var/log | 20:41 |
Toger | and if i newrole into cloud_init_t I am able to see /var/lib and /var/lib/chef as well | 20:45 |
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:50 |
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:51 |
copumpkin | oh, I see | 21:55 |
copumpkin | self.metadata is populated recursively by traversing that path | 21:55 |
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:00 |
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:01 |
copumpkin | oh | 22:08 |
copumpkin | I just imported it and it worked :) | 22:08 |
copumpkin | for 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!