Skip to content

Instantly share code, notes, and snippets.

@yaxinr
Last active April 10, 2019 19:42
Show Gist options
  • Save yaxinr/788de9efb84951b9973684ffa455db2b to your computer and use it in GitHub Desktop.
Save yaxinr/788de9efb84951b9973684ffa455db2b to your computer and use it in GitHub Desktop.
bashrc systemctl alias
- hosts: all
become: true
gather_facts: false
vars:
bashrc: /etc/bash.bashrc
tasks:
- name: alias to systemctl
lineinfile:
path: "{{ bashrc }}"
line: alias 'status'='sudo systemctl status'
create: true
- lineinfile:
path: "{{ bashrc }}"
line: alias 'start'='sudo systemctl start'
- lineinfile:
path: "{{ bashrc }}"
line: alias 'restart'='sudo systemctl restart'
- lineinfile:
path: "{{ bashrc }}"
line: alias 'stop'='sudo systemctl stop'
- lineinfile:
path: "{{ bashrc }}"
line: alias 'j'='sudo journalctl -u'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment