aboutsummaryrefslogtreecommitdiff
path: root/roles/host/tasks/shell-helper.yml
blob: e36784a7d301ee8516c1dd5bf76d6e6c85f99856 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- name: Add bashrc for container service status on login
  ansible.builtin.blockinfile:
    path: "/home/{{ host_containers_user }}/.bashrc"
    owner: "{{ host_containers_user }}"
    group: "{{ host_containers_user }}"
    create: true
    block: "{{ host_shell_login_helper }}"

- name: Check if fish shell is installed
  ansible.builtin.stat:
    path: "/usr/bin/fish"
  register: fish

- name: Block for fish
  block:
    - name: Create fish config directory
      ansible.builtin.file:
        path: "/home/{{ host_containers_user }}/.config/fish/conf.d"
        state: directory
        owner: "{{ host_containers_user }}"
        group: "{{ host_containers_user }}"

    - name: Add fish config for container service status on login
      ansible.builtin.blockinfile:
        path: "/home/{{ host_containers_user }}/.config/fish/conf.d/containers.fish"
        owner: "{{ host_containers_user }}"
        group: "{{ host_containers_user }}"
        create: true
        block: "{{ host_shell_login_helper }}"
      when: fish.stat.exists
  when: fish.stat.exists