Skip to content

Commit

Permalink
Update systemd config and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
slapcat committed Apr 7, 2024
1 parent 80a9d11 commit db1a26c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 24 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ override_hostname:
**Location**
The bureau configuration is looked for in these locations in order of precedence:
- same directory as the binary
- ~/.bureau.yaml
- ~/.config/bureau/bureau.yaml
- /etc/bureau/bureau.yaml
**Daemon Mode**
`daemon` mode will run the bureau binary as a service. Only use this mode if you are not using an init system like `systemd`. `update_interval` specifies the number of seconds between each LDAP search for new config files when running in daemon mode. (For systemd, update the bureau.timer unit file.)
`daemon` mode will run the bureau binary as a service. This mode is the default in order to benefit from bureau's in-memory tracking of LDAP changes, which will only pull entire entries if they have a more recent `modifyTimestamp` than the previous time it was checked. It is recommended to use daemon mode in addition to the systemd service. `update_interval` specifies the number of seconds between each LDAP search for new config files.

**Host Specific Entries**

Expand Down Expand Up @@ -64,18 +65,16 @@ EOF
4. Start bureau in daemon mode or with systemd:
```
./bureau & # daemon
systemctl enable --now bureau.timer # systemd
systemctl enable --now bureau.service # systemd
```

Systemd will generate files owned by `root:root`. If you want to use bureau for user files, you can copy the systemd unit files to the user-specific directory:
Systemd will generate files owned by `root:root`. If you want to use bureau for user files, you can copy the systemd unit file to the user-specific directory:
```
cp /etc/systemd/system/bureau.* ~/.config/systemd/user/
cp /etc/systemd/system/bureau.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user --now bureau.timer bureau.service
systemctl enable --user --now bureau.service
```

The `bureau.timer` unit file runs every 5 minutes by default.

5. The new file should be available instantly:
```
$ cat /tmp/bureau-test.txt
Expand All @@ -91,8 +90,9 @@ Hello World!
- keepalivedVRRPInstanceConfig

# v1.0 Roadmap
- [ ] Additional schemas (ssh, systemd, sssd)
- [ ] Additional schemas
- [ ] Kubernetes (configMap) support
- [ ] LXD instance config support
- [ ] Secrets management

Raise an issue to request any other services you want to see supported.
2 changes: 1 addition & 1 deletion bureau.yaml.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
debug: true
debug: false
daemon: true
update_interval: 600
restart_service_on_change: true
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ func findConfig() ([]byte, error) {
var conf string

home, err := os.UserHomeDir()
locations := []string{home + "/.bureau.yaml",
locations := []string{"bureau.yaml",
home + "/.bureau.yaml",
home + "/.config/bureau/bureau.yaml",
"/etc/bureau/bureau.yaml"}

Expand Down
4 changes: 3 additions & 1 deletion systemd/bureau.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Description=bureau configuration agent
After=network.target

[Service]
Type=oneshot
Type=simple
Restart=always
RestartSec=1
ExecStart=/usr/bin/bureau

[Install]
Expand Down
13 changes: 0 additions & 13 deletions systemd/bureau.timer

This file was deleted.

0 comments on commit db1a26c

Please sign in to comment.