---
- name: Ensure spotify is installed
  include_role:
    name: aur-packages
  vars:
    packages:
      - spotify
  tags:
    - spotify
  when: ansible_facts.distribution == 'Archlinux'

- name: Ensure directory for spotify preferences exits
  file:
    path: "{{ ansible_user_dir }}/.config/spotify"
    state: directory
    owner: "{{ ansible_user_id }}"
    mode: 0700
  tags:
    - spotify

- name: Ensure spotify user cache is limited to 512MB
  lineinfile:
    name: "{{ ansible_user_dir }}/.config/spotify/prefs"
    regexp: '^storage.size='
    line: 'storage.size=512'
    state: present
  tags:
    - spotify

---
- name: Ensure spotify is installed
  include_role:
    name: aur-packages
  vars:
    packages:
      - spotify
  tags:
    - spotify
  when: ansible_facts.distribution == 'Archlinux'

- name: Ensure directory for spotify preferences exits
  file:
    path: "{{ ansible_user_dir }}/.config/spotify"
    state: directory
    owner: "{{ ansible_user_id }}"
    mode: 0700
  tags:
    - spotify

- name: Ensure spotify user cache is limited to 512MB
  lineinfile:
    name: "{{ ansible_user_dir }}/.config/spotify/prefs"
    regexp: '^storage.size='
    line: 'storage.size=512'
    state: present
    create: yes
  tags:
    - spotify

Create spotify prefs if file does not exist
Create spotify prefs if file does not exist
