[16:57] 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] (Running in vmware vcloud director, ubuntu noble-server-cloudimg-amd64) [16:57] Currently I can apt-get install ansible in runcmd itself, but this seems hacky. [17:16] 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] you can check this in /etc/cloud/cloud.cfg [17:20] Oh no, now it makes sense. I guess I can't customize this using other variables? [17:21] minimal: sorry, forgot to tag you [17:23] h3k: there is an ansible module which can install ansible if required [17:24] though I'm haven't checked if it can be used to only install ansible (rather than also run a playbook etc) [17:28] 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:30] what has runcmd got to do with runcmd though? [17:30] oops, runcmd got to do with ansible? [17:33] 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:36] h3k: I did point out that the cloud-init ansible module is precisely designed to do this... [17:37] to install ansible, pull a playbook, and run it [17:37] minimal: I think I didn't get that it would do all my stuff. I'll try, thanks. [17:37] look at the docs for cc_ansible [17:38] and the examples [18:08] 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:22] 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:28] h3k: open a cloud-init github Issue for it? === dbungert1 is now known as dbungert