From 653b5ff9d61fce69f1b687f98904376a4cf4b42c Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Thu, 7 Mar 2024 16:56:45 -0700 Subject: [PATCH] Initial commit --- LICENSE.md | 21 +++++++++++++++++++++ README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 LICENSE.md create mode 100644 README.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..a17415c --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright © 2024 Triad National Security, LLC. This program was produced under U.S. Government contract 89233218CNA000001 for Los Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S. Department of Energy/National Nuclear Security Administration. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..08ba639 --- /dev/null +++ b/README.md @@ -0,0 +1,44 @@ +# OpenCHAMI Configurator + +Configurator is a tool that fetchs data from an instance of [SMD](https://github.com/OpenCHAMI/smd) to generate commonly used config files. + +## Building and Usage + +Configurator is built using Go: + +```bash +go mod tidy && go build +``` + +To use the tool, run the following: + +```bash +./configurator generate --config config.yaml --target dhcp:dnsmasq +``` + +This will generate a new DHCP `dnsmasq` config file based on the Jinja 2 template specified in the config file for "dnsmasq". The `--target` flag is set by passing an argument in the form of "type:template" to specify the type of config file being generate and the template file to use respectively. The configurator requires valid access token when making requests to an instance of SMD that has protected routes. + +## Configuration + +Here is an example config file to start using configurator: + +```yaml +version: "" +smd-host: http://127.0.0.1 +smd-port: 27779 +access-token: +templates: + coredhcp: templates/dhcp/coredhcp.config.jinja + dnsmasq: templates/dhcp/dnsmasq.conf.jinja + syslog: templates/syslog.jinja + ansible: templates/ansible + powerman: templates/powerman + conman: templates/conman +``` + + +## Known Issues + +- Adds a new `OAuthClient` with every token request + +## TODO \ No newline at end of file