Extract tasks into more atomic files

This commit is contained in:
Jake Howard 2019-03-14 21:34:29 +00:00
parent 70277e922c
commit 7842efa3a9
Signed by: jake
GPG key ID: 57AFB45680EDD477
25 changed files with 450 additions and 267 deletions

View file

@ -3,22 +3,28 @@
tasks:
- include_vars:
file: vars.yml
- import_tasks: tasks/common.yml
- import_tasks: tasks/user.yml
- import_tasks: tasks/packages.yml
- import_tasks: tasks/config.yml
- import_tasks: tasks/python.yml
- import_tasks: tasks/vim.yml
- import_tasks: tasks/private.yml
- import_tasks: tasks/intersect.yml
- import_tasks: tasks/vscode.yml
- import_tasks: tasks/gnome.yml
- import_tasks: tasks/i3.yml
- import_tasks: tasks/services.yml
- import_tasks: tasks/shell.yml
- import_tasks: tasks/fonts.yml
- import_tasks: tasks/autostart.yml
- import_tasks: tasks/power-saving.yml
- import_tasks: tasks/display.yml
- import_tasks: tasks/javascript.yml
- import_tasks: tasks/applications.yml
- import_tasks: tasks/boot.yml
- import_tasks: tasks/dev.yml
- import_tasks: tasks/input.yml
- import_tasks: tasks/media.yml
- import_tasks: tasks/security.yml
- import_tasks: tasks/dabapps.yml
when: ansible_fqdn == "TOO-Work"
- import_tasks: tasks/laptop.yml
when: ansible_fqdn == "TOO-Laptop"
- import_tasks: tasks/cleanup.yml

View file

@ -1,14 +0,0 @@
# Preferences
Edit and save to update preferences:
```yaml
useProportionalFontInProse: Roboto # set to false to disable
useLargeFontInHeadings: "Roboto" # set to false to disable
font: "Fira Mono"
fontSize: 15
lineHeight: 1.8
lineWidth: 100
```
More options coming soon.

37
tasks/applications.yml Normal file
View file

@ -0,0 +1,37 @@
- name: "Install general applications"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'bleachbit'
- 'brave-bin'
- 'caprine'
- 'clamtk'
- 'corebird'
- 'etcher'
- 'filezilla'
- 'firefox'
- 'gimp'
- 'ghostwriter'
- 'glogg'
- 'google-earth-pro'
- 'gparted'
- 'inkscape'
- 'kdenlive'
- 'kodi'
- 'minecraft'
- 'obs-studio'
- 'onlyoffice-bin'
- 'slack-desktop'
- 'steam'
- 'thunderbird'
- 'tor-browser'
- 'virtualbox'
- 'vivaldi'
- 'vlc'
- 'whatsie'
- 'wps-office'
- 'wps-office-extension-english-uk-dictionary'

View file

@ -1,3 +1,13 @@
- name: "Install autostart-related packages"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'dex'
- file:
src: "/etc/xdg/autostart/{{ item }}.desktop"
dest: "{{ home }}/.config/autostart/{{ item }}.desktop"

31
tasks/boot.yml Normal file
View file

@ -0,0 +1,31 @@
- name: "Install Grub"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'grub-customizer'
- 'grub2-theme-archlinux'
- 'ly-git'
- service:
name: "lightdm"
enabled: false
- service:
name: "gdm"
enabled: false
- service:
name: "ly"
enabled: true
- service:
name: "getty@tty2"
enabled: false
- modprobe:
name: pcspkr
state: absent

View file

@ -1,50 +0,0 @@
- copy:
src: ./files/libinput-gestures.conf
dest: /etc/libinput-gestures.conf
mode: 0644
owner: "{{ user }}"
- template:
src: ./files/gitconfig.conf
dest: "{{ home }}/.gitconfig"
mode: 0644
owner: "{{ user }}"
group: users
- copy:
src: ./files/touchpad.conf
dest: /usr/share/X11/xorg.conf.d/30-touchpad.conf
mode: 0644
owner: "{{ user }}"
- copy:
src: ./files/assh.yml
dest: "{{ home}}/.ssh/assh.yml"
mode: 0644
owner: "{{ user }}"
- set_fact:
user_config_files:
- {src: "terminator.conf", dest: "{{ home }}/.config/terminator/config"}
- {src: "uniemoji.json", dest: "{{ home }}/.config/uniemoji/custom.json"}
- {src: "gitignore_global", dest: "{{ home }}/.config/.gitignore"}
- {src: "rofi.conf", dest: "{{ home }}/.config/rofi/config"}
- {src: "caret-preferences.md", dest: "{{ home }}/.config/Caret/Preferences.md"}
- {src: "alacritty.yml", dest: "{{ home }}/.config/alacritty/alacritty.yml"}
- name: "Create config file directories"
with_items: "{{ user_config_files }}"
file:
path: '{{ item.dest | dirname }}'
state: directory
owner: "{{ user }}"
mode: 0755
- name: "Copy config files"
with_items: "{{ user_config_files }}"
copy:
src: './files/{{ item.src }}'
dest: '{{ item.dest }}'
mode: 0644
owner: "{{ user }}"

View file

@ -1,3 +1,18 @@
- name: "Install DabApps packages"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'redis'
- service:
name: "redis"
enabled: true
- name: "DabApps Dotfiles"
git:
repo: git@github.com:dabapps/dotfiles
@ -13,7 +28,3 @@
owner: "{{ user }}"
state: link
force: true
- modprobe:
name: pcspkr
state: absent

32
tasks/dev.yml Normal file
View file

@ -0,0 +1,32 @@
- name: "Install dev packages"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'arduino'
- 'arduino-cli'
- 'arduino-builder'
- 'hugo'
- 'jdk'
- 'postgresql'
- 'postman-bin'
- 'sublime-text'
- 'tig'
- 'zola-bin'
- name: "Create global .gitignore"
copy:
src: './files/gitignore_global'
dest: '{{ home }}/.config/.gitignore'
mode: 0644
owner: "{{ user }}"
- template:
src: ./files/gitconfig.conf
dest: "{{ home }}/.gitconfig"
mode: 0644
owner: "{{ user }}"
group: users

12
tasks/display.yml Normal file
View file

@ -0,0 +1,12 @@
- name: "Install display packages"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'arandr'
- 'lxappearance'
- 'lxrandr'
- 'redshift'

View file

@ -1,3 +1,21 @@
- name: "Install font packages"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
# - 'all-repository-fonts'
- 'fonts-meta-extended-lt'
- 'otf-fira-code'
- 'otf-font-awesome'
- 'ttf-emojione'
- 'ttf-fira-code'
- 'ttf-font-awesome'
- 'ttf-ms-fonts'
- 'ttf-wps-fonts'
- file:
src: "/etc/fonts/conf.avail/{{ item }}"
dest: "/etc/fonts/conf.d/{{ item }}"

View file

@ -1,3 +1,28 @@
- name: "Install i3 packages"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'betterlockscreen'
- 'brightnessctl'
- 'compton'
- 'dmenu'
- 'dunst'
- 'feh'
- 'flameshot'
- 'i3-gaps'
- 'i3lock-color-git'
- 'lxqt-policykit'
- 'numix-gtk-theme'
- 'aur/polybar'
- 'qt5-styleplugins'
- 'rofi'
- 'tbg'
- set_fact:
polybar_scripts: "{{ home }}/.config/polybar/polybar-scripts/polybar-scripts"
i3_config_files:
@ -47,18 +72,17 @@
owner: "{{ user }}"
group: users
- service:
name: "lightdm"
enabled: false
- service:
name: "gdm"
enabled: false
- name: "Create rofi config directory"
file:
path: '{{ home }}/.config/rofi/'
state: directory
owner: "{{ user }}"
mode: 0755
- service:
name: "ly"
enabled: true
- service:
name: "getty@tty2"
enabled: false
- name: "Create rofi config"
copy:
src: './files/alacritty.yml'
dest: '{{ home }}/.config/rofi/config'
mode: 0644
owner: "{{ user }}"

39
tasks/input.yml Normal file
View file

@ -0,0 +1,39 @@
- name: "Install input packages"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'ibus'
- 'ibus-uniemoji'
- 'libinput'
- 'libinput-gestures'
- 'solaar'
- copy:
src: ./files/touchpad.conf
dest: /usr/share/X11/xorg.conf.d/30-touchpad.conf
mode: 0644
owner: "{{ user }}"
- copy:
src: ./files/libinput-gestures.conf
dest: /etc/libinput-gestures.conf
mode: 0644
owner: "{{ user }}"
- name: "Create uniemoji config directory"
file:
path: '{{ home }}/.config/uniemoji/'
state: directory
owner: "{{ user }}"
mode: 0755
- name: "Create uniemoji config"
copy:
src: './files/uniemoji.json'
dest: '{{ home }}/.config/uniemoji/custom.json'
mode: 0644
owner: "{{ user }}"

22
tasks/intersect.yml Normal file
View file

@ -0,0 +1,22 @@
- name: "Install intersect packages"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'calibre'
- 'deluge'
- 'enpass-bin'
- 'feedreader'
- 'hexchat'
- 'nextcloud-client'
- 'turtl'
- file:
state: directory
path: "{{ home }}/.dotfiles"
owner: "{{ user }}"
group: users

10
tasks/javascript.yml Normal file
View file

@ -0,0 +1,10 @@
- name: "Install Javascript packages"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'nodejs'
- 'nvm'

22
tasks/media.yml Normal file
View file

@ -0,0 +1,22 @@
- name: "Install Spotify"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'ffmpeg-compat-57'
- 'spotify'
- name: "Install media-related packages"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'bcm20702a1-firmware'
- 'bluez-firmware'
- 'handbrake'

View file

@ -23,9 +23,6 @@
dest: /etc/pacman.conf
mode: 0644
- pacman:
update_cache: true
- user:
name: aur_builder
group: wheel
@ -45,6 +42,7 @@
become_user: aur_builder
register: installed_packages
- name: "Install yay"
aur:
skip_installed: true
@ -52,166 +50,12 @@
become: true
become_user: aur_builder
- name: "Install initial packages"
- name: "Install additional repo keyrings"
aur:
use: yay
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'i3-gaps'
- 'all-repository-fonts'
- 'i3lock-color-git'
- name: "Install packages"
aur:
use: yay
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'acpi'
- 'advanced-ssh-config'
- 'alacritty'
- 'android-tools'
- 'arandr'
- 'archstrike-keyring'
- 'arduino'
- 'arduino-cli'
- 'arduino-builder'
- 'bat'
- 'bcm20702a1-firmware'
- 'betterlockscreen'
- 'bleachbit'
- 'bluez-firmware'
- 'brave-bin'
- 'brightnessctl'
- 'calibre'
- 'caprine'
- 'catimg'
- 'climate'
- 'clamtk'
- 'community/code'
- 'corebird'
- 'compton'
- 'deluge'
- 'dex'
- 'dmenu'
- 'dunst'
- 'enpass-bin'
- 'etcher'
- 'exa'
- 'fasd'
- 'fd'
- 'feedreader'
- 'feh'
- 'ffmpeg-compat-57'
- 'filezilla'
- 'firefox'
- 'flameshot'
- 'fonts-meta-extended-lt'
- 'gimp'
- 'ghostwriter'
- 'glogg'
- 'google-earth-pro'
- 'gparted'
- 'grub-customizer'
- 'grub2-theme-archlinux'
- 'gvim'
- 'handbrake'
- 'hexchat'
- 'htop'
- 'hugo'
- 'ibus'
- 'ibus-uniemoji'
- 'inkscape'
- 'jdk'
- 'jshon'
- 'kdenlive'
- 'keybase-bin'
- 'kodi'
- 'libinput'
- 'libinput-gestures'
- 'lxappearance'
- 'lxrandr'
- 'lxqt-policykit'
- 'ly-git'
- 'minecraft'
- 'mullvad-vpn'
- 'networkmanager-wireguard-git'
- 'nextcloud-client'
- 'nnn'
- 'nodejs'
- 'numix-gtk-theme'
- 'nvm'
- 'obs-studio'
- 'oh-my-zsh-git'
- 'onlyoffice-bin'
- 'otf-fira-code'
- 'otf-font-awesome'
- 'perl-file-mimeinfo'
- 'pigz'
- 'playerctl'
- 'aur/polybar'
- 'postgresql'
- 'postman-bin'
- 'powertop'
- 'psensor'
- 'pulseaudio-bluetooth-a2dp-gdm-fix'
- 'pyenv'
- 'python-pip'
- 'python-virtualenv'
- 'python2-pip'
- 'python2-virtualenv'
- 'qomui'
- 'qt5-styleplugins'
- 'redis'
- 'redshift'
- 'reptyr'
- 'ripgrep'
- 'rofi'
- 'scrcpy'
- 'screenfetch'
- 'sl'
- 'slack-desktop'
- 'solaar'
- 'spotify'
- 'steam'
- 'sublime-text'
- 'sysstat'
- 'tbg'
- 'terminator'
- 'thefuck'
- 'thunderbird'
- 'tig'
- 'tmux'
- 'tor-browser'
- 'ttf-emojione'
- 'ttf-fira-code'
- 'ttf-font-awesome'
- 'ttf-ms-fonts'
- 'ttf-wps-fonts'
- 'turtl'
- 'universal-ctags-git'
- 'vim-pathogen'
- 'virtualbox'
- 'vivaldi'
- 'vlc'
- 'whatsie'
- 'wireguard-arch'
- 'wireguard-tools'
- 'wps-office'
- 'wps-office-extension-english-uk-dictionary'
- 'zola-bin'
- 'zsh'
- 'zsh-completions'
- 'zsh-doc'
- 'zsh-syntax-highlighting'
- service:
name: "mullvad-daemon"
enabled: true

View file

@ -1,13 +1,17 @@
- name: "Install power-saving stuff"
aur:
use: yay
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'acpi'
- ethtool
- 'powertop'
- 'psensor'
- smartmontools
- 'sysstat'
- tlp
- name: Enable TLP services
@ -22,3 +26,15 @@
src: ./files/tlp.conf
dest: /etc/default/tlp
mode: 0644
- copy:
src: ./files/powertop.service
dest: /etc/systemd/system/powertop.service
mode: 0644
owner: root
directory_mode: true
- service:
name: "powertop"
enabled: true
state: started

View file

@ -1,5 +0,0 @@
- file:
state: directory
path: "{{ home }}/.dotfiles"
owner: "{{ user }}"
group: users

19
tasks/python.yml Normal file
View file

@ -0,0 +1,19 @@
- name: "Install python packages"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'pyenv'
- 'python-pip'
- 'python-virtualenv'
- 'python2-pip'
- 'python2-virtualenv'
- file:
state: directory
path: '/opt/pyenv'
owner: "{{ user }}"
group: users

24
tasks/security.yml Normal file
View file

@ -0,0 +1,24 @@
- name: "Install security-related packages"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'keybase-bin'
- 'mullvad-vpn'
- 'networkmanager-wireguard-git'
- 'qomui'
- 'wireguard-arch'
- 'wireguard-tools'
- service:
name: "mullvad-daemon"
enabled: true
- copy:
src: ./files/assh.yml
dest: "{{ home}}/.ssh/assh.yml"
mode: 0644
owner: "{{ user }}"

View file

@ -1,11 +0,0 @@
- copy:
src: ./files/powertop.service
dest: /etc/systemd/system/powertop.service
mode: 0644
owner: root
directory_mode: true
- service:
name: "powertop"
enabled: true
state: started

View file

@ -1,3 +1,40 @@
- name: "Install input packages"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'advanced-ssh-config'
- 'alacritty'
- 'bat'
- 'catimg'
- 'climate'
- 'exa'
- 'fasd'
- 'fd'
- 'htop'
- 'jshon'
- 'nnn'
- 'oh-my-zsh-git'
- 'perl-file-mimeinfo'
- 'pigz'
- 'playerctl'
- 'reptyr'
- 'ripgrep'
- 'scrcpy'
- 'screenfetch'
- 'sl'
- 'terminator'
- 'thefuck'
- 'tmux'
- 'zsh'
- 'zsh-completions'
- 'zsh-doc'
- 'zsh-syntax-highlighting'
- template:
src: ./files/zshrc/.zshrc
dest: "{{ home }}/.zshrc"
@ -27,3 +64,33 @@
force: true
become: true
become_user: "{{ user }}"
- name: "Create alacritty config directory"
file:
path: '{{ home }}/.config/alacritty/'
state: directory
owner: "{{ user }}"
mode: 0755
- name: "Create alacritty config"
copy:
src: './files/alacritty.yml'
dest: '{{ home }}/.config/alacritty/alacritty.yml'
mode: 0644
owner: "{{ user }}"
- name: "Create terminator directory"
file:
path: '{{ home }}/.config/terminator/'
state: directory
owner: "{{ user }}"
mode: 0755
- name: "Create alacritty config"
copy:
src: './files/terminator.conf'
dest: '{{ home }}/.config/terminator/config'
mode: 0644
owner: "{{ user }}"

View file

@ -10,12 +10,8 @@
- users
- video
- wheel
- file:
state: directory
path: '{{ home }}/Projects'
owner: "{{ user }}"
- file:
state: directory
path: '/opt/pyenv'
owner: "{{ user }}"
group: users

View file

@ -1,3 +1,15 @@
- name: "Install dev packages"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'gvim'
- 'vim-pathogen'
- copy:
src: ./files/vimrc
dest: "{{ home }}/.vimrc"

View file

@ -1,3 +1,14 @@
- name: "Install VSCode packages"
aur:
skip_installed: true
name: "{{ item }}"
become: true
become_user: aur_builder
when: "item not in installed_packages.stdout_lines"
with_items:
- 'community/code'
- 'universal-ctags-git'
- file:
src: "{{ home }}/.config/Code - OSS"
dest: "{{ home }}/.config/Code"