aboutsummaryrefslogtreecommitdiff
path: root/roles/host/tasks/shell-helper.yml
blob: 9567fe7d881787590cd9b2e869c2a593a120d6d5 (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_bash }}"

- 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_fish }}"
      when: fish.stat.exists
  when: fish.stat.exists