diff options
| author | spmfox <spmfox@foxwd.com> | 2024-02-14 08:50:18 -0500 |
|---|---|---|
| committer | spmfox <spmfox@foxwd.com> | 2024-02-14 08:50:18 -0500 |
| commit | 8eaadecb1890ee0629c5e81b0152aba309c67484 (patch) | |
| tree | e69ffa8633e277f9888eeccdbb206bef00ed9291 | |
| parent | 88c2fe720cd9d0861ceb713848c60edf431149a2 (diff) | |
adding shell defaults for container status on login
| -rw-r--r-- | host.yml | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -1,5 +1,17 @@ - hosts: localhost become: true + vars: + shell_service_status_helper: | + echo "----systemd----" + systemctl --user list-units 'pod-*' -q + echo "" + systemctl --user list-units 'container-*' -q + echo "" + echo "----podman----" + podman pod list --sort status --format={{ '"{{.Status}} {{.Name}}"' }} + echo "" + podman container list --all --sort status --format={{ '"{{.State}} {{.Status}} {{.Names}}"' }} + echo "" tasks: - name: Create containers user @@ -12,12 +24,7 @@ owner: "containers" group: "containers" create: true - block: | - echo "" - systemctl --user list-units 'container-*' -q - echo "" - podman container list --all - echo "" + block: "{{ shell_service_status_helper }}" - name: Check if fish shell is installed ansible.builtin.stat: @@ -30,12 +37,7 @@ owner: "containers" group: "containers" create: true - block: | - echo "" - systemctl --user list-units 'container-*' -q - echo "" - podman container list --all - echo "" + block: "{{ shell_service_status_helper }}" when: fish.stat.exists - name: Install systemd-container and podman |
