user_config/tasks/main.yml

28 lines
672 B
YAML
Raw Normal View History

2018-12-02 20:03:41 +00:00
---
# tasks file for user_config
2023-01-10 19:47:04 +00:00
- name: Clone user repository
ansible.builtin.git:
dest: "{{ user_config_home }}"
repo: "{{ user_config_repo }}"
clone: true
recursive: true
force: false
update: true
accept_hostkey: true
notify: Apply stow config
2019-04-16 16:32:06 +00:00
2023-01-10 19:47:04 +00:00
- name: Test if user bash rc exist
ansible.builtin.stat:
path: '{{ item }}'
2021-03-22 20:29:09 +00:00
register: links
2023-01-10 19:47:04 +00:00
with_items:
- /{{ user_config_home }}/.bashrc
- /{{ user_config_home }}/.zshrc
2021-03-22 20:29:09 +00:00
2023-01-10 19:47:04 +00:00
- name: Delete bashrc if needed
ansible.builtin.file:
path: '{{ item.stat.path }}'
2021-03-22 20:29:09 +00:00
state: absent
2022-05-31 19:25:04 +00:00
when: item.stat.islnk is defined and not item.stat.islnk
2023-01-10 19:47:04 +00:00
with_items: '{{ links.results }}'