Deckard111 | hey everyone ;) | 11:55 |
---|---|---|
Deckard111 | quick question: In which order is the yamol configuration executed? would it be possible to have several 'users' sections? | 11:56 |
Deckard111 | I would like to create a user and write a file into the user directory. | 11:57 |
Deckard111 | But I have other files I need to write before that | 11:57 |
Deckard111 | so if I write the files first, the user directory is not there, and if I create the user first, then other files are missing. | 11:57 |
Deckard111 | That's why I am asking ;) | 11:58 |
aciba | Deckard111: Hello! | 12:05 |
aciba | Not sure about the use case but, there are two module that could serve as a pre-hook and post-hook repectively: https://cloudinit.readthedocs.io/en/latest/topics/modules.html#bootcmd and https://cloudinit.readthedocs.io/en/latest/topics/modules.html#runcmd. More info: https://cloudinit.readthedocs.io/en/latest/topics/boot.html | 12:07 |
aciba | So you could execute arbitrary code with cc_bootcmd before cc_users_groups and with cc_run_cmd after after cc_user_groups is executed, allowing you to do any additional handling needed | 12:08 |
Deckard111 | ok, thank you - will look into it | 12:10 |
minimal | Deckard111: you can only have a single "users:" section and all users will created at the same time | 12:41 |
minimal | the order that c-i modules are defined in the /etc/cloud/cloud.cfg file controls the order that they are executed but I would not recommend changing the order | 12:42 |
minimal | what files do you need to create before users creation? | 12:43 |
minimal | Deckard111: write_files runs before user creation but you can also specify "defer: true" in a write_files section for it to instead run late in the configuration sequence | 12:46 |
=== cpaelzer_ is now known as cpaelzer | ||
Deckard111 | Thank you everyone for the responses! | 19:02 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!