feat: Adds generate-config as json file.

This commit is contained in:
2024-11-29 22:25:50 -05:00
parent 505f7d8013
commit ed3f752694
6 changed files with 97 additions and 36 deletions

View File

@@ -3,7 +3,7 @@ import Foundation
import ShellClient
/// Represents the configuration.
public struct Configuration: Decodable {
public struct Configuration: Codable {
public let playbookDir: String?
public let inventoryPath: String?
@@ -41,8 +41,21 @@ public struct Configuration: Decodable {
return try decoder.decode(Configuration.self, from: data)
}
static var mock: Self {
.init(
playbookDir: "/path/to/playbook",
inventoryPath: "/path/to/inventory.ini",
templateRepo: "https://git.example.com/consult-template.git",
templateRepoVersion: "main",
templateDir: "/path/to/local/template",
defaultPlaybookArgs: "--vault-id=myId@$SCRIPTS/vault-gopass-client"
)
}
static var fileTemplate: String {
"""
# vi: ft=sh
# Example configuration, uncomment the lines and set the values appropriate for your
# usage.