More refactorisation of the roles.

This commit is contained in:
Scott Wallace 2019-02-23 11:53:41 +00:00
parent 40eab0d3f2
commit ad396149a1
24 changed files with 99 additions and 147 deletions

View file

@ -1,21 +1,7 @@
- name: Desktop installation and configuration
hosts: desktop
roles:
- role: desktop
vars_files:
- roles/desktop/vars/common.yaml
- "roles/desktop/vars/{{ ansible_system | lower }}.yaml"
tasks:
- import_tasks: roles/desktop/tasks/common/firefox.yaml
- import_tasks: roles/desktop/tasks/common/screen.yaml
- block:
- import_tasks: roles/desktop/tasks/darwin/homebrew.yaml
- import_tasks: roles/desktop/tasks/darwin/mas.yaml
- import_tasks: roles/desktop/tasks/darwin/prefs.yaml
when: ansible_system == 'Darwin'
- block:
- import_tasks: roles/desktop/tasks/linux/software.yaml
- import_tasks: roles/desktop/tasks/linux/config.yaml
- role: linux_desktop
when: ansible_system == 'Linux'
- role: darwin_desktop
when: ansible_system == 'Darwin'

View file

@ -0,0 +1,2 @@
- import_tasks: firefox.yaml
- import_tasks: screen.yaml

View file

@ -0,0 +1,2 @@
dependencies:
- role: common_desktop

View file

@ -0,0 +1,3 @@
- import_tasks: homebrew.yaml
- import_tasks: mas.yaml
- import_tasks: prefs.yaml

View file

@ -1,5 +0,0 @@
# Interesting variables
* ansible_default_ipv4.interface
* ansible_form_factor
* ansible_product_name
* ansible_system_vendor

View file

@ -1,48 +0,0 @@
homebrew_tap_items:
- caskroom/versions
- buo/homebrew-cask-upgrade
homebrew_brew_items:
- ack
- bash-completion
- curl
- git
- coreutils
- glances
- ipcalc
- mas
- nmap
- p7zip
- psgrep
- pv
- python3
- rename
- screen
- task
- tree
- vim
- watch
homebrew_cask_items:
- alfred
- cleanmymac
- enpass
- firefox
- google-drive-file-stream
- google-chrome
- google-hangouts
- handbrake
- iterm2
- itsycal
- joplin
- keybase
- osxfuse
- resilio-sync
- shiftit
- signal
- sonos
- virtualbox
- visual-studio-code
- whatsapp
- wireshark
- xquartz

View file

@ -1,63 +0,0 @@
config_repos:
- name: 'albert'
repo: 'git@github.com:scottwallacesh/albert.git'
dest: '~/.local/share/albert'
linux_repos:
- 'deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main' # Visual Studio Code
- 'deb http://download.opensuse.org/repositories/home:/manuelschneid3r/xUbuntu_18.10/ /' # Albert
- 'deb http://linux-packages.resilio.com/resilio-sync/deb resilio-sync non-free' # Resilio Sync
- 'deb http://prerelease.keybase.io/deb stable main' # Keybase
- 'deb https://apt.enpass.io/ stable main' # Enpass
linux_repos_keys:
- 'https://packages.microsoft.com/keys/microsoft.asc' # Visual Studio Code
- 'https://download.opensuse.org/repositories/home:manuelschneid3r/xUbuntu_18.10/Release.key' # Albert
- 'http://linux-packages.resilio.com/resilio-sync/key.asc' # Resilio Sync
- 'https://keybase.io/docs/server_security/code_signing_key.asc' # Keybase
- 'https://apt.enpass.io/keys/enpass-linux.key' # Enpass
linux_packages:
- albert
- chrome-gnome-shell
- code
- conky
- copyq
- dconf-editor
- enpass
- git
- glances
- gnome-shell-extension-caffeine
- gnome-shell-extension-dashtodock
- gnome-shell-extension-mediaplayer
- gnome-shell-extension-weather
- gnome-tweaks
- keybase
- net-tools
- netcat
- qrencode
- resilio-sync
- screen
# - sonos-controller-unofficial
- ttf-mscorefonts-installer
- units
- vim
- wireshark-qt
linux_apps:
# - franz
- google-play-music-desktop-player
- 'skype --classic'
- wireguard-ammp
gnome_extension_ids:
- 358 # activities configurator
- 1206 # clock-override
- 28 # gtile
- 1386 # notification counter
- 19 # user themes
# Platform specific packages
# Format: systemvendor_formfactor_packages
"Apple Inc._Laptop_packages":
- mbpfan

View file

@ -0,0 +1,2 @@
dependencies:
- role: common_desktop

View file

@ -0,0 +1,16 @@
- name: includes/repos.yaml
tags:
- install
- repos
block:
- name: "Apt repo: Import GPG key: {{ repo.name }}"
apt_key:
state: present
url: "{{ repo.key }}"
become: true
- name: "Apt repo: Add repo: {{ repo.name }}"
apt_repository:
state: present
repo: "{{ repo.data }}"
become: true

View file

@ -0,0 +1,2 @@
- import_tasks: software.yaml
- import_tasks: config.yaml

View file

@ -1,22 +1,11 @@
- name: Apt public GPG keys
tags:
- install
- repos
apt_key:
state: present
url: "{{ item }}"
loop: "{{ linux_repos_keys }}"
become: true
- name: Adding repositories
tags:
- install
- repos
apt_repository:
repo: "{{ item }}"
state: present
include: includes/repos.yaml
loop: "{{ linux_repos }}"
become: true
loop_control:
loop_var: repo
- name: Installing packages
tags:

View file

@ -0,0 +1,66 @@
config_repos:
- name: 'albert'
repo: 'git@github.com:scottwallacesh/albert.git'
dest: '~/.local/share/albert'
linux_repos:
- name: 'Visual Studio Code'
data: 'deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main'
key: 'https://packages.microsoft.com/keys/microsoft.asc'
- name: 'Albert'
data: 'deb http://download.opensuse.org/repositories/home:/manuelschneid3r/xUbuntu_18.10/ /'
key: 'https://download.opensuse.org/repositories/home:manuelschneid3r/xUbuntu_18.10/Release.key'
- name: 'Resilio Sync'
data: 'deb http://linux-packages.resilio.com/resilio-sync/deb resilio-sync non-free'
key: 'http://linux-packages.resilio.com/resilio-sync/key.asc'
- name: 'Keybase'
data: 'deb http://prerelease.keybase.io/deb stable main'
key: 'https://keybase.io/docs/server_security/code_signing_key.asc'
- name: 'Enpass'
data: 'deb https://apt.enpass.io/ stable main'
key: 'https://apt.enpass.io/keys/enpass-linux.key'
linux_packages:
- albert
- chrome-gnome-shell
- code
- conky
- copyq
- dconf-editor
- enpass
- git
- glances
- gnome-shell-extension-caffeine
- gnome-shell-extension-dashtodock
- gnome-shell-extension-mediaplayer
- gnome-shell-extension-weather
- gnome-tweaks
- keybase
- net-tools
- netcat
- qrencode
- resilio-sync
- screen
# - sonos-controller-unofficial
- ttf-mscorefonts-installer
- units
- vim
- wireshark-qt
linux_apps:
# - franz
- google-play-music-desktop-player
- 'skype --classic'
- wireguard-ammp
gnome_extension_ids:
- 358 # activities configurator
- 1206 # clock-override
- 28 # gtile
- 1386 # notification counter
- 19 # user themes
# Platform specific packages
# Format: systemvendor_formfactor_packages
"Apple Inc._Laptop_packages":
- mbpfan