# Interested in Ansible Role to install Ghost to run with podman containers / systemd / private networking?

**URL:** <https://forum.ghost.org/t/interested-in-ansible-role-to-install-ghost-to-run-with-podman-containers-systemd-private-networking/46226>\
**Category:** Self-hosting\
**Created:** [April 1, 2024, 12:45pm UTC](https://forum.ghost.org/t/interested-in-ansible-role-to-install-ghost-to-run-with-podman-containers-systemd-private-networking/46226 "2024-04-01T12:45:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [April 22, 2024, 5:05pm UTC](https://forum.ghost.org/t/interested-in-ansible-role-to-install-ghost-to-run-with-podman-containers-systemd-private-networking/46226/2 "2024-04-22T17:05:24Z")

</div>

Here’s what my template for a Ghost “.container” file looks like today. Ansible will render it with template variables and then Podman will use it to generate a systemd service file like “ghost\_my-blog-com.service”.

The generated service file will work like the one that Ghost itself generates, with the benefit that the service will now be containerized.

```ini
# MANAGED BY ANSIBLE
[Unit]
Description=Ghost Blog for {{ ghost_fqdn }}
After=network-online.target

# Keys are sorted in alpha-order
[Container]
# The name structure is exactly like what Ghost would create
ContainerName={{ ghost_service_name }}
Image={{ ghost_image }}
# TODO: Currently this is not setup for you and there's no option to disable it either.
# We should do one or the other.
Network={{ ghost_network_name }}.network
# Pick a value within 10.10.*.*.
IP={{ ghost_ip }}
#RunInit=true
# Map the "node" user in the container with UID 1000 inside the container to custom host user.
#UIDMap=1000:{{ ghost_mgr.uid }}
Volume={{ ghost_content_path }}:/var/lib/ghost/content:z
Volume={{ ghost_install_path }}/config.production.json:/var/lib/ghost/config.production.json:z

{#
 # systemctl enabled/disable doesn't work on the transient systemd units generated by Quadlet
 # Instead, we can add or remove this block to achieve the same effect.
#}
{% if ghost_enabled %}
[Install]
WantedBy=network-online.target
{% endif %}
# vi:ft=systemd

```

You can see I’m giving each Ghost blog a unique IP and adding to the same network, like “mysql.network”, so they can access a shared MySQL database.

---

_[View the full topic](https://forum.ghost.org/t/interested-in-ansible-role-to-install-ghost-to-run-with-podman-containers-systemd-private-networking/46226)._
