# Podman

- [Podman](#podman)
  - [Notes](#notes)
  - [Podman systemd files](#podman-systemd-files)
    - [iperf3](#iperf3)
    - [pihole](#pihole)
    - [Cloudflared](#cloudflared)
  - [Update yellow quadlets](#update-yellow-quadlets)

## Notes

- podman auth is stored in `/run/user/1000/containers`

## Podman systemd files

Rather than copying compose files or running podman run as systemd services you can
generate quadlet files to define containers that run at boot.

Podlet generates quadlets - systemd files specifically for containers.

You generate quadlets from compose files like so:

```bash
podman run \
    -v ./compose:/compose \
    -v ./quadlets:/quadlets \
    quay.io/k9withabone/podlet \
    -f /quadlets \
    -i \
    --overwrite \
    compose /compose/grafana-compose.yaml
```

Copy these files to `/usr/share/containers/systemd/`

### iperf3

```bash
podman run \
    -v ./podman/compose:/compose \
    -v ./podman/quadlets:/quadlets \
    quay.io/k9withabone/podlet \
    -f /quadlets \
    -i \
    --overwrite \
    compose /compose/iperf3-compose.yaml
```

### pihole

<https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts>

```bash
podman run \
    -v ./podman/compose:/compose \
    -v ./podman/quadlets:/quadlets \
    quay.io/k9withabone/podlet \
    -f /quadlets \
    -i \
    --overwrite \
    --wants network-online.target \
    --after network-online.target \
    compose /compose/pihole-compose.yaml
```

### Cloudflared

https://docs.pi-hole.net/guides/dns/cloudflared/

Creates a DOH proxy for pihole. Just set the pihole upstream to `10.1.203.197#5053` (yellow) or
`10.1.200.253#5053` (orange).

```bash
podman run \
    -v ./podman/compose:/compose \
    -v ./podman/quadlets:/quadlets \
    quay.io/k9withabone/podlet \
    -f /quadlets \
    -i \
    --overwrite \
    --wants network-online.target \
    --after network-online.target \
    compose /compose/cloudflared-compose.yaml
```

## Update yellow quadlets

```bash
ansible-playbook -i ./ansible/inventory.yaml podman/update-quadlets.yaml
```
