-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/influxdb2: add provisioning and nixos tests #249502
Conversation
In summary, @NickCao was asking whether the setup script can be simplified (and thus was split to this separate PR):
I'm currently not seeing how this could be made simpler, but I am open for suggestions. |
7f86838
to
4eb485a
Compare
Rebased on master. |
4eb485a
to
80b25dd
Compare
Restructured the provisioning script. All scripts are now defined on the respective option for increased consistency and readability. Also added the option to provision the secret value of api tokens. |
80b25dd
to
5da9a19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I thinks that a better API might look like:
provisioning.resources = {
organization = {
acme-corp = {
present = true; # the default
some-attribute = "bar";
bucket = {
example = {
present = false; # indicates removal
};
};
};
};
}
And as there are various influxdb modules for ansible (https://docs.ansible.com/ansible/latest/collections/community/general/influxdb_database_module.html), we can generate a ansible-playbook to carry out the actual operation. |
Fully agree, I'll refactor this.
I fear that is a module for influx v1 not v2. I've also searched for alternatives, but I cannot find any that support provisioning remotes, replications or authentication tokens. |
Another thought: we may use https://github.com/influxdata/influxdb-client-python of other sdks instead of the cli, which would be easier/more readable than bash |
Looks good initially, I'll see how we can utilize that |
5da9a19
to
f766bb9
Compare
Summary of the last update:
|
f766bb9
to
4f8b810
Compare
4f8b810
to
55d3b33
Compare
Update:
|
And be sure to split the changes into individual commits. (I did not check the correctness of the assertions e.t.c. but I'm sure you can do a better job than me in that regard) |
55d3b33
to
ef4e3ae
Compare
Split in to 3 commits (1 for each package, one for the module update) |
|
Ah sorry, that hash seems to have been present in my local store from a previous version so I didn't notice :/ |
ef4e3ae
to
8b5b7de
Compare
@ofborg test influxdb2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with nixos tests, also tested evaluation with provision disabled.
Description of changes
This PR adds provisioning options and nixos tests to influxdb2. This allows skipping the initial setup page and automatically creates/deletes the following entities:
Originally initial setup and entity provisioning was a single PR which has been split into two to reduce scope and discuss details of the implementation. This is the second part, which needs to be rebased the first part once merged:
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)