Improve su with bash function
This commit is contained in:
1 parent
d7ccfbc37b
commit
ca74d003ba
1 file changed
+2
-2
+2
-2
@@ -26,8 +26,8 @@
|
|||||||
- name: Create machinectl bash alias
|
- name: Create machinectl bash alias
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: "/home/{{ item }}/.bashrc"
|
path: "/home/{{ item }}/.bashrc"
|
||||||
regexp: '^alias su='
|
regexp: '^su() '
|
||||||
line: "alias su=\"machinectl shell --uid\""
|
line: "su() { if [[ $1 == "-" ]]; then command machinectl shell --uid "$2"; else command machinectl shell --uid "$1"; fi; }"
|
||||||
loop: "{{ service_users }}"
|
loop: "{{ service_users }}"
|
||||||
|
|
||||||
- lineinfile:
|
- lineinfile:
|
||||||
|
|||||||
Reference in new issue
Block a user