Package: quick-manage
Quick IT Management ToolsThis is a set of lightweight IT management tools meant for small organizations and homelabs.  It is meant to fall somewhere between the capabilities of bash scripts and ansible.The tools automate a handful of operations which I found myself having to repeatedly perform, but didn't have straightforward means of automation without jumping into much heavier and more complex solutions. The project is set up to provide a comfortable command line interface for manual and scripted use, while also being a fully usable Python 3 library.FeaturesI add these features as I have need of them, but suggestions and contributions are welcome:(All are in progress)Certificate checking and deploymentLocal hosts file managementLocal DNS static entry managementVyos wireguard managementDebuggingpipinstall--editable.Development InformationStartupFrom the command line, all persisted state is accessed through a singleton of theEnvironmentclass.  This is retrieved from theEnvironment.default()method.During the first call toEnvironment.default()the environment is constructed. The configuration for theEnvironmentobject is provided by theQuickConfigclass.  This in turn is constructed through theQuickConfig.default()static method, which attempts to load a configuration file from the default application configuration directory provided byclick.Object ConstructionThese mechanisms are messy and need to be streamlined once I have a better idea of all the things they need to do.Objects which provide functionality are constructed dynamically at runtime from stored configuration. TheEnvironmentobject has a field calledbuilderswhich is a simple dataclass that has twoIBuilderobjects, one for building context objects, and one for building key stores.AnIBuilderinstantiates objects at the request of callers.  Types which the builder can produce must be registered using theregistermethod, which takes the name The default implementation of anIBuilderis theGenericBuilder(these might be able to be squashed into one later).Registering a type with the builder involves giving it a friendly string name for the type (this is the human-readable name used in configuration files), the type of the object to be built, and the type of the configuration object. Types which are built by a builder must have a class initializer which accepts an instance of the configuration object as the first argument.Configurations for objects are stored in the form of json/yaml dictionaries having three elements: (1) a stringname, (2) a stringtypewhich matches a string type name registered with the appropriate builder, and (3) aconfigdictionary that will be passed into the initializer of the configuration object.  When something is going to be built, these three things are put into anEntityConfigobject which then gets given to the builder'sbuildmethod.  It will first instantiate the configuration type usingdacite'sfrom_dictmethod on theconfigdictionary.  Then it will instantiate the final object by passing this configuration object into the initializer for that class.All of this is basically a complicated way of managing dynamic configurations.HostsHosts are one of the main entities. A host represents a computer or something that acts like a computer.  It has the following properties:A unique nameA text descriptionA list of client management mechanisms (ssh, api, etc)A set of type based configurations