Fixed set shell
This commit is contained in:
12
main.yml
12
main.yml
@@ -3,6 +3,18 @@
|
|||||||
hosts: localhost
|
hosts: localhost
|
||||||
connection: local
|
connection: local
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Get username
|
||||||
|
command: whoami
|
||||||
|
register: whoami
|
||||||
|
tags:
|
||||||
|
- always
|
||||||
|
|
||||||
|
- name: Set username
|
||||||
|
set_fact:
|
||||||
|
username: "{{ whoami.stdout }}"
|
||||||
|
tags:
|
||||||
|
- always
|
||||||
|
|
||||||
- name: Set default roles
|
- name: Set default roles
|
||||||
set_fact:
|
set_fact:
|
||||||
roles: "{{ ansible_run_tags != ['all'] and ansible_run_tags or default_roles | difference(ansible_skip_tags | default([])) }}"
|
roles: "{{ ansible_run_tags != ['all'] and ansible_run_tags or default_roles | difference(ansible_skip_tags | default([])) }}"
|
||||||
|
|||||||
@@ -20,6 +20,6 @@
|
|||||||
|
|
||||||
- name: "[Fish] Set shell"
|
- name: "[Fish] Set shell"
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: "sudo usermod -s $(which fish) $(whoami)"
|
cmd: "sudo usermod -s $(which fish) {{ username }}"
|
||||||
become: true
|
become: true
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|||||||
Reference in New Issue
Block a user