Files
ansible-role-oh-my-zsh/tasks/oh-my-zsh-install.yml
2025-01-09 20:17:32 +01:00

26 lines
835 B
YAML

---
- name: OMZ | Add Oh My Zsh folder to Git safe directory list
ansible.builtin.command:
cmd: git config --global --add safe.directory "{{ item.ansible_facts.user_home }}/{{ omz_install_directory }}"
with_items: "{{ paths.results }}"
- name: "OMZ | clone Oh My ZSH repo for user."
git:
repo: "{{ omz_git_repository }}"
dest: "{{ item.ansible_facts.user_home }}/{{ omz_install_directory }}"
update: "true"
accept_hostkey: "true"
version: "master"
register: "omz_clone"
with_items: "{{ paths.results }}"
when:
- name: "OMZ | set ownership on newly cloned repository."
file:
path: "{{ item.ansible_facts.user_home }}/{{ omz_install_directory }}"
owner: "{{ item.item }}"
group: "{{ item.item }}"
recurse: "true"
when: "omz_clone is changed"
with_items: "{{ paths.results }}"