homeserver/roles/mgrote.dotfiles/tasks/main.yml
mg 02a6c6d5a7 laptop (#138)
dotfiles stash

pip weg

polybar group video

defaukts atom

timeshift aufgeräumt

defaults vivaldi

defaults xnview

doku

xautolock

vars

playbooks

atom

aufgeräumt

testvm

same2

same

bugfix alacritty

i3: rofi

abhängigkeiten

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#138
Co-Authored-By: mg <mg@noreply.git.mgrote.net>
Co-Committed-By: mg <mg@noreply.git.mgrote.net>
2021-07-01 15:26:45 +02:00

61 lines
1.6 KiB
YAML

---
- name: install acl package
become: yes
ansible.builtin.package:
name: acl
state: present
- name: stash changes
ansible.builtin.shell: git stash
args:
chdir: "{{ dotfiles_repo_path }}"
changed_when: false
- name: Ensure dotfiles repository is cloned locally.
git:
repo: "{{ dotfiles_repo_url }}"
dest: "{{ dotfiles_repo_path }}"
depth: 1
register: git_clone
- name: pop stashed changes
ansible.builtin.shell: git stash pop
args:
chdir: "{{ dotfiles_repo_path }}"
changed_when: false
- name: set owner recursive for repo
file:
path: "{{ dotfiles_repo_path }}"
owner: "{{ dotfiles_owner }}"
group: "{{ dotfiles_owner }}"
recurse: yes
when: (git_clone.changed == true)
- name: Ensure needed dirs exist.
file:
path: "{{ item.path }}"
state: directory
with_items: "{{ dotfiles_dirs }}"
- name: Link dotfiles into home folder.
file:
src: "{{ item.repo_path }}"
dest: "{{ item.local_path }}"
state: link
force: yes
owner: "{{ dotfiles_owner }}"
group: "{{ dotfiles_owner }}"
with_items: "{{ dotfiles_files }}"
- name: add .bash_alias to .bashrc
ansible.builtin.lineinfile:
path: /home/{{ dotfiles_owner }}/.bashrc
line: "source {{ dotfiles_repo_path }}/.bash_aliases"
state: present
- name: add .bash_functions to .bashrc
ansible.builtin.lineinfile:
path: /home/{{ dotfiles_owner }}/.bashrc
line: "source {{ dotfiles_repo_path }}/.bash_functions"
state: present