Commit Graph

1332 Commits

Author SHA1 Message Date
clan-bot
a57f409224 Merge pull request 'generate: don't set type=bool in argparse.BooleanOptionalAction' (#2190) from fix-warning into main 2024-10-01 17:04:49 +00:00
Jörg Thalheim
f9a42831e4 start to name temporary directories in more places 2024-10-01 18:57:59 +02:00
Jörg Thalheim
a5e18fda08 generate: don't set type=bool in argparse.BooleanOptionalAction 2024-10-01 18:48:54 +02:00
Louis Opter
3f2bb2b958 Update outdated help messages and fix a typo 2024-09-29 15:52:58 +00:00
Jörg Thalheim
62af2bab55 fix broken eval check when nixpkgs.pkgs nixos option is used 2024-09-29 16:59:02 +02:00
Jörg Thalheim
9cf2bd4f6e make default hardware report commit message nicer 2024-09-29 16:59:02 +02:00
Jörg Thalheim
bf7246104d allow to overwrite hardware configuration
now that we call it "update" hardware configurration and we are heading
towards facter anyway, we don't need all the force overide logic. Just
allow this to be overwritten by default.
2024-09-29 16:59:02 +02:00
Jörg Thalheim
b4652539a5 wrap hardware generate arguments into an object 2024-09-29 16:59:02 +02:00
Jörg Thalheim
7816a3e639 don't expose polymorphic api 2024-09-29 16:21:53 +02:00
Jörg Thalheim
372a5f3907 remove unused location from ClanError 2024-09-29 16:21:53 +02:00
Jörg Thalheim
1940880dcb put error description in same line as error for cli 2024-09-29 16:21:53 +02:00
Jörg Thalheim
1e11cd79c4 if error doesn't have a message set, print a stack trace 2024-09-29 16:21:53 +02:00
Jörg Thalheim
84383a4a48 if command fails, print command and exit code, regardless if error message is set 2024-09-29 16:21:53 +02:00
Jörg Thalheim
07e031f256 expose nixos-facter in cli 2024-09-29 16:21:53 +02:00
Qubasa
945c491d05 clan flash: Remove root requirement for flash, add a flash-template 2024-09-24 13:42:21 +02:00
Jörg Thalheim
d0ed48284b use packaged nixos-facter in generate_hardware_info 2024-09-24 11:38:33 +02:00
Qubasa
a27880a65e clan-cli: Move clan machines import to clan machines create 2024-09-23 17:11:48 +02:00
DavHau
e49d1f0127 vars/sops: improve shared secrets, switching backend
When a second machine checks for a shared secret, now the exists() call returns negative and only when updating the secrets for that machine, the machine is added to the sops receivers.

Also throw proper errors when the user switches backends without cleaning the files first.
2024-09-20 15:06:54 +02:00
Jörg Thalheim
8a8b473236 rename hw-generate to update-hardware-config 2024-09-20 13:42:18 +02:00
DavHau
0a8b7f38a8 vars: implement migration
Migrating generated files from the facts subsystem to the vars subsystem is now possible.

HowTo:
1. declare `clan.core.vars.generators.<generator>.migrateFact = my_service` where `my_service` refers to a service from `clan.core.facts.services`
2. run `clan vers generate your_machine` or `clan machines update your_machine`

Vars will only be migrated for a generator if:
1. The facts service specified via `migrateFact` does exist
2. None of the vars to generate exist yet
3. All public var names exist in the public facts store
4. All secret var names exist in the secret fact store

If the migration is deemed possible, the generator script will not be executed. Instead the files from the public or secret facts store are read and stored into the corresponding vars store
2024-09-19 17:57:03 +02:00
DavHau
01c833f2bc vars/generate: improve output when vars are updated
fixes #2076

- print old and new value if possible
- also inform the user if something hasn't changed
2024-09-18 16:57:01 +02:00
Johannes Kirschbauer
9a24b1ee16 Inventory: docs fixup 2024-09-18 08:31:00 +02:00
DavHau
6fc27d402b vars: allow setting a default for values 2024-09-17 21:11:38 +02:00
DavHau
4ce3cf16bb vars: generate vars for clan install
fixes #2087
2024-09-17 20:41:39 +02:00
DavHau
bd79e6aef6 vars: generate proper commit messages
fixes #2126
2024-09-17 20:22:18 +02:00
Johannes Kirschbauer
72f79dee37 Inventory: docs improvements 2024-09-16 22:52:40 +02:00
DavHau
51bf3187d7 vars/tests: fix nix eval triggering git concurrent access
Prevents this error: Another git process seems to be running in this repository
2024-09-16 18:58:22 +02:00
Qubasa
e9bfb129a1 clan-cli: Init clan machines import 2024-09-16 18:15:55 +02:00
Johannes Kirschbauer
27768aa04b Update: inventory classes check 2024-09-16 12:52:28 +00:00
Johannes Kirschbauer
dc57c3d948 CLI: api.register type preservation 2024-09-16 12:52:28 +00:00
Johannes Kirschbauer
f3a9a4e108 CLI: update classes 2024-09-16 12:52:28 +00:00
Johannes Kirschbauer
8bda488425 CLI: use abstract schema to avoid module imports 2024-09-15 18:42:50 +02:00
Qubasa
cafab5783f clan-cli: Moved flash to own subcommand 2024-09-15 15:53:17 +02:00
Qubasa
b8720a3c44 flash: Replace disks[str,str] with list[Disk] type 2024-09-15 11:43:40 +02:00
Qubasa
2897cd3e73 flash: Fix gnome automounting bug 2024-09-14 18:11:41 +02:00
Johannes Kirschbauer
813172119e API: rename set_inventory 2024-09-13 16:11:10 +02:00
Johannes Kirschbauer
ba548de2bf Serde: support deserialise Any typed values 2024-09-13 16:11:10 +02:00
Qubasa
60397e0ca4 clanCore: init machine_id_v3 2024-09-13 12:17:49 +02:00
DavHau
81cb28b6c0 vars/sops/shared: add machines key on demand 2024-09-12 20:17:05 +02:00
clan-bot
65a1a1a3b8 Merge pull request 'API: remove all python dataclasses for clanModules (services)' (#2080) from hsjobeki/clan-core:hsjobeki-main into main 2024-09-12 16:37:51 +00:00
Johannes Kirschbauer
406c88907d UI: include inventory schema and generated types 2024-09-12 18:22:46 +02:00
DavHau
eafcb0f870 vars/list: display '<not set>' also for secrets 2024-09-12 17:24:29 +02:00
DavHau
85477d51f6 vars: get rid of meta.json 2024-09-12 16:52:44 +02:00
DavHau
e905407989 vars/sops: load sops info from nix instead of filesystem 2024-09-12 16:30:21 +02:00
Johannes Kirschbauer
e3d85fc2b8 API: type all services with dict[str,Any] in python to reduce complexity. 2024-09-12 16:19:51 +02:00
Johannes Kirschbauer
1a81c1f84b API: remove all python dataclasses for clanModules (services) 2024-09-12 16:19:51 +02:00
a-kenji
56ce3d625c clanModules/state-version: init state-version
This adds a clanModule that will initialize the `system.stateVersion`
upon deploying the machine for the first time.

If the machine is completely reinstalled, then the state version might be
regenerated. But care should be taken if rebuilding from backups.
2024-09-12 15:47:30 +02:00
clan-bot
3ccdcbb8e8 Merge pull request 'Classgen: support literal enums' (#2068) from hsjobeki/clan-core:hsjobeki-main into main 2024-09-12 07:33:27 +00:00
Johannes Kirschbauer
a559a01fb7 Clan-cli: update import in classes 2024-09-12 09:28:58 +02:00
Johannes Kirschbauer
be9a398ae3 Clan-cli: fix class update instruction 2024-09-12 09:28:16 +02:00