- name: install zsh apt: name: zsh state: latest update_cache: true - name: set zsh as default shell ansible.builtin.user: name: "{{ ansible_user }}" shell: /usr/bin/zsh - name: Check if Atuin is installed ansible.builtin.stat: path: "/home/{{ ansible_user }}/.atuin/bin/atuin" register: atuin_bin # Only fetch and run the installer on hosts that don't have Atuin yet - name: Download Atuin setup script get_url: url: https://setup.atuin.sh dest: /tmp/setup_atuin.sh mode: '0755' when: not atuin_bin.stat.exists - name: Run the Atuin setup script command: /tmp/setup_atuin.sh args: creates: "/home/{{ ansible_user }}/.atuin/bin/atuin" become: true become_user: "{{ ansible_user }}" # Log in once; the session file marks an existing login. # no_log keeps the password and key out of Ansible output. - name: login to atuin command: /home/{{ ansible_user }}/.atuin/bin/atuin login -u philskents -p "{{ atuin_pass }}" -k "{{ atuin_key }}" args: creates: "/home/{{ ansible_user }}/.local/share/atuin/session" become: true become_user: "{{ ansible_user }}" no_log: true - name: setup dotfile sync community.general.ini_file: path: "/home/{{ ansible_user }}/.config/atuin/config.toml" section: dotfiles option: enabled value: "true" owner: "{{ ansible_user }}" group: "{{ ansible_user }}" - name: Install bat apt: name: bat state: latest update_cache: true - name: Ensure ~/.local/bin exists ansible.builtin.file: path: "/home/{{ ansible_user }}/.local/bin" state: directory owner: "{{ ansible_user }}" group: "{{ ansible_user }}" mode: '0755' - name: Create symlink for batcat ansible.builtin.file: src: /usr/bin/batcat dest: "/home/{{ ansible_user }}/.local/bin/bat" state: link