h3k | I'm trying to deploy a VM using cloud-init. I want to install ansible using packages and use it later in runcmd. However it looks like for some reason runcmd gets executed before apt finishes installing the package. How can I troubleshoot that? | 16:57 |
---|---|---|
h3k | (Running in vmware vcloud director, ubuntu noble-server-cloudimg-amd64) | 16:57 |
h3k | Currently I can apt-get install ansible in runcmd itself, but this seems hacky. | 16:57 |
minimal | h3k: if you're trying to use "packages:\n- ansible\n" in user-data the packages_update_upgrade_install module is run in the 'final' stage whereas 'runcmd' is run in the earlier 'config' stage | 17:16 |
minimal | you can check this in /etc/cloud/cloud.cfg | 17:16 |
h3k | Oh no, now it makes sense. I guess I can't customize this using other variables? | 17:20 |
h3k | minimal: sorry, forgot to tag you | 17:21 |
minimal | h3k: there is an ansible module which can install ansible if required | 17:23 |
minimal | though I'm haven't checked if it can be used to only install ansible (rather than also run a playbook etc) | 17:24 |
h3k | minimal: The ansible module also runs after runcmd. I could probably use scripts_user together with write_files and wouldn't need to change the cloud.cfg and still use packages. | 17:28 |
minimal | what has runcmd got to do with runcmd though? | 17:30 |
minimal | oops, runcmd got to do with ansible? | 17:30 |
h3k | minimal: I need to run an ansible-playbook directly on the host and some other commands as well. Until now I installed ansible and ran ansible directly in runcmd. | 17:33 |
minimal | h3k: I did point out that the cloud-init ansible module is precisely designed to do this... | 17:36 |
minimal | to install ansible, pull a playbook, and run it | 17:37 |
h3k | minimal: I think I didn't get that it would do all my stuff. I'll try, thanks. | 17:37 |
minimal | look at the docs for cc_ansible | 17:37 |
minimal | and the examples | 17:38 |
h3k | minimal: It seems not to work in my case because ansible is not in the repo root and I can't find a way to set playbook_dir or a simliar setting to somehow chdir into the ansible folder first | 18:08 |
minimal | h3k: I haven't yet used the ansible module so I'm not familiar with its various options but what you mention sounds like either a bug or a feature request | 18:22 |
minimal | h3k: open a cloud-init github Issue for it? | 18:28 |
=== dbungert1 is now known as dbungert |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!