Examples
Scripts to read, in examples/: from a one-file hello world to a k3s cluster and the applications on it.
They are in examples/ in the source. Each is a script that runs as it
is: python examples/hello.py show lists what it declares, without
touching a host.
To start with#
| Script | What it shows |
|---|---|
hello.py | the one-file hello world |
webserver.py | a role, group_vars, a template and a real inventory |
profiles.py | one script, prod and dev |
stack.py | everything at once: galaxy requirements, a local collection, molecule and ansible-test targets, a custom check, profiles |
examples/webserver2.py.A cluster, described#
k3s.py and the applications on it use described groups and variables,
and stages that run alone. cluster.py imports them all: the k3s cluster
and everything on it, as one playbook.
| Script | What it sets up |
|---|---|
k3s.py | k3s on hardened Fedora droplets that are reached over Tailscale |
longhorn.py | Longhorn, storage that is kept on more than one node |
gitea.py | Gitea, reached over Tailscale |
gitea_runner.py | a runner for Gitea Actions |
zot.py | a container registry, zot |
monitoring.py | Grafana and Prometheus |
awx.py | AWX, reached over Tailscale |
rancher.py | Rancher Manager |
kanboard.py | Kanboard, with what an older one held |
portfolio.py | a Hugo site, served by nginx |
chronoclone.py | ChronoClone’s scan service |
instamix_deploy.py | what instamix’s own pipeline deploys with |
wordpress.py is what imix import wrote from an existing playbook tree.
Reading one#
$ python examples/k3s.py describe # its stages, groups and variables
$ python examples/k3s.py cat site.yml # what it would hand to ansible
$ python examples/cluster.py describe # the same, of the whole