Script that inits taskotron and testcloud after installation. This is PoC to open a discussion what else we'd like to see in init script.
Diff Detail
- Lint
Lint Skipped - Unit
Unit Tests Skipped
I thought that we were going to do this in python as part of the cli re-work, is this something different?
I imagined this would be written in Python. It could be easier for some tasks, especially if we're going to parse existing testcloud settings as suggested. Running simple command like options is not that difficult in Python, just subprocess.check_call(...). But I don't have strong objections against bash either, it's just that we'll have another executable around.
taskotron_init.sh | ||
---|---|---|
4–6 | I wonder if we could do this idempotent? Always end up with same result, even if run several times, therefore no need to worry about overwriting something? | |
19 | We could do something like
| |
57 | Let's check the current groups first, and skip if taskotron group is already present for the user. If not, let's ask whether to run the command or skip (maybe the user wants to run it him/herself). | |
60 | I'd say is required. |
Bash is my go for language for stuff like this and I'd prefer one subprocess.check_call(...) over more, but not having another executable around is probably better. Python then.
Parsing existing testcloud settings means parsing cloud-init configuration (or do I miss something?). Reading the cloud-config docs, it is in yaml, so no problem I guess.
taskotron_init.sh | ||
---|---|---|
4–6 | Sure, idempotent init is probably better. I was aiming on something like arc does when it is executed for the first time, it tells you to run arc install-certificate. I think it would be nice to have such behavior in runtask (or taskotron run). |
I meant the file in ~/.config/testcloud/settings.py (in order to be able to append ssh keys and not overwrite the existing ones). But that was just an idea, we don't have to support this use case.
I wonder if we could do this idempotent? Always end up with same result, even if run several times, therefore no need to worry about overwriting something?