<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ansible Deployment on pgcli</title>
    <link>https://pgcli.pages.dev/docs/ansible/</link>
    <description>Recent content in Ansible Deployment on pgcli</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    
    
    
      <lastBuildDate>Mon, 23 Nov 2026 18:38:28 +0800</lastBuildDate>
    
    
      <atom:link href="https://pgcli.pages.dev/docs/ansible/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
        <title>S3 storage</title>
        <link>https://pgcli.pages.dev/docs/ansible/s3/</link>
        
        
        <guid>https://pgcli.pages.dev/docs/ansible/s3/</guid>
        <description>&lt;p&gt;A standalone S3-compatible store gives &lt;code&gt;backup_target: s3&lt;/code&gt; instances and HA&#xA;clusters a shared pgBackRest repository. Three store types are supported, each&#xA;with its own example group.&lt;/p&gt;&#xA;&lt;h2 id=&#34;activate-one-store-type&#34;&gt;Activate one store type&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;hosts.ini.example&lt;/code&gt; declares all three groups; only one child is active under&#xA;&lt;code&gt;[s3]&lt;/code&gt; at a time:&lt;/p&gt;&#xA;&lt;div class=&#34;td-code td-code--untitled&#34; id=&#34;td-code-726c8796-fence-0&#34; data-td-code data-td-code-auto-id&#xA;     data-td-language=&#34;ini&#34; data-td-line-count=&#34;7&#34;&gt;&#xA;  &lt;div class=&#34;td-code__viewport&#34; id=&#34;td-code-726c8796-fence-0-viewport&#34; data-td-code-viewport&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-ini&#34; data-lang=&#34;ini&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;[silo_s3]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;s3-01 ansible_host&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;192.0.2.20 private_ip=192.0.2.20 ansible_user=root ansible_port=22&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;[s3:children]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# minio_s3&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;na&#34;&gt;silo_s3&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# rustfs_s3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;Copy the matching example group vars:&lt;/p&gt;</description>
      </item>
    <item>
        <title>HA clusters</title>
        <link>https://pgcli.pages.dev/docs/ansible/ha/</link>
        
        
        <guid>https://pgcli.pages.dev/docs/ansible/ha/</guid>
        <description>&lt;p&gt;The HA deployment spans two inventory groups and two example variable files:&lt;/p&gt;&#xA;&lt;div class=&#34;td-table-scroll td-table-scroll--static&#34;&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;    &lt;tr&gt;&#xA;      &lt;th scope=&#34;col&#34;&gt;Group&lt;/th&gt;&#xA;      &lt;th scope=&#34;col&#34;&gt;File&lt;/th&gt;&#xA;      &lt;th scope=&#34;col&#34;&gt;Role&lt;/th&gt;&#xA;    &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;    &lt;tr&gt;&#xA;      &lt;td&gt;&lt;code&gt;[ha_etcd]&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;td&gt;&lt;code&gt;group_vars/ha_etcd/main.yml&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;td&gt;Shared etcd DCS, one member per host&lt;/td&gt;&#xA;    &lt;/tr&gt;&#xA;    &lt;tr&gt;&#xA;      &lt;td&gt;&lt;code&gt;[ha_cluster]&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;td&gt;&lt;code&gt;group_vars/ha_cluster/main.yml&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;td&gt;Patroni members, per-namespace clusters, HAProxy&lt;/td&gt;&#xA;    &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;The same hosts may appear in both groups (co-located layout). List the etcd&#xA;bootstrap host first; the add-on play is serial.&lt;/p&gt;&#xA;&lt;h2 id=&#34;etcd-group_varsha_etcdmainymlexample&#34;&gt;etcd: &lt;code&gt;group_vars/ha_etcd/main.yml.example&lt;/code&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;The file is group-name agnostic: set &lt;code&gt;pg_etcd_group&lt;/code&gt; once and everything below&#xA;follows it.&lt;/p&gt;</description>
      </item>
    <item>
        <title>Add-on clusters</title>
        <link>https://pgcli.pages.dev/docs/ansible/addon-cluster/</link>
        
        
        <guid>https://pgcli.pages.dev/docs/ansible/addon-cluster/</guid>
        <description>&lt;p&gt;The &lt;code&gt;addon_&amp;lt;type&amp;gt;_cluster&lt;/code&gt; inventory groups deploy one cluster-capable add-on&#xA;across several hosts. They are the multi-host companion of&#xA;&lt;a href=&#34;https://pgcli.pages.dev/docs/ansible/addons/&#34;&gt;Add-ons&lt;/a&gt;: the entry fields (&lt;code&gt;type&lt;/code&gt;, &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;state&lt;/code&gt;, &lt;code&gt;params&lt;/code&gt;,&#xA;&lt;code&gt;args&lt;/code&gt;, &lt;code&gt;clean_data&lt;/code&gt;, &lt;code&gt;force&lt;/code&gt;, &lt;code&gt;autostart&lt;/code&gt;) are the same, but the host lists,&#xA;peer arguments and shared secrets are derived from the inventory instead of&#xA;being written per host.&lt;/p&gt;&#xA;&lt;p&gt;The groups are deliberately not a &amp;ldquo;deploy everything&amp;rdquo; group. The reference VMs&#xA;are small, so one add-on type is reconciled per run and every command selects&#xA;its group with &lt;code&gt;--limit addon_&amp;lt;type&amp;gt;_cluster&lt;/code&gt;.&lt;/p&gt;</description>
      </item>
    <item>
        <title>Add-ons</title>
        <link>https://pgcli.pages.dev/docs/ansible/addons/</link>
        
        
        <guid>https://pgcli.pages.dev/docs/ansible/addons/</guid>
        <description>&lt;p&gt;Add-ons are declared as &lt;code&gt;addon_&amp;lt;group&amp;gt;_addons&lt;/code&gt; lists in&#xA;&lt;code&gt;group_vars/addon_&amp;lt;type&amp;gt;_&amp;lt;mode&amp;gt;/main.yml&lt;/code&gt;. &lt;code&gt;group_vars/all&lt;/code&gt; reads the list of&#xA;the group named by &lt;code&gt;--limit&lt;/code&gt; into &lt;code&gt;pgcli_addons&lt;/code&gt;, so one run selects one&#xA;add-on group:&lt;/p&gt;&#xA;&lt;div class=&#34;td-code td-code--untitled&#34; id=&#34;td-code-4582ff6a-fence-0&#34; data-td-code data-td-code-auto-id&#xA;     data-td-language=&#34;bash&#34; data-td-line-count=&#34;2&#34;&gt;&#xA;  &lt;div class=&#34;td-code__viewport&#34; id=&#34;td-code-4582ff6a-fence-0-viewport&#34; data-td-code-viewport&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;uv run ansible-playbook playbooks/apply.yaml &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  --limit addon_pgbouncer_single --tags addon&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;The repository ships one group per add-on type and installation form:&#xA;&lt;code&gt;addon_&amp;lt;type&amp;gt;_single&lt;/code&gt; (one host) and &lt;code&gt;addon_&amp;lt;type&amp;gt;_cluster&lt;/code&gt; (three or four&#xA;hosts). See &lt;a href=&#34;https://pgcli.pages.dev/docs/ansible/addon-cluster/&#34;&gt;Add-on clusters&lt;/a&gt; for the cluster form. The&#xA;&lt;code&gt;ha_etcd&lt;/code&gt; and S3 groups define &lt;code&gt;pgcli_addons&lt;/code&gt; directly and keep working the&#xA;same way. &lt;code&gt;type&lt;/code&gt; takes any add-on accepted by &lt;code&gt;pg addon install&lt;/code&gt; — see the&#xA;&lt;a href=&#34;../../addon/&#34;&gt;add-on reference&lt;/a&gt; for the full list (pgbouncer, pgdog, etcd,&#xA;haproxy, minio/silo/rustfs, redis, nginx, prometheus, kafka, and so on).&lt;/p&gt;</description>
      </item>
    <item>
        <title>Observability deployment</title>
        <link>https://pgcli.pages.dev/docs/ansible/observability/</link>
        
        
        <guid>https://pgcli.pages.dev/docs/ansible/observability/</guid>
        <description>&lt;p&gt;The &lt;code&gt;observable&lt;/code&gt; scenario turns a fleet of machines into a monitored data&#xA;center: every member runs &lt;code&gt;node_exporter&lt;/code&gt;, PostgreSQL hosts also run&#xA;&lt;code&gt;pg_exporter&lt;/code&gt;, and one host runs Prometheus, Alertmanager, Grafana, and the&#xA;alert webhook. Instances, add-ons, and the webhook process are declared in&#xA;group variables and converged by one &lt;code&gt;apply.yaml&lt;/code&gt; run. Adding machines means&#xA;adding inventory entries and re-running the playbook — no per-host commands.&lt;/p&gt;&#xA;&lt;p&gt;The shipped reference is &lt;code&gt;group_vars/observable/main.yml.example&lt;/code&gt;;&#xA;&lt;code&gt;group_vars/observable/README.md&lt;/code&gt; contains the full Grafana API walkthrough.&lt;/p&gt;</description>
      </item>
    <item>
        <title>Instances and replicas</title>
        <link>https://pgcli.pages.dev/docs/ansible/instances/</link>
        
        
        <guid>https://pgcli.pages.dev/docs/ansible/instances/</guid>
        <description>&lt;p&gt;PostgreSQL instances are declared in &lt;code&gt;pgcli_instances&lt;/code&gt;, normally in one&#xA;deployment-mode group&amp;rsquo;s &lt;code&gt;group_vars/&amp;lt;mode&amp;gt;/main.yml&lt;/code&gt;. &lt;code&gt;apply.yaml --tags instance&lt;/code&gt; (run with &lt;code&gt;serial: 1&lt;/code&gt;) reconciles each host&amp;rsquo;s entries whose &lt;code&gt;host:&lt;/code&gt;&#xA;matches that host.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-three-mode-examples&#34;&gt;The three mode examples&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Each example file is small; copy the one matching the mode you exercise.&lt;/p&gt;&#xA;&lt;h3 id=&#34;group_varssinglemainymlexample&#34;&gt;&lt;code&gt;group_vars/single/main.yml.example&lt;/code&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;One stand-alone primary:&lt;/p&gt;&#xA;&lt;div class=&#34;td-code td-code--untitled&#34; id=&#34;td-code-86ecf4b8-fence-0&#34; data-td-code data-td-code-auto-id&#xA;     data-td-language=&#34;yaml&#34; data-td-line-count=&#34;8&#34;&gt;&#xA;  &lt;div class=&#34;td-code__viewport&#34; id=&#34;td-code-86ecf4b8-fence-0-viewport&#34; data-td-code-viewport&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;pgcli_config_overrides&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;namespace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;dev&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;pgcli_instances&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;pg_single&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;host&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;db-01&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;state&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;started&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;autostart&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;h3 id=&#34;group_varssamehostmainymlexample&#34;&gt;&lt;code&gt;group_vars/samehost/main.yml.example&lt;/code&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;Primary and a read-only replica on the same host:&lt;/p&gt;</description>
      </item>
    <item>
        <title>Playbooks</title>
        <link>https://pgcli.pages.dev/docs/ansible/playbooks/</link>
        
        
        <guid>https://pgcli.pages.dev/docs/ansible/playbooks/</guid>
        <description>&lt;p&gt;All commands run from the &lt;code&gt;ansible/&lt;/code&gt; directory through the pinned &lt;code&gt;uv&lt;/code&gt;&#xA;environment. Without &lt;code&gt;--limit&lt;/code&gt;, &lt;code&gt;apply.yaml&lt;/code&gt; targets every host in the&#xA;inventory; in practice you select a deployment-mode group or one add-on group&#xA;with &lt;code&gt;--limit addon_&amp;lt;type&amp;gt;_&amp;lt;single|cluster&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;div class=&#34;td-code td-code--untitled&#34; id=&#34;td-code-12dd3230-fence-0&#34; data-td-code data-td-code-auto-id&#xA;     data-td-language=&#34;bash&#34; data-td-line-count=&#34;2&#34;&gt;&#xA;  &lt;div class=&#34;td-code__viewport&#34; id=&#34;td-code-12dd3230-fence-0-viewport&#34; data-td-code-viewport&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; ansible&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;uv run ansible-playbook playbooks/apply.yaml&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;h2 id=&#34;pingyaml&#34;&gt;&lt;code&gt;ping.yaml&lt;/code&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;SSH and Python connectivity smoke test for every inventory host:&lt;/p&gt;&#xA;&lt;div class=&#34;td-code td-code--untitled&#34; id=&#34;td-code-12dd3230-fence-1&#34; data-td-code data-td-code-auto-id&#xA;     data-td-language=&#34;bash&#34; data-td-line-count=&#34;2&#34;&gt;&#xA;  &lt;div class=&#34;td-code__viewport&#34; id=&#34;td-code-12dd3230-fence-1-viewport&#34; data-td-code-viewport&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;uv run ansible-playbook playbooks/ping.yaml&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;uv run ansible-playbook playbooks/ping.yaml --limit crosshost&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;h2 id=&#34;applyyaml&#34;&gt;&lt;code&gt;apply.yaml&lt;/code&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;The generic play. It does not contain mode-specific data: it reconciles&#xA;whatever the selected hosts declare in &lt;code&gt;group_vars/&lt;/code&gt;.&lt;/p&gt;</description>
      </item>
    <item>
        <title>HTTP File Server</title>
        <link>https://pgcli.pages.dev/docs/ansible/http-server/</link>
        
        
        <guid>https://pgcli.pages.dev/docs/ansible/http-server/</guid>
        <description>&lt;p&gt;&lt;code&gt;playbooks/deploy-http.yaml&lt;/code&gt; brings &lt;a href=&#34;https://pgcli.pages.dev/docs/toolbox/http/&#34;&gt;pg http&lt;/a&gt; file servers&#xA;under Ansible management. &lt;code&gt;pg http&lt;/code&gt; is a host process (no container, no add-on&#xA;type), so this uses a standalone &lt;code&gt;pg_http&lt;/code&gt; role and a standalone playbook&#xA;instead of &lt;code&gt;pg_addon&lt;/code&gt; / &lt;code&gt;apply.yaml&lt;/code&gt;, mirroring how &lt;code&gt;deploy-s3.yaml&lt;/code&gt; is&#xA;organized.&lt;/p&gt;&#xA;&lt;p&gt;The role reconciles each server declared in &lt;code&gt;pgcli_http_servers&lt;/code&gt;: it compares&#xA;the running spec by name and runs &lt;code&gt;pg http stop&lt;/code&gt; + &lt;code&gt;pg http start&lt;/code&gt; when&#xA;anything differs, creates the served directory, optionally copies the offline&#xA;binaries into it (&lt;code&gt;sync_binaries: true&lt;/code&gt;), and registers boot autostart as needed.&#xA;Binary copying is disabled by default. Re-running converges to the declared state.&lt;/p&gt;</description>
      </item>
    <item>
        <title>Offline image server</title>
        <link>https://pgcli.pages.dev/docs/ansible/image-server/</link>
        
        
        <guid>https://pgcli.pages.dev/docs/ansible/image-server/</guid>
        <description>&lt;p&gt;An air-gapped install needs two things: a directory of image tarballs reachable on&#xA;the LAN, and &lt;code&gt;pgcli_images_http_url&lt;/code&gt; pointing at it. The repository ships&#xA;&lt;code&gt;scripts/export-images.sh&lt;/code&gt; for the first part: it reads the list from&#xA;&lt;code&gt;docs/images.md&lt;/code&gt; or from the Ansible &lt;code&gt;pgcli_images&lt;/code&gt; variable, pulls each image,&#xA;and saves it as a &lt;code&gt;docker-archive&lt;/code&gt; tarball whose name matches the offline&#xA;manifest. &lt;code&gt;pg http&lt;/code&gt; provides the second part.&lt;/p&gt;&#xA;&lt;div class=&#34;td-code td-code--untitled&#34; id=&#34;td-code-6093c4c4-fence-0&#34; data-td-code data-td-code-auto-id&#xA;     data-td-language=&#34;text&#34; data-td-line-count=&#34;3&#34;&gt;&#xA;  &lt;div class=&#34;td-code__viewport&#34; id=&#34;td-code-6093c4c4-fence-0-viewport&#34; data-td-code-viewport&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;connected host                              isolated network&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;export-images.sh ──▶ /srv/offline-images ──HTTP──▶ pgcli_images_http_url&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  (podman pull/save)      (pg http)               (loaded into podman)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;h2 id=&#34;export-the-images&#34;&gt;Export the images&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;By default the script reads the image tables in &lt;code&gt;docs/images.md&lt;/code&gt; and writes to&#xA;&lt;code&gt;images/&lt;/code&gt; under the repository root:&lt;/p&gt;</description>
      </item>
    <item>
        <title>Egress proxy</title>
        <link>https://pgcli.pages.dev/docs/ansible/proxy/</link>
        
        
        <guid>https://pgcli.pages.dev/docs/ansible/proxy/</guid>
        <description>&lt;p&gt;In an isolated data center the database hosts have no direct route to the&#xA;internet. Run one Privoxy add-on on a host that does, and point the playbooks&#xA;at it — installs, image pulls, runtime downloads and extension builds then&#xA;share that egress.&lt;/p&gt;&#xA;&lt;div class=&#34;td-code td-code--untitled&#34; id=&#34;td-code-5ae45efc-fence-0&#34; data-td-code data-td-code-auto-id&#xA;     data-td-language=&#34;text&#34; data-td-line-count=&#34;1&#34;&gt;&#xA;  &lt;div class=&#34;td-code__viewport&#34; id=&#34;td-code-5ae45efc-fence-0-viewport&#34; data-td-code-viewport&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;managed hosts ── HTTP / CONNECT ──▶ Privoxy (connected host) ──▶ internet&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;h2 id=&#34;start-the-proxy&#34;&gt;Start the proxy&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Run this on the host with internet access; the same pgcli binary and image set&#xA;is enough, no extra package:&lt;/p&gt;</description>
      </item>
    <item>
        <title>Offline and air-gapped installs</title>
        <link>https://pgcli.pages.dev/docs/ansible/offline/</link>
        
        
        <guid>https://pgcli.pages.dev/docs/ansible/offline/</guid>
        <description>&lt;p&gt;The playbooks can install and operate pgcli without reaching GitHub, ghcr.io,&#xA;Docker Hub or distro mirrors. A single static HTTP directory on the LAN can&#xA;serve every artifact: consumers always fetch &lt;code&gt;&amp;lt;base&amp;gt;/&amp;lt;basename&amp;gt;&lt;/code&gt;, so one flat&#xA;server root is enough.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-the-server-hosts&#34;&gt;What the server hosts&#xA;&lt;/h2&gt;&#xA;&lt;div class=&#34;td-table-scroll td-table-scroll--static&#34;&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;    &lt;tr&gt;&#xA;      &lt;th scope=&#34;col&#34;&gt;Variable&lt;/th&gt;&#xA;      &lt;th scope=&#34;col&#34;&gt;Artifact&lt;/th&gt;&#xA;      &lt;th scope=&#34;col&#34;&gt;Consumed by&lt;/th&gt;&#xA;    &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;    &lt;tr&gt;&#xA;      &lt;td&gt;&lt;code&gt;pgcli_images_http_url&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;td&gt;&lt;code&gt;podman save&lt;/code&gt; tarballs produced by &lt;code&gt;make container-images-export&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;td&gt;&lt;code&gt;pgcli&lt;/code&gt; role during install; &lt;code&gt;pg_addon&lt;/code&gt; / &lt;code&gt;pg_ha_haproxy&lt;/code&gt; lazily&lt;/td&gt;&#xA;    &lt;/tr&gt;&#xA;    &lt;tr&gt;&#xA;      &lt;td&gt;&lt;code&gt;pgcli_install_binary_url&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;td&gt;&lt;code&gt;pg&lt;/code&gt; binary — raw file or &lt;code&gt;pgcli_&amp;lt;version&amp;gt;_linux_amd64.tar.gz&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;td&gt;&lt;code&gt;pgcli&lt;/code&gt; role&lt;/td&gt;&#xA;    &lt;/tr&gt;&#xA;    &lt;tr&gt;&#xA;      &lt;td&gt;&lt;code&gt;pgcli_podman_binary_url&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;td&gt;&lt;code&gt;podman-launcher&lt;/code&gt; binary&lt;/td&gt;&#xA;      &lt;td&gt;&lt;code&gt;pgcli&lt;/code&gt; role when &lt;code&gt;/usr/local/bin/podman&lt;/code&gt; is missing&lt;/td&gt;&#xA;    &lt;/tr&gt;&#xA;    &lt;tr&gt;&#xA;      &lt;td&gt;&lt;code&gt;pgcli_download_mirror&lt;/code&gt;&lt;/td&gt;&#xA;      &lt;td&gt;host binaries (juicefs, zerofs, duckdb, Litestream) and DocumentDB DEBs&lt;/td&gt;&#xA;      &lt;td&gt;&lt;code&gt;pg&lt;/code&gt; at runtime through &lt;code&gt;PGCLI_DOWNLOAD_MIRROR&lt;/code&gt;&lt;/td&gt;&#xA;    &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;All four are set in &lt;code&gt;group_vars/all/main.yml&lt;/code&gt;; the committed template is&#xA;&lt;code&gt;group_vars/all/main.yml.example&lt;/code&gt;.&lt;/p&gt;</description>
      </item>
    <item>
        <title>Setup and example files</title>
        <link>https://pgcli.pages.dev/docs/ansible/setup/</link>
        
        
        <guid>https://pgcli.pages.dev/docs/ansible/setup/</guid>
        <description>&lt;p&gt;The repository never commits environment-specific files. Everything is&#xA;prepared by copying a checked-in &lt;code&gt;*.example&lt;/code&gt; file to its live name, then&#xA;editing it. The live copies are ignored by &lt;code&gt;ansible/.gitignore&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&#xA;&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A Linux or macOS control node with &lt;a href=&#34;https://docs.astral.sh/uv/&#34;&gt;uv&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;SSH access to every managed host. The examples use &lt;code&gt;ansible_user=root&lt;/code&gt;.&#xA;Rootless deployments keep the SSH account separate from the unprivileged&#xA;deployment account; the SSH account still needs sudo because host&#xA;preparation always runs through &lt;code&gt;become&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Target hosts run a supported Linux distribution; podman is installed by the&#xA;&lt;code&gt;pgcli&lt;/code&gt; role when missing.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;prepare-the-environment&#34;&gt;Prepare the environment&#xA;&lt;/h2&gt;&#xA;&lt;div class=&#34;td-code td-code--untitled&#34; id=&#34;td-code-813127ae-fence-0&#34; data-td-code data-td-code-auto-id&#xA;     data-td-language=&#34;bash&#34; data-td-line-count=&#34;2&#34;&gt;&#xA;  &lt;div class=&#34;td-code__viewport&#34; id=&#34;td-code-813127ae-fence-0-viewport&#34; data-td-code-viewport&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; ansible&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;uv sync&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;&lt;code&gt;pyproject.toml&lt;/code&gt; pins Ansible (&lt;code&gt;ansible-core 2.18&lt;/code&gt;); always run playbooks&#xA;through &lt;code&gt;uv run&lt;/code&gt; so the pinned environment is used.&lt;/p&gt;</description>
      </item>
    <item>
        <title>Quick deploy</title>
        <link>https://pgcli.pages.dev/docs/ansible/quick-deploy/</link>
        
        
        <guid>https://pgcli.pages.dev/docs/ansible/quick-deploy/</guid>
        <description>&lt;p&gt;Replace &lt;code&gt;myproj&lt;/code&gt;, &lt;code&gt;db-01&lt;/code&gt; and the SSH address, then run on the control node:&lt;/p&gt;&#xA;&lt;div class=&#34;td-code td-code--untitled&#34; id=&#34;td-code-2bdd49f3-fence-0&#34; data-td-code data-td-code-auto-id&#xA;     data-td-language=&#34;bash&#34; data-td-line-count=&#34;31&#34;&gt;&#xA;  &lt;div class=&#34;td-code__viewport&#34; id=&#34;td-code-2bdd49f3-fence-0-viewport&#34; data-td-code-viewport&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;myproj&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;xx&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git clone --depth &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; https://github.com/mars-base/pgcli-ansible.git ansible-&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;myproj&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; ansible-&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;myproj&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;uv sync&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;cp ansible.cfg.example ansible.cfg&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;cat &amp;gt; hosts.ini &lt;span class=&#34;s&#34;&gt;&amp;lt;&amp;lt;&amp;#39;EOF&amp;#39;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s&#34;&gt;[single]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s&#34;&gt;db-01 ansible_host=192.0.2.10 private_ip=192.0.2.10 ansible_user=root ansible_port=22&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s&#34;&gt;[single:vars]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s&#34;&gt;ansible_group_priority=20&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s&#34;&gt;EOF&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;cp group_vars/all/main.yml.example group_vars/all/main.yml&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;cat &amp;gt; group_vars/single/main.yml &lt;span class=&#34;s&#34;&gt;&amp;lt;&amp;lt;&amp;#39;EOF&amp;#39;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s&#34;&gt;pgcli_config_overrides:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s&#34;&gt;  namespace: dev&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s&#34;&gt;pgcli_instances:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s&#34;&gt;  - name: pg_single&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s&#34;&gt;    host: db-01&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s&#34;&gt;    state: started&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s&#34;&gt;    autostart: true&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s&#34;&gt;EOF&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;uv run ansible-playbook playbooks/ping.yaml --limit single&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;uv run ansible-playbook playbooks/apply.yaml --limit single&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;uv run ansible single -m &lt;span class=&#34;nb&#34;&gt;command&lt;/span&gt; -a &lt;span class=&#34;s1&#34;&gt;&amp;#39;pg list&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;uv run ansible single -m &lt;span class=&#34;nb&#34;&gt;command&lt;/span&gt; -a &lt;span class=&#34;s1&#34;&gt;&amp;#39;pg exec pg_single -c &amp;#34;SELECT version();&amp;#34;&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;&lt;code&gt;apply.yaml&lt;/code&gt; installs pgcli, initializes the host config, and creates&#xA;&lt;code&gt;pg_single&lt;/code&gt;; re-running it is idempotent.&lt;/p&gt;</description>
      </item>
    
  </channel>
</rss>
