Skip to content

Commit

Permalink
replace python with go, merge readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
andygeorge committed Sep 27, 2022
1 parent 9ff3510 commit 8375c9f
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 87 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
example_files/
output/
/go/build/*
build/
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Injection

Injection is a simple Python3 utility that consumes and processes [Ignition](https://coreos.github.io/ignition/) configs and writes out directories, files, and systemd units (and optionally enables/starts them!) on an **already-running Linux host**, differing from Ignition, which is only intended to configure immutable Fedora/RedHat CoreOS hosts on first boot.
Injection is a simple utility that consumes and processes [Ignition](https://coreos.github.io/ignition/) configs and writes out directories, files, and systemd units (and enables/disables them!) on an **already-running Linux host**, differing from Ignition, which is only intended to configure immutable Fedora/RedHat CoreOS hosts on first boot.

In conjunction with [Butane](https://coreos.github.io/butane/), this allows you to build human-readable configuration files that can be used to easily (re)configure existing hosts.

## Prerequisites

- Python 3
- Linux/macOS
- [Butane](https://coreos.github.io/butane/getting-started/#getting-butane), if you're planning on using Butane to generate Ignition configs (recommended)

## Installation
Expand Down Expand Up @@ -52,3 +52,19 @@ This only has basic Ignition support for a few specific fields:
- `systemd:units`

Support for `passwd:users` is [planned](https://github.com/andygeorge/injection/issues/1).


----
# injection-go
`injection` built in Go.

```shell
# generate ignition
butane --strict ../example_files/example.bu > ../example_files/example.ign

# build injection
go mod tidy && go fmt *.go && go build -o build/

# run injection
./build/injection ../example_files/example.ign
```
File renamed without changes.
13 changes: 0 additions & 13 deletions go/README.md

This file was deleted.

69 changes: 0 additions & 69 deletions injection

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions go/test.sh → test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
/usr/bin/butane --strict ../example_files/example.bu > ../example_files/example.ign
/usr/bin/butane --strict example_files/example.bu > example_files/example.ign
rm -rf /tmp/example/
/usr/local/go/bin/go mod tidy && /usr/local/go/bin/go fmt *.go && /usr/local/go/bin/go build -o build/
./build/injection ../example_files/example.ign
./build/injection example_files/example.ign

0 comments on commit 8375c9f

Please sign in to comment.