Fixed set shell

This commit is contained in:
2024-06-02 18:40:41 +02:00
parent 896900392b
commit 30df2d5faf
2 changed files with 13 additions and 1 deletions

View File

@@ -3,6 +3,18 @@
hosts: localhost
connection: local
tasks:
- name: Get username
command: whoami
register: whoami
tags:
- always
- name: Set username
set_fact:
username: "{{ whoami.stdout }}"
tags:
- always
- name: Set default roles
set_fact:
roles: "{{ ansible_run_tags != ['all'] and ansible_run_tags or default_roles | difference(ansible_skip_tags | default([])) }}"

View File

@@ -20,6 +20,6 @@
- name: "[Fish] Set shell"
ansible.builtin.shell:
cmd: "sudo usermod -s $(which fish) $(whoami)"
cmd: "sudo usermod -s $(which fish) {{ username }}"
become: true
ignore_errors: true