diff --git a/tasks/zsh-zshrc.yml b/tasks/zsh-zshrc.yml index 45f4f06..d1c9f57 100644 --- a/tasks/zsh-zshrc.yml +++ b/tasks/zsh-zshrc.yml @@ -3,12 +3,13 @@ # not present. - name: "OMZ | export vars to .zshrc if required." blockinfile: - dest: "{{ omz_user_zshrc_path }}" - block: "{{ omz_user.settings }}" + dest: "{{ item.ansible_facts.user_home }}/.zshrc" + block: "{{ omz_custom_settings }}" backup: "{{ omz_zshrc_backup }}" when: - - "omz_user.settings is defined" + - "omz_custom_settings is defined" # Don't flag this line for checking if the value is empty--checking for an # empty value makes perfect sense. - - "omz_user.settings != ''" # noqa 602 + - "omz_custom_settings != ''" # noqa 602 - "not omz_zshrc_create" + with_items: "{{ paths.results }}" \ No newline at end of file diff --git a/tasks/zsh.yml b/tasks/zsh.yml index dd7f774..ebe758b 100644 --- a/tasks/zsh.yml +++ b/tasks/zsh.yml @@ -21,8 +21,3 @@ shell: "command -v zsh" register: omz_zsh_installed_path changed_when: "false" - -- name: "OMZ | get user shell to zsh." - user: - name: "{{ omz_user.name }}" - shell: "{{ omz_zsh_installed_path.stdout }}" diff --git a/templates/zshrc.zsh-template.j2 b/templates/zshrc.zsh-template.j2 index 57fe9af..8730f96 100644 --- a/templates/zshrc.zsh-template.j2 +++ b/templates/zshrc.zsh-template.j2 @@ -86,7 +86,7 @@ source $ZSH/oh-my-zsh.sh # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" -{% if omz_user.settings is defined %} +{% if omz_custom_settings is defined %} # Custom settings -{{ omz_user.settings }} +{{ omz_custom_settings }} {% endif %} \ No newline at end of file