Add var to reset all

This commit is contained in:
SebClem 2021-11-20 18:54:06 +01:00
parent 5c8ab35440
commit 9b5afc1353
2 changed files with 15 additions and 7 deletions

View File

@ -3,4 +3,6 @@
rc_files_user_path: /root rc_files_user_path: /root
default_zshrc_lines: [] default_zshrc_lines: []
extra_zshrc_lines: [] extra_zshrc_lines: []
reset_zshrc: false

View File

@ -1,11 +1,17 @@
--- ---
# tasks file for install_rc_file # tasks file for install_rc_file
- name: Install p10k - name: Reset .zshrc
ansible.builtin.git: ansible.builtin.file:
repo: https://gitee.com/romkatv/powerlevel10k.git path: "{{ rc_files_user_path }}/.zshrc"
dest: "{{ rc_files_user_path }}/.oh-my-zsh/custom/themes/powerlevel10k" state: absent
depth: 1 when: reset_zshrc
- name: Reset .oh-my-zsh
ansible.builtin.file:
path: "{{ rc_files_user_path }}/.oh-my-zsh"
state: absent
when: reset_zshrc
- name: Install .ansible_zshrc - name: Install .ansible_zshrc
template: template:
@ -17,7 +23,7 @@
- name: Add source to .zshrc - name: Add source to .zshrc
lineinfile: lineinfile:
path: '~/.zshrc' path: "{{ rc_files_user_path }}/.zshrc"
line: "source .ansible_zshrc" line: "source .ansible_zshrc"
create: yes create: yes
mode: 'u=rw,go=r' mode: 'u=rw,go=r'