diff --git a/dotfiles.yml b/dotfiles.yml index 6ecb5cc..9c377ed 100644 --- a/dotfiles.yml +++ b/dotfiles.yml @@ -1,9 +1,11 @@ --- # - fix symlinks for folders - hosts: all + name: Dotfiles roles: - dotfiles tasks: - - debug: - msg: - "System operating with {{ ansible_distribution }} {{ ansible_distribution_major_version }}" + - name: Debug + ansible.builtin.debug: + msg: + "System operating with {{ ansible_distribution }} {{ ansible_distribution_major_version }}" diff --git a/roles/dotfiles/tasks/main.yml b/roles/dotfiles/tasks/main.yml index 41115d3..295a65b 100644 --- a/roles/dotfiles/tasks/main.yml +++ b/roles/dotfiles/tasks/main.yml @@ -1,10 +1,10 @@ --- # Install base packages - name: Install necessary packages - become: yes + become: true become_method: sudo become_user: root - apt: + ansible.builtin.apt: name: - ack - arandr @@ -50,22 +50,22 @@ - name: Remove old backup - file: + ansible.builtin.file: path: '{{ home }}/tmp/dotfiles_backup' state: absent - name: Create new backup dir - file: + ansible.builtin.file: path: '{{ home }}/tmp/dotfiles_backup' state: directory mode: 0755 - name: Backup stuff - copy: + ansible.builtin.copy: src: '{{ item }}' dest: '/tmp/dotfiles_backup' - remote_src: True # copy the folder from the host instead of ansible + remote_src: true # copy the folder from the host instead of ansible mode: 0755 - ignore_errors: yes + ignore_errors: true loop: # dirs (without trailing '/' copies the whole dir) - '{{ home }}/.config/fish' @@ -83,7 +83,7 @@ - '{{ home }}/.sway/config' - name: Make sure folders exist - file: + ansible.builtin.file: path: '{{ item }}' state: directory mode: 0755 @@ -102,11 +102,11 @@ - '{{ home }}/.local/share/systemd/user' - name: Link files - file: + ansible.builtin.file: src: '{{ item.src }}' dest: '{{ item.dest }}' state: link - force: True + force: true loop: - src: '{{ files_dir }}/vimrc' dest: '{{ home }}/.vimrc' @@ -138,22 +138,24 @@ dest: '{{ home }}/bin/git-sync' - name: Create note sync service - template: + ansible.builtin.template: src: 'templates/systemd/note-sync/note-sync.service.j2' dest: '{{ home }}/.local/share/systemd/user/note-sync.service' + mode: '644' - name: Create note sync timer - template: + ansible.builtin.template: src: 'templates/systemd/note-sync/note-sync.timer.j2' dest: '{{ home }}/.local/share/systemd/user/note-sync.timer' + mode: '644' - name: Reload systemd - systemd: + ansible.builtin.systemd: scope: user daemon_reload: true - name: Enable note sync timer - systemd: + ansible.builtin.systemd: name: note-sync.timer scope: user state: started