Setting fish as the default user shell

This commit is contained in:
Ivan Golikov 2024-12-15 22:48:03 +01:00
parent 51015a4e35
commit cca53ad11d

View file

@ -18,6 +18,9 @@
pacman_packages: pacman_packages:
- python-pipx - python-pipx
macos_fish_path: /usr/local/bin/fish
arch_fish_path: /usr/bin/fish
tasks: tasks:
- name: Check the current OS family - name: Check the current OS family
ansible.builtin.set_fact: ansible.builtin.set_fact:
@ -46,3 +49,15 @@
state: present state: present
become: true become: true
when: is_arch when: is_arch
- name: Set fish as default shell
become: true
ansible.builtin.user:
name: "{{ ansible_env.USER }}"
shell: "{{ shell_path }}"
vars:
shell_path: "\
{% if is_macos %}{{ macos_fish_path }}\
{% elif is_arch %}{{ arch_fish_path }}\
{% else %}/bin/fish\
{% endif %}"