Commit Graph

544 Commits

Author SHA1 Message Date
Qubasa
a4f3d9d1fc clan-cli: Refactor ssh folder part 1 2024-11-21 13:02:22 +01:00
DavHau
d4c8b2e4ed vars: implement invalidation mechanism
This adds options `invalidationData` to generators.

`invalidationData` can be used by an author of a generator to signal if a re-generation is required after updating the logic.

Whenever a generator with invalidation data is executed, a hash of that data is stored by the respective public and/or secret backends.

The stored hashes will be checked on future deployments, and a re-generation is triggered whenever a hash doesn't match what's defined in nix.
2024-11-20 16:27:22 +07:00
Jörg Thalheim
609dc90775 remove ssh.id_ed25519 from facts test
we have moved this to vars now.
2024-11-19 09:46:14 +00:00
DavHau
2127c7f5cb vars: add test for 'clan vars get' 2024-11-19 13:32:27 +07:00
DavHau
1d66d32163 tests: improve performance, keep flake.lock between tests
- deprecate fixture generate_flake in favor of class ClanFlake
- allow creating flake templates that can be copied, including their state, like git and lock files, in order to avoid expensive re-initialization
2024-11-18 17:01:58 +07:00
Qubasa
26730cd662 clan-cli: upload.py -> Replace rsync with native ssh command 2024-11-15 22:03:47 +07:00
a-kenji
edef77091a pkgs/cli: Fix typo in test fixtures 2024-11-14 15:00:44 +01:00
DavHau
05ff6cfd89 cleanup: remove legacy flake fixture test_flake_minimal and test_flake_with_core_and_pass 2024-11-14 14:03:29 +07:00
DavHau
8b94bc71bc vars: allow re-encrypting secrets when recipient keys were added.
When the users of a secret change, when for example a new admin user is added, an error will be thrown when generating vars, prompting the user to pass --fix to re-encrypt the secrets
2024-11-13 18:49:30 +07:00
Johannes Kirschbauer
9fb6ea2b8a Chore: remove unused clanImports module 2024-11-12 14:46:25 +01:00
Qubasa
d3f0107f4d clan-cli: Improved --debug output by indenting commands, add TRACE_DEPTH environment variable 2024-11-11 21:23:53 +07:00
Jörg Thalheim
71593604e5 HistoryEntry: add cleaner typesafe json deserialization 2024-11-11 11:36:17 +01:00
Jörg Thalheim
c02ecc2f67 tests/command: also wait for exit status 2024-11-04 12:57:07 +01:00
danjujan
75ffb4436e pkgs: fix typos 2024-10-29 12:37:34 +00:00
DavHau
33d049915c vars: fix shared dependency was not resolved correctly 2024-10-23 20:43:33 +07:00
Jörg Thalheim
4af1954abf ruff: enable warning lints 2024-10-23 09:06:02 +00:00
Jörg Thalheim
eb481d6cff test_modules: add missing check argument 2024-10-23 09:50:08 +02:00
Johannes Kirschbauer
3bc2991903 Serde: fixup & tests after changed serialization 2024-10-18 12:42:35 +02:00
Jörg Thalheim
973aef72d3 properly support verbatim ipv6 addresses 2024-10-10 17:03:32 +02:00
DavHau
29f70640ef vars,facts: add sops.defaultGroups to new machines
Prior to this, when initializing new machines, only the current user had access to it's key which prevents other admin users to deploy this machine later
2024-10-10 19:31:03 +07:00
Jörg Thalheim
0ead8dd879 drop optionsNix 2024-10-09 13:22:06 +02:00
Jörg Thalheim
1ac8f6914d drop old settings code 2024-10-09 12:16:00 +02:00
Jörg Thalheim
d537e1a91c remove machine settings.json 2024-10-09 12:08:23 +02:00
Jörg Thalheim
349db434fc test_vars_deployment: set hostPlatform depending on current system 2024-10-09 12:08:23 +02:00
Jörg Thalheim
c95371d583 test_modules: initialize minimal facter.json 2024-10-09 12:08:23 +02:00
Jörg Thalheim
9cdd55acf4 drop "system" argument from inventory 2024-10-09 12:07:58 +02:00
Jörg Thalheim
c620ee9d90 fixtures_flake: drop unused substitutions 2024-10-09 12:07:58 +02:00
Jörg Thalheim
4655199028 tests: set git author name + email via environment variables 2024-10-09 12:07:58 +02:00
Jörg Thalheim
0e8f168e1e no longer write deprecated settings.json in tests 2024-10-09 12:02:10 +02:00
Jörg Thalheim
d2d72e28e8 re-use gpg key across tests 2024-10-09 11:56:41 +02:00
Jörg Thalheim
cfb8df33a1 fix missing hostPlatform in test_vars 2024-10-09 11:56:36 +02:00
Jörg Thalheim
7c97c3b5be test_vars_deployment: fix test 2024-10-08 17:51:55 +00:00
Jörg Thalheim
1ed04fb51e vms/run: better defaults for run api 2024-10-08 17:51:55 +00:00
Jörg Thalheim
cf3c67d830 expose the option to run commands in virtual machines 2024-10-08 17:51:55 +00:00
Jörg Thalheim
318b46d4f6 test_flake_with_core: no longer auto shutdown vm
We can now execute commands to have a better interface for this.
2024-10-08 17:51:55 +00:00
Jörg Thalheim
c33b2b200a vms/run: don't use deprecated clanCore option 2024-10-08 17:51:55 +00:00
Jörg Thalheim
b1b05485dd introduce better vm management abstraction and use it in tests 2024-10-08 17:51:55 +00:00
Jörg Thalheim
0a568be528 pass in flakeid to vm_state_dir 2024-10-08 17:51:55 +00:00
Qubasa
99c5bd2b50 clan-cli: Add --host-key-check to machine update 2024-10-05 23:33:44 +02:00
Jörg Thalheim
1666513e91 Revert "Merge pull request 'Revert "Merge pull request 'clan-cli: secrets: Add support for PGP keys with sops-nix' (#2186) from lopter/clan-core:lo-sops-nix-pgp-support into main"' (#2202) from revert into main"
This reverts commit a5496e8db0, reversing
changes made to 9bb1aef245.
2024-10-04 16:36:35 +00:00
Jörg Thalheim
084ebf9edc Revert "Merge pull request 'clan-cli: secrets: Add support for PGP keys with sops-nix' (#2186) from lopter/clan-core:lo-sops-nix-pgp-support into main"
This reverts commit 5668fd05a0, reversing
changes made to dd17fbdc6d.

Reverting for now as Dave's recent change conflicts with this change.
2024-10-04 17:54:29 +02:00
Louis Opter
81f162d4e6 Update tests for clan secrets 2024-10-04 15:36:30 +00:00
Jörg Thalheim
5d87bc2435 secrets/show: pretty print json 2024-10-04 15:36:30 +00:00
Jörg Thalheim
9c25b4d61c error if we cannot load a dataclass from file 2024-10-04 15:36:30 +00:00
DavHau
11c37ebeba vars/keygen: fix + cleanup tests
- generate keys in ./sops instead of ./sops/vars for now
- don't initialize all flakes with sops keys, only generate when needed
- use the new 'clan vars keygen' in tests
2024-10-04 17:25:17 +02:00
DavHau
2a9ced1e26 vars: add 'clan vars keygen' 2024-10-04 16:13:49 +02:00
Jörg Thalheim
ca8f36201b test superflous test_vm_qmp
we already have other tests covering this and VMs + NixOS are slow
2024-10-01 20:57:07 +02:00
Jörg Thalheim
27b1aeb827 add temp_dir fixture 2024-10-01 20:54:19 +02:00
Jörg Thalheim
8b205c78bf fix resource leaks in qmp tests 2024-10-01 20:54:19 +02:00
Jörg Thalheim
f9a42831e4 start to name temporary directories in more places 2024-10-01 18:57:59 +02:00