aboutsummaryrefslogtreecommitdiff
path: root/roles/host
diff options
context:
space:
mode:
Diffstat (limited to 'roles/host')
-rw-r--r--roles/host/defaults/main.yml11
-rw-r--r--roles/host/tasks/shell-helper.yml4
2 files changed, 13 insertions, 2 deletions
diff --git a/roles/host/defaults/main.yml b/roles/host/defaults/main.yml
index 549d056..ce4248e 100644
--- a/roles/host/defaults/main.yml
+++ b/roles/host/defaults/main.yml
@@ -6,6 +6,17 @@ host_shell_login_helper: |
podman container list --all --sort status --format={{ '"{{.State}} {{.Status}} {{.Names}}"' }}
echo ""
+host_shell_login_helper_bash: |
+ if [[ $- == *i* ]]
+ then
+ {{ host_shell_login_helper | indent(4) | trim }}
+ fi
+
+host_shell_login_helper_fish: |
+ if status is-interactive
+ {{ host_shell_login_helper | indent(4) | trim }}
+ end
+
host_containers_user: "{{ containers_user if containers_user is defined else 'containers' }}"
host_patching: false
host_patching_apply: false
diff --git a/roles/host/tasks/shell-helper.yml b/roles/host/tasks/shell-helper.yml
index e36784a..9567fe7 100644
--- a/roles/host/tasks/shell-helper.yml
+++ b/roles/host/tasks/shell-helper.yml
@@ -4,7 +4,7 @@
owner: "{{ host_containers_user }}"
group: "{{ host_containers_user }}"
create: true
- block: "{{ host_shell_login_helper }}"
+ block: "{{ host_shell_login_helper_bash }}"
- name: Check if fish shell is installed
ansible.builtin.stat:
@@ -26,6 +26,6 @@
owner: "{{ host_containers_user }}"
group: "{{ host_containers_user }}"
create: true
- block: "{{ host_shell_login_helper }}"
+ block: "{{ host_shell_login_helper_fish }}"
when: fish.stat.exists
when: fish.stat.exists