Make ansible-lint happy

This commit is contained in:
Johannes Rothe 2023-01-03 22:33:55 +01:00
parent f446ad3114
commit 42dd649be1
2 changed files with 21 additions and 17 deletions

View File

@ -1,9 +1,11 @@
--- ---
# - fix symlinks for folders # - fix symlinks for folders
- hosts: all - hosts: all
name: Dotfiles
roles: roles:
- dotfiles - dotfiles
tasks: tasks:
- debug: - name: Debug
msg: ansible.builtin.debug:
"System operating with {{ ansible_distribution }} {{ ansible_distribution_major_version }}" msg:
"System operating with {{ ansible_distribution }} {{ ansible_distribution_major_version }}"

View File

@ -1,10 +1,10 @@
--- ---
# Install base packages # Install base packages
- name: Install necessary packages - name: Install necessary packages
become: yes become: true
become_method: sudo become_method: sudo
become_user: root become_user: root
apt: ansible.builtin.apt:
name: name:
- ack - ack
- arandr - arandr
@ -50,22 +50,22 @@
- name: Remove old backup - name: Remove old backup
file: ansible.builtin.file:
path: '{{ home }}/tmp/dotfiles_backup' path: '{{ home }}/tmp/dotfiles_backup'
state: absent state: absent
- name: Create new backup dir - name: Create new backup dir
file: ansible.builtin.file:
path: '{{ home }}/tmp/dotfiles_backup' path: '{{ home }}/tmp/dotfiles_backup'
state: directory state: directory
mode: 0755 mode: 0755
- name: Backup stuff - name: Backup stuff
copy: ansible.builtin.copy:
src: '{{ item }}' src: '{{ item }}'
dest: '/tmp/dotfiles_backup' 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 mode: 0755
ignore_errors: yes ignore_errors: true
loop: loop:
# dirs (without trailing '/' copies the whole dir) # dirs (without trailing '/' copies the whole dir)
- '{{ home }}/.config/fish' - '{{ home }}/.config/fish'
@ -83,7 +83,7 @@
- '{{ home }}/.sway/config' - '{{ home }}/.sway/config'
- name: Make sure folders exist - name: Make sure folders exist
file: ansible.builtin.file:
path: '{{ item }}' path: '{{ item }}'
state: directory state: directory
mode: 0755 mode: 0755
@ -102,11 +102,11 @@
- '{{ home }}/.local/share/systemd/user' - '{{ home }}/.local/share/systemd/user'
- name: Link files - name: Link files
file: ansible.builtin.file:
src: '{{ item.src }}' src: '{{ item.src }}'
dest: '{{ item.dest }}' dest: '{{ item.dest }}'
state: link state: link
force: True force: true
loop: loop:
- src: '{{ files_dir }}/vimrc' - src: '{{ files_dir }}/vimrc'
dest: '{{ home }}/.vimrc' dest: '{{ home }}/.vimrc'
@ -138,22 +138,24 @@
dest: '{{ home }}/bin/git-sync' dest: '{{ home }}/bin/git-sync'
- name: Create note sync service - name: Create note sync service
template: ansible.builtin.template:
src: 'templates/systemd/note-sync/note-sync.service.j2' src: 'templates/systemd/note-sync/note-sync.service.j2'
dest: '{{ home }}/.local/share/systemd/user/note-sync.service' dest: '{{ home }}/.local/share/systemd/user/note-sync.service'
mode: '644'
- name: Create note sync timer - name: Create note sync timer
template: ansible.builtin.template:
src: 'templates/systemd/note-sync/note-sync.timer.j2' src: 'templates/systemd/note-sync/note-sync.timer.j2'
dest: '{{ home }}/.local/share/systemd/user/note-sync.timer' dest: '{{ home }}/.local/share/systemd/user/note-sync.timer'
mode: '644'
- name: Reload systemd - name: Reload systemd
systemd: ansible.builtin.systemd:
scope: user scope: user
daemon_reload: true daemon_reload: true
- name: Enable note sync timer - name: Enable note sync timer
systemd: ansible.builtin.systemd:
name: note-sync.timer name: note-sync.timer
scope: user scope: user
state: started state: started