Improve su with bash function

master
Mike Holloway 3 months ago
parent ca74d003ba
commit 2038ba7a77
  1. 2
      tasks/main.yml

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

Loading…
Cancel
Save