Improve su with bash function

master
Mike Holloway 2 months ago
parent d7ccfbc37b
commit ca74d003ba
  1. 4
      tasks/main.yml

@ -26,8 +26,8 @@
- name: Create machinectl bash alias
lineinfile:
path: "/home/{{ item }}/.bashrc"
regexp: '^alias su='
line: "alias su=\"machinectl shell --uid\""
regexp: '^su() '
line: "su() { if [[ $1 == "-" ]]; then command machinectl shell --uid "$2"; else command machinectl shell --uid "$1"; fi; }"
loop: "{{ service_users }}"
- lineinfile:

Loading…
Cancel
Save