diff --git a/.ansible/roles/desktop/tasks/firefox.yaml b/.ansible/roles/desktop/tasks/common/firefox.yaml similarity index 75% rename from .ansible/roles/desktop/tasks/firefox.yaml rename to .ansible/roles/desktop/tasks/common/firefox.yaml index 789d50e..11a2ab0 100644 --- a/.ansible/roles/desktop/tasks/firefox.yaml +++ b/.ansible/roles/desktop/tasks/common/firefox.yaml @@ -1,23 +1,27 @@ -- name: 'Firefox: Set base path' +- name: 'Firefox: Setting base path' tags: - config - firefox block: - - set_fact: + - name: 'Firefox: Setting path (Linux)' + set_fact: firefox_path: '~/.mozilla/firefox' when: ansible_system == 'Linux' - - set_fact: + - name: 'Firefox: Setting path (Darwin)' + set_fact: firefox_path: '~/Library/Application Support/Firefox' when: ansible_system == 'Darwin' -- name: 'Firefox: Discover profile path' +- name: 'Firefox: Discovering profile path' tags: - config - firefox block: - - set_fact: + - name: 'Firefox: Setting profile_path' + set_fact: profile_path: "{{ firefox_path }}/{{ lookup('ini', 'Path section=Profile0 file=' + firefox_path + '/profiles.ini') }}" - - set_fact: + - name: 'Firefox: Setting user config path' + set_fact: userconfig_path: "{{ profile_path }}/user.js" - name: 'Firefox: Updating config' @@ -25,7 +29,7 @@ - config - firefox block: - - name: 'Firefox: Download lockdown config (relaxed)' + - name: 'Firefox: Downloading lockdown config (relaxed)' get_url: url: 'https://raw.githubusercontent.com/pyllyukko/user.js/relaxed/user.js' dest: "{{ userconfig_path }}-lockdown" @@ -33,7 +37,7 @@ force: yes backup: no - - name: 'Firefox: Replace user.js' + - name: 'Firefox: Replacing user.js' copy: src: "{{ userconfig_path }}-lockdown" dest: "{{ userconfig_path }}" diff --git a/.ansible/roles/desktop/tasks/main.yaml b/.ansible/roles/desktop/tasks/main.yaml index e0715f9..91bb607 100644 --- a/.ansible/roles/desktop/tasks/main.yaml +++ b/.ansible/roles/desktop/tasks/main.yaml @@ -1,8 +1,5 @@ - name: "Desktop tasks ({{ ansible_system }})" - include_tasks: "{{ loop_task }}" - loop: "{{ query('fileglob', \"{{ ansible_system|lower }}/*\") | sort }}" + include: "{{ loop_task }}" + loop: "{{ query('fileglob', \"{{ ansible_system|lower }}/*\", \"common/*\") | sort }}" loop_control: loop_var: loop_task - -- name: Desktop tasks (Common) - import_tasks: firefox.yaml