Преглед на файлове

fix debian bashrc in common role

Blaine Story преди 4 дни
родител
ревизия
65059044e7
променени са 1 файла, в които са добавени 24 реда и са изтрити 0 реда
  1. 24 0
      roles/common/tasks/main.yml

+ 24 - 0
roles/common/tasks/main.yml

@@ -182,3 +182,27 @@
     - item.command is defined
     - ansible_os_family != 'LibreELEC'
   tags: aliases
+
+
+- name: Enforce .bash_profile
+  ansible.builtin.template:
+    src: bash_profile.j2
+    dest: /root/.bash_profile
+    owner: root
+    group: root
+    mode: '0640'
+
+
+- name: Enforce .bashrc aliases for ll (Debian)
+  ansible.builtin.lineinfile:
+    path: /root/.bashrc
+    regexp: "{{ item.regexp }}"
+    line: "{{ item.line }}"
+  loop:
+    - { 'regexp': '^#?\s*export LS_OPTIONS=',    'line': "export LS_OPTIONS='--color=auto'" }
+    - { 'regexp': '^#?\s*eval \"$(dircolors)\"', 'line': "eval \"$(dircolors)\"" }
+    - { "regexp": '^#?\s*alias ls=',             'line': "alias ls='ls $LS_OPTIONS'" }
+    - { "regexp": '^#?\s*alias ll=',             'line': "alias ll='ls $LS_OPTIONS -lh'" }
+    - { "regexp": '^#?\s*alias l=',              'line': "alias l='ls $LS_OPTIONS -lA'" }
+  when:
+    - ansible_distribution == 'Debian'