Move Firefox tasks into a commont tasks folder

This commit is contained in:
Scott Wallace 2019-01-31 22:31:01 +00:00
parent 986174e7f2
commit fae5a6364d
2 changed files with 14 additions and 13 deletions

View file

@ -1,23 +1,27 @@
- name: 'Firefox: Set base path' - name: 'Firefox: Setting base path'
tags: tags:
- config - config
- firefox - firefox
block: block:
- set_fact: - name: 'Firefox: Setting path (Linux)'
set_fact:
firefox_path: '~/.mozilla/firefox' firefox_path: '~/.mozilla/firefox'
when: ansible_system == 'Linux' when: ansible_system == 'Linux'
- set_fact: - name: 'Firefox: Setting path (Darwin)'
set_fact:
firefox_path: '~/Library/Application Support/Firefox' firefox_path: '~/Library/Application Support/Firefox'
when: ansible_system == 'Darwin' when: ansible_system == 'Darwin'
- name: 'Firefox: Discover profile path' - name: 'Firefox: Discovering profile path'
tags: tags:
- config - config
- firefox - firefox
block: block:
- set_fact: - name: 'Firefox: Setting profile_path'
set_fact:
profile_path: "{{ firefox_path }}/{{ lookup('ini', 'Path section=Profile0 file=' + firefox_path + '/profiles.ini') }}" 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" userconfig_path: "{{ profile_path }}/user.js"
- name: 'Firefox: Updating config' - name: 'Firefox: Updating config'
@ -25,7 +29,7 @@
- config - config
- firefox - firefox
block: block:
- name: 'Firefox: Download lockdown config (relaxed)' - name: 'Firefox: Downloading lockdown config (relaxed)'
get_url: get_url:
url: 'https://raw.githubusercontent.com/pyllyukko/user.js/relaxed/user.js' url: 'https://raw.githubusercontent.com/pyllyukko/user.js/relaxed/user.js'
dest: "{{ userconfig_path }}-lockdown" dest: "{{ userconfig_path }}-lockdown"
@ -33,7 +37,7 @@
force: yes force: yes
backup: no backup: no
- name: 'Firefox: Replace user.js' - name: 'Firefox: Replacing user.js'
copy: copy:
src: "{{ userconfig_path }}-lockdown" src: "{{ userconfig_path }}-lockdown"
dest: "{{ userconfig_path }}" dest: "{{ userconfig_path }}"

View file

@ -1,8 +1,5 @@
- name: "Desktop tasks ({{ ansible_system }})" - name: "Desktop tasks ({{ ansible_system }})"
include_tasks: "{{ loop_task }}" include: "{{ loop_task }}"
loop: "{{ query('fileglob', \"{{ ansible_system|lower }}/*\") | sort }}" loop: "{{ query('fileglob', \"{{ ansible_system|lower }}/*\", \"common/*\") | sort }}"
loop_control: loop_control:
loop_var: loop_task loop_var: loop_task
- name: Desktop tasks (Common)
import_tasks: firefox.yaml