Everything I’m able to find thus far indicates you need to create service users through the web interface if you want to be able to use any kind of API to further do anything… but what if I wanted to use something like ansible to stand up a brand new server and have ansible install the docker packages, build the appropriate processes, add the users, create assets, etc? If this capability exists, I can only think that I must not be looking in the correct places to find the how-to documentation for this.
You can automate initial setup using
SetupTasks are discovered at startup using the standard java service loader mechanism; for example our own demo environment setup tasks:
So using this I could create the service users with specific passwords/keys, add assets possibly with a pre-specified ID, extract the ID of those assets, etc, in a similar fashion to how I might be able to take a bare linux server, use an ansible playbook, add user/password combos with a specific uid/gid number, install necessary server software, configure it, and so forth?
Yes you can provision users, assets, agents, rules etc. programmatically using java code; there is a basic declarative provisioning tool using
json for users and assets but I would recommend the programmatic approach for maximum control.
Ah, that’s going to be an issue. Having to write actual Java code is a bigger hill than many are willing to climb for this. Where would I find the json tool, since that seems to be much closer to the level of effort for what we are doing.
There is also a CLI tool created for this kind of tasks. I was using it to setup, configure and test multiply servers in the cloud. It might be out of date though as I doubt that anybody is using it anymore. I’ve just installed it on my new Apple silicon Mac and it is still working , however
make test reports some errors, which I need to look at. Nevertheless it is open source and you can extend it very easily if you know some Python. It has even a poor man SSO, which you can use if you have multiply servers and don’t want to remember all passwords.
OK, so potentially this CLI tool could be adapted into an ansible playbook?
Sure, it can be executed by any shell, bash, zsh or powershel depending if you poison is Linux osX or Windows. Ansible playbook can just call it with associated parameters.