diff --git a/defaults/main.yml b/defaults/main.yml index fd58e49..ade78f4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,4 +3,6 @@ rc_files_user_path: /root default_zshrc_lines: [] -extra_zshrc_lines: [] \ No newline at end of file +extra_zshrc_lines: [] + +reset_zshrc: false \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index ad83377..71aee57 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,11 +1,17 @@ --- # tasks file for install_rc_file -- name: Install p10k - ansible.builtin.git: - repo: https://gitee.com/romkatv/powerlevel10k.git - dest: "{{ rc_files_user_path }}/.oh-my-zsh/custom/themes/powerlevel10k" - depth: 1 +- name: Reset .zshrc + ansible.builtin.file: + path: "{{ rc_files_user_path }}/.zshrc" + state: absent + 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 template: @@ -17,7 +23,7 @@ - name: Add source to .zshrc lineinfile: - path: '~/.zshrc' + path: "{{ rc_files_user_path }}/.zshrc" line: "source .ansible_zshrc" create: yes mode: 'u=rw,go=r'