Re-jig 'desktop' for Ansible

This commit is contained in:
Scott Wallace 2019-01-20 17:09:09 +00:00
parent d7257d876b
commit 47522e8382
18 changed files with 32 additions and 48 deletions

View file

@ -1,10 +1,6 @@
- name: Desktop installation and configuration
hosts: desktop
roles:
- role: linux_desktop
when: ansible_system == 'Linux'
- role: jaredhocutt.gnome_extensions
when: ansible_system == 'Linux'
- role: mac_desktop
when: ansible_system == 'Darwin'
- role: desktop
vars_files:
- "roles/desktop/vars/{{ ansible_system|lower }}.yaml"

View file

@ -0,0 +1,3 @@
dependencies:
- role: jaredhocutt.gnome_extensions
when: ansible_system == 'Linux'

View file

@ -2,8 +2,13 @@
tags:
- config
- firefox
set_fact:
firefox_path: '~/.mozilla/firefox'
block:
- set_fact:
firefox_path: '~/.mozilla/firefox'
when: ansible_system == 'Linux'
- set_fact:
firefox_path: '~/Library/Application Support/Firefox'
when: ansible_system == 'Darwin'
- name: 'Firefox: Discover profile path'
tags:

View file

@ -0,0 +1,15 @@
- name: Common desktop tasks
import_tasks: firefox.yaml
- name: Linux desktop tasks
block:
- import_tasks: software.yaml
- import_tasks: config.yaml
when: ansible_system == 'Linux'
- name: OS X desktop tasks
block:
- import_tasks: homebrew.yaml
- import_tasks: mas.yaml
- import_tasks: prefs.yaml
when: ansible_system == 'Darwin'

View file

@ -1,17 +1,19 @@
- name: 'iTerm2: Add configuration'
- name: 'Shell: Add iTerm2 configuration'
tags:
- config
- iterm2
- shell
template:
src: "iterm2/{{ item }}"
dest: '~/.iterm2'
mode: '0600'
loop: ['com.googlecode.iterm2.plist', 'hybrid.itermcolors']
- name: 'Iterm2: Shell integration'
- name: 'Shell: iTerm2 Bash integration'
tags:
- config
- iterm2
- shell
copy:
src: 'iterm2/shell_integration.bash'
dest: '~/.bashrc.d'
@ -38,35 +40,6 @@
dest: '~/.bashrc.d/alias.gnu'
mode: '0400'
- name: 'Firefox: Set base path'
tags:
- config
- firefox
- browser
set_fact:
firefox_path: '~/Library/Application Support/Firefox'
- name: 'Firefox: Find profile path'
tags:
- config
- firefox
- browser
set_fact:
profile_path: "{{ lookup('ini', 'Path section=Profile0 file=' + firefox_path + '/profiles.ini') }}"
- name: 'Firefox: Add local config'
tags:
- config
- firefox
- browser
copy:
content: |
user_pref("geo.enabled", false);
user_pref("privacy.window.maxInnerWidth", 1400);
user_pref("privacy.window.maxInnerHeight", 900);
dest: "{{ firefox_path }}/{{ profile_path }}/user.js"
mode: '0600'
- name: 'OS X: Preferences'
tags:
- config

View file

@ -1,4 +0,0 @@
- name: Linux desktop tasks
import_tasks: software.yaml
- import_tasks: config.yaml
- import_tasks: firefox.yaml

View file

@ -1,4 +0,0 @@
- name: Mac desktop tasks
import_tasks: homebrew.yaml
- import_tasks: mas.yaml
- import_tasks: prefs.yaml