From fdc0f0f2c5f3b12c9fbbbf91bdb4749d213d1927 Mon Sep 17 00:00:00 2001 From: ducoterra Date: Fri, 6 Feb 2026 20:21:33 -0500 Subject: [PATCH] add podman etc notes --- active/software_etcd/etcd.md | 59 ++++++++++++++++++++++++ active/software_etcd/etcd.service | 12 +++++ active/software_etcd/foobar.sh.j2 | 3 ++ active/software_etcd/foobar.timer | 11 +++++ active/software_etcd/install_foobar.yaml | 39 ++++++++++++++++ active/software_etcd/vars.yaml | 1 + 6 files changed, 125 insertions(+) create mode 100644 active/software_etcd/etcd.md create mode 100644 active/software_etcd/etcd.service create mode 100644 active/software_etcd/foobar.sh.j2 create mode 100644 active/software_etcd/foobar.timer create mode 100644 active/software_etcd/install_foobar.yaml create mode 100644 active/software_etcd/vars.yaml diff --git a/active/software_etcd/etcd.md b/active/software_etcd/etcd.md new file mode 100644 index 0000000..0f1cbf2 --- /dev/null +++ b/active/software_etcd/etcd.md @@ -0,0 +1,59 @@ +# etcd + +- [etcd](#etcd) + - [Setup etcd Project](#setup-etcd-project) + - [Service Variables](#service-variables) + - [Install etcd](#install-etcd) + - [Fedora](#fedora) + - [Upgrade etcd](#upgrade-etcd) + - [Backup etcd](#backup-etcd) + - [Restore etcd](#restore-etcd) + - [Uninstall etcd](#uninstall-etcd) + +## Setup etcd Project + +1. Copy and rename this folder to active/software_etcd +2. Find and replace etcd with the name of the service +3. Write the etcd.service spec +4. (OPTIONAL) Write the etcd.timer spec +5. (OPTIONAL) Write the etcd.sh.j2 template +6. Write the install_etcd.yaml ansible template +7. Install the service via ansible +8. Expose the service +9. Install a backup service and timer + +## Service Variables + +1. For most vars,populate `vars.yaml` +2. For secret vars, create a new folder called `secrets/` and put a `vars.yaml` there. + +## Install etcd + + + +### Fedora + +```bash +sudo dnf install etcd + +``` + +```bash +# Run the playbook +ansible-playbook \ +-i ansible/inventory.yaml \ +-l podman \ +active/software_etcd/install_etcd.yaml \ +-e "@active/software_etcd/vars.yaml" \ +-e "@active/software_etcd/secrets/vars.yaml" +``` + +## Upgrade etcd + +## Backup etcd + +Follow the [Borg Backup instructions](/active/software_borg/borg.md#set-up-a-client-for-backup) + +## Restore etcd + +## Uninstall etcd diff --git a/active/software_etcd/etcd.service b/active/software_etcd/etcd.service new file mode 100644 index 0000000..78a904f --- /dev/null +++ b/active/software_etcd/etcd.service @@ -0,0 +1,12 @@ +[Unit] +Description=Runs foobar +After=network.target +Wants=network-online.target + +[Service] +Restart=no +Type=oneshot +ExecStart=/usr/local/script/foobar.sh + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/active/software_etcd/foobar.sh.j2 b/active/software_etcd/foobar.sh.j2 new file mode 100644 index 0000000..a110be8 --- /dev/null +++ b/active/software_etcd/foobar.sh.j2 @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "hello foobar!" \ No newline at end of file diff --git a/active/software_etcd/foobar.timer b/active/software_etcd/foobar.timer new file mode 100644 index 0000000..6afc0e7 --- /dev/null +++ b/active/software_etcd/foobar.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Run Foobar every day + +[Timer] +OnCalendar=*-*-* 2:00:00 +AccuracySec=10min +Persistent=true +Unit=foobar.service + +[Install] +WantedBy=timers.target diff --git a/active/software_etcd/install_foobar.yaml b/active/software_etcd/install_foobar.yaml new file mode 100644 index 0000000..b937fdb --- /dev/null +++ b/active/software_etcd/install_foobar.yaml @@ -0,0 +1,39 @@ +- name: Create Backup Service + hosts: all + vars_files: + - secrets/vars.yaml + tasks: + - name: Create /usr/local/script dir + ansible.builtin.file: + path: /usr/local/script + state: directory + mode: '0755' + - name: Copy foobar.service + template: + src: backup.service + dest: /etc/systemd/system/foobar.service + owner: root + group: root + mode: '0644' + - name: Copy foobar.timer + template: + src: backup.timer + dest: /etc/systemd/system/foobar.timer + owner: root + group: root + mode: '0644' + - name: Template foobar.sh + template: + src: backup.sh.j2 + dest: /usr/local/script/foobar.sh + owner: root + group: root + mode: '0744' + - name: Something foobar related that might fail + script: echo 'hello foobar!' + ignore_errors: yes + - name: Reload foobar.timer + ansible.builtin.systemd_service: + name: foobar.timer + enabled: true + daemon_reload: true diff --git a/active/software_etcd/vars.yaml b/active/software_etcd/vars.yaml new file mode 100644 index 0000000..f9f2e1e --- /dev/null +++ b/active/software_etcd/vars.yaml @@ -0,0 +1 @@ +name: foobar