more verbose tagging

This commit is contained in:
Pig Monkey 2015-11-14 15:35:41 -08:00
parent 05be250360
commit ab5aff94f4
44 changed files with 244 additions and 27 deletions

View file

@ -28,6 +28,15 @@ provided on the first run when the user is being created. On later runs,
providing any password -- whether the current user password or a new one --
will have no effect.
## Tagging
All tasks are tagged with their role, allowing them to be skipped by tag in
addition to modifying `playbook.yml`. For instance, a system could be built
excluding the entire `media` role and the `dotfiles` section of the `base`
role.
# ansible-playbook -i localhost playbook.yml --skip-tags "media,dotfiles"
## AUR
All tasks involving the [AUR][4] are tagged `aur`. To provision an AUR-free

View file

@ -2,33 +2,33 @@
- hosts: localhost
sudo: yes
roles:
- { role: base }
- { role: fonts }
- { role: x }
- { role: i3 }
- { role: network }
- { role: ntp }
- { role: unbound }
- { role: editors }
- { role: browsers }
- { role: media }
- { role: laptop }
- { role: thinkpad }
- { role: screensaver }
- { role: firejail }
- { role: chat }
- { role: git-annex }
- { role: ledger }
- { role: mail }
- { role: office }
- { role: redshift }
- { role: rtorrent }
- { role: vm }
- { role: yubikey }
- { role: development }
- { role: backup }
- { role: mapping }
- { role: sound }
- { role: base, tags: ['base'] }
- { role: fonts, tags: ['fonts'] }
- { role: x, tags: ['x'] }
- { role: i3, tags: ['i3'] }
- { role: network, tags: ['network'] }
- { role: ntp, tags: ['ntp'] }
- { role: unbound, tags: ['unbound'] }
- { role: editors, tags: ['editors'] }
- { role: browsers, tags: ['browsers'] }
- { role: media, tags: ['media'] }
- { role: laptop, tags: ['laptop'] }
- { role: thinkpad, tags: ['thinkpad'] }
- { role: screensaver, tags: ['screensaver'] }
- { role: firejail, tags: ['firejail'] }
- { role: chat, tags: ['chat'] }
- { role: git-annex, tags: ['git-annex'] }
- { role: ledger, tags: ['ledger'] }
- { role: mail, tags: ['mail'] }
- { role: office, tags: ['office'] }
- { role: redshift, tags: ['redshift'] }
- { role: rtorrent, tags: ['rtorrent'] }
- { role: vm, tags: ['vm'] }
- { role: yubikey, tags: ['yubikey'] }
- { role: development, tags: ['development'] }
- { role: backup, tags: ['backup'] }
- { role: mapping, tags: ['mapping'] }
- { role: sound, tags: ['sound'] }
vars_prompt:
- name: user_password
prompt: "Enter desired user password"

View file

@ -1,9 +1,15 @@
---
- name: Install cronie
pacman: name=cronie state=present
tags:
- cron
- name: Enable cronie
service: name=cronie.service enabled=yes state=started
tags:
- cron
- name: Add paccache cleanup to daily cron
copy: src=cron/paccache.sh dest=/etc/cron.daily/paccache mode=755
tags:
- cron

View file

@ -5,6 +5,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/rcm
tags:
- aur
- dotfiles
become: yes
become_user: "{{ user.name }}"
@ -12,6 +13,7 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/rcm"
tags:
- aur
- dotfiles
become: yes
become_user: "{{ user.name }}"
@ -19,8 +21,12 @@
git: repo={{ dotfiles.url }} dest=/home/{{ user.name }}/.dotfiles accept_hostkey=yes update=no
become: yes
become_user: "{{ user.name }}"
tags:
- dotfiles
- name: Install user dotfiles
command: rcup {{ dotfiles.rcup_flags }}
become: yes
become_user: "{{ user.name }}"
tags:
- dotfiles

View file

@ -5,6 +5,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/orpie
tags:
- aur
- orpie
become: yes
become_user: "{{ user.name }}"
@ -12,6 +13,7 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/orpie"
tags:
- aur
- orpie
become: yes
become_user: "{{ user.name }}"

View file

@ -2,6 +2,8 @@
- name: Install universal base packages
pacman: name={{ item }} state=present
with_items: "{{ base_packages }}"
tags:
- packages
- name: Create AUR directory
file: path=/home/{{ user.name }}/{{ aur.dir }}
@ -10,6 +12,7 @@
group={{ user.group }}
tags:
- aur
- packages
- name: Download cower
get_url: url=https://aur.archlinux.org/cgit/aur.git/snapshot/cower.tar.gz
@ -18,6 +21,7 @@
group={{ user.group }}
tags:
- aur
- packages
- name: Extract cower
unarchive: src=/home/{{ user.name }}/{{ aur.dir }}/cower.tar.gz
@ -28,11 +32,13 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/cower
tags:
- aur
- packages
- name: Build and install cower
command: "{{ aur.makepkg }} --skippgpcheck chdir=/home/{{ user.name }}/{{ aur.dir }}/cower"
tags:
- aur
- packages
become: yes
become_user: "{{ user.name }}"
@ -42,6 +48,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/{{ aur.helper }}
tags:
- aur
- packages
become: yes
become_user: "{{ user.name }}"
@ -49,6 +56,7 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/{{ aur.helper }}"
tags:
- aur
- packages
become: yes
become_user: "{{ user.name }}"
@ -58,6 +66,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/pmount
tags:
- aur
- packages
become: yes
become_user: "{{ user.name }}"
@ -65,5 +74,6 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/pmount"
tags:
- aur
- packages
become: yes
become_user: "{{ user.name }}"

View file

@ -4,9 +4,13 @@
with_items:
- bash
- bash-completion
tags:
- shell
- name: Install ZSH
pacman: name={{ item }} state=present
with_items:
- zsh
- zsh-completions
tags:
- shell

View file

@ -1,39 +1,63 @@
---
- name: Install OpenSSH
pacman: name=openssh state=present
tags:
- ssh
- name: Push OpenSSH daemon configuration file
template: src=sshd_config.j2 dest=/etc/ssh/sshd_config
tags:
- ssh
- name: Create OpenSSH systemd unit file directory
file: path=/etc/systemd/system/sshd.socket.d state=directory
when: ssh.enable_sshd == "True"
tags:
- ssh
- name: Push OpenSSH socket unit file
template: src=sshd-socket-override.conf.j2 dest=/etc/systemd/system/sshd.socket.d/override.conf
when: ssh.enable_sshd == "True"
tags:
- ssh
- name: Enable and start OpenSSH
service: name=sshd.socket enabled=yes state=started
when: ssh.enable_sshd == "True"
tags:
- ssh
- name: Install sshfs
pacman: name=sshfs state=present
tags:
- ssh
- name: Copy fuse configuration file
copy: src=fuse.conf dest=/etc/fuse.conf
tags:
- ssh
- name: Install keychain
pacman: name=keychain state=present
tags:
- ssh
- name: Install x11-ask-pass
pacman: name=x11-ssh-askpass state=present
tags:
- ssh
- name: Make directory for user SSH key
file: path=/home/{{ user.name }}/.ssh state=directory owner={{ user.name }} group={{ user.group }}
tags:
- ssh
- name: Install user SSH key
copy: src={{ ssh.user_key }} dest=/home/{{ user.name }}/.ssh/id_rsa mode=600 owner={{ user.name }} group={{ user.group }}
tags:
- ssh
- name: Install Mosh
pacman: name=mosh state=present
tags:
- ssh

View file

@ -1,9 +1,15 @@
---
- name: Install sudo
pacman: name=sudo state=present
tags:
- sudo
- name: Add user to wheel group
user: name={{ user.name }} groups=wheel append=yes
tags:
- sudo
- name: Copy sudo configuration
copy: src=sudoers dest=/etc/sudoers mode=440
tags:
- sudo

View file

@ -1,6 +1,10 @@
---
- name: Create user group
group: name={{ user.group }} state=present
tags:
- user
- name: Create user and assign to group
user: name={{ user.name }} group={{ user.group }} password={{ user_password|password_hash('sha512') }} shell={{ user.shell }} update_password=on_create
tags:
- user

View file

@ -1,15 +1,25 @@
---
- name: Install libOTR
pacman: name=libotr state=present
tags:
- bitlbee
- name: Install Bitlbee
pacman: name=bitlbee state=present
tags:
- bitlbee
- name: Copy Bitlbee configuration file
copy: src=bitlbee.conf dest=/etc/bitlbee/bitlbee.conf
tags:
- bitlbee
- name: Ensure proper ownership of configuration directory
file: path=/var/lib/bitlbee group=bitlbee owner=bitlbee
tags:
- bitlbee
- name: Enable and start Bitlbee
service: name=bitlbee enabled=yes state=started
tags:
- bitlbee

View file

@ -1,6 +1,10 @@
---
- name: Install weechat
pacman: name=weechat state=present
tags:
- weechat
- name: Install dunst
pacman: name=dunst state=present
tags:
- weechat

View file

@ -7,24 +7,38 @@
with_items:
- { line: "\n[infinality-bundle]" }
- { line: "Server = http://bohoomil.com/repo/$arch" }
tags:
- infinality
- name: Verify root gnupg directory exists
file: path=/root/.gnupg/ state=directory
tags:
- infinality
- name: Verify dirmngr is configured
file: path=/root/.gnupg/dirmngr_ldapservers.conf state=touch
tags:
- infinality
- name: Verify dirmngr is running
command: dirmngr
tags:
- infinality
- name: Install Infinality repository key
command: pacman-key -r AE6866C7962DDE58
tags:
- infinality
- name: Trust Infinality repository key
command: pacman-key --lsign-key AE6866C7962DDE58
tags:
- infinality
- name: Update package cache
pacman: update_cache=yes
tags:
- infinality
- name: Install Infinality bundle
pacman: name={{ item }} state=present
@ -32,3 +46,5 @@
- freetype2-infinality-ultimate
- fontconfig-infinality-ultimate
- cairo-infinality-ultimate
tags:
- infinality

View file

@ -5,6 +5,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/rofi-git
tags:
- aur
- rofi
become: yes
become_user: "{{ user.name }}"
@ -12,6 +13,7 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/rofi-git"
tags:
- aur
- rofi
become: yes
become_user: "{{ user.name }}"
@ -21,6 +23,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/rofi-pass-git
tags:
- aur
- rofi
become: yes
become_user: "{{ user.name }}"
@ -28,11 +31,14 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/rofi-pass-git"
tags:
- aur
- rofi
become: yes
become_user: "{{ user.name }}"
- name: Install i3-wm for rofi window switching
pacman: name=i3-wm state=present
tags:
- rofi
- name: Download teiler (rofi screenshot app)
command: cower -dq teiler-git
@ -40,6 +46,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/teiler-git
tags:
- aur
- rofi
become: yes
become_user: "{{ user.name }}"
@ -47,6 +54,7 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/teiler-git"
tags:
- aur
- rofi
become: yes
become_user: "{{ user.name }}"
@ -56,6 +64,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/copyq-git
tags:
- aur
- rofi
become: yes
become_user: "{{ user.name }}"
@ -63,5 +72,6 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/copyq-git"
tags:
- aur
- rofi
become: yes
become_user: "{{ user.name }}"

View file

@ -5,6 +5,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/light-git
tags:
- aur
- light-git
become: yes
become_user: "{{ user.name }}"
@ -12,6 +13,7 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/light-git"
tags:
- aur
- light-git
become: yes
become_user: "{{ user.name }}"

View file

@ -1,18 +1,30 @@
---
- name: Install tlp-rdw for radio management
pacman: name=tlp-rdw state=present
tags:
- tlp
- name: Install TLP
pacman: name=tlp state=present
tags:
- tlp
- name: Copy TLP configuration file
copy: src=tlp.conf dest=/etc/default/tlp
tags:
- tlp
- name: Mask systemd radio service
command: systemctl mask systemd-rfkill@.service
tags:
- tlp
- name: Enable TLP
service: name=tlp.service enabled=yes
tags:
- tlp
- name: Enable TLP sleep
service: name=tlp-sleep.service enabled=yes
tags:
- tlp

View file

@ -1,6 +1,8 @@
---
- name: Copy mtrack-git configuration file
copy: src=50-mtrack-git.conf dest=/etc/X11/xorg.conf.d/50-mtrack-git.conf
tags:
- mtrack-git
- name: Download xf86-input-mtrack-git
command: cower -dq xf86-input-mtrack-git
@ -8,6 +10,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/xf86-input-mtrack-git
tags:
- aur
- mtrack-git
become: yes
become_user: "{{ user.name }}"
@ -15,6 +18,7 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/xf86-input-mtrack-git"
tags:
- aur
- mtrack-git
become: yes
become_user: "{{ user.name }}"

View file

@ -5,6 +5,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/goobook-git
tags:
- aur
- contacts
become: yes
become_user: "{{ user.name }}"
@ -12,6 +13,7 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/goobook-git"
tags:
- aur
- contacts
become: yes
become_user: "{{ user.name }}"
@ -21,6 +23,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/vdirsyncer
tags:
- aur
- contacts
become: yes
become_user: "{{ user.name }}"
@ -28,6 +31,7 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/vdirsyncer"
tags:
- aur
- contacts
become: yes
become_user: "{{ user.name }}"
@ -37,6 +41,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/khard-git
tags:
- aur
- contacts
become: yes
become_user: "{{ user.name }}"
@ -44,5 +49,6 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/khard-git"
tags:
- aur
- contacts
become: yes
become_user: "{{ user.name }}"

View file

@ -4,3 +4,5 @@
with_items:
- cdparanoia
- abcde
tags:
- abcde

View file

@ -10,3 +10,5 @@
- gstreamer0.10-python
- gstreamer0.10-ugly
- beets
tags:
- beets

View file

@ -1,3 +1,5 @@
---
- name: Install calibre
pacman: name=calibre state=present
tags:
- calibre

View file

@ -1,3 +1,5 @@
---
- name: Install feh
pacman: name=feh state=present
tags:
- feh

View file

@ -1,3 +1,5 @@
---
- name: Install GIMP
pacman: name=gimp state=present
tags:
- gimp

View file

@ -1,3 +1,5 @@
---
- name: Install gThumb
pacman: name=gthumb state=present
tags:
- gthumb

View file

@ -7,3 +7,5 @@
- librsvg
- openjpeg2
- imagemagick
tags:
- imagemagick

View file

@ -1,9 +1,15 @@
---
- name: Install mpd
pacman: name=mpd state=present
tags:
- mpd
- name: Install mpc
pacman: name=mpc state=present
tags:
- mpd
- name: Install ncmpcpp
pacman: name=ncmpcpp state=present
tags:
- mpd

View file

@ -1,6 +1,10 @@
---
- name: Install youtube-dl
pacman: name=youtube-dl state=present
tags:
- mpv
- name: Install mpv
pacman: name=mpv state=present
tags:
- mpv

View file

@ -1,3 +1,5 @@
---
- name: Install pianobar
pacman: name=pianobar state=present
tags:
- pianobar

View file

@ -1,3 +1,5 @@
---
- name: Install xfburn
pacman: name=xfburn state=present
tags:
- xfburn

View file

@ -5,6 +5,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/pdsh
tags:
- aur
- pdsh
become: yes
become_user: "{{ user.name }}"
@ -12,6 +13,7 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/pdsh"
tags:
- aur
- pdsh
become: yes
become_user: "{{ user.name }}"

View file

@ -8,18 +8,28 @@
- cups-pdf
- gutenprint
- hplip
tags:
- cups
- name: Add a print admin group
group: name=printadmin state=present
tags:
- cups
- name: Allow the print admin group to administer CUPS
lineinfile: dest=/etc/cups/cups-files.conf
regexp=^SystemGroup
state=present
line="SystemGroup sys root printadmin"
tags:
- cups
- name: Add the user to the print and print admin groups
user: name={{ user.name }} groups=printadmin,lp append=yes
tags:
- cups
- name: Enable and start CUPS
service: name=org.cups.cupsd.service enabled=yes state=started
tags:
- cups

View file

@ -1,6 +1,8 @@
---
- name: Install acpi_call for TLP battery functions
pacman: name=acpi_call state=present
tags:
- battery
- name: Download tpacpi-bat
command: cower -dq tpacpi-bat
@ -8,6 +10,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/tpacpi-bat
tags:
- aur
- battery
become: yes
become_user: "{{ user.name }}"
@ -15,5 +18,6 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/tpacpi-bat"
tags:
- aur
- battery
become: yes
become_user: "{{ user.name }}"

View file

@ -5,6 +5,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/tpfanco-svn
tags:
- aur
- fan
become: yes
become_user: "{{ user.name }}"
@ -12,6 +13,7 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/tpfanco-svn"
tags:
- aur
- fan
become: yes
become_user: "{{ user.name }}"
@ -19,8 +21,10 @@
copy: src=thinkfan.conf dest=/etc/thinkfan.conf
tags:
- aur
- fan
- name: Enable and start tpfanco
service: name=tpfand enabled=yes state=started
tags:
- aur
- fan

View file

@ -1,6 +1,10 @@
---
- name: Install Synaptics input driver
pacman: name=xf86-input-synaptics state=present
tags:
- synaptics
- name: Copy Synaptics configuration file
copy: src=50-synaptics.conf dest=/etc/X11/xorg.conf.d/50-synaptics.conf
tags:
- synaptics

View file

@ -1,3 +1,5 @@
---
- name: Install vagrant
pacman: name=vagrant state=present
tags:
- vagrant

View file

@ -6,6 +6,8 @@
- qt4
- virtualbox-guest-iso
- virtualbox
tags:
- virtualbox
- name: Download VirtualBox extensions
command: cower -dq virtualbox-ext-oracle
@ -13,6 +15,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/virtualbox-ext-oracle
tags:
- aur
- virtualbox
become: yes
become_user: "{{ user.name }}"
@ -20,11 +23,16 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/virtualbox-ext-oracle"
tags:
- aur
- virtualbox
become: yes
become_user: "{{ user.name }}"
- name: Copy kernel modules to load
copy: src=modules.conf dest=/etc/modules-load.d/virtualbox.conf
tags:
- virtualbox
- name: Add the user to vboxusers group
user: name={{ user.name }} groups=vboxusers append=yes
tags:
- virtualbox

View file

@ -1,3 +1,5 @@
---
- name: Install autocutsel
pacman: name=autocutsel state=present
tags:
- autocutsel

View file

@ -5,6 +5,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/autorandr-git
tags:
- aur
- autorandr
become: yes
become_user: "{{ user.name }}"
@ -12,5 +13,6 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/autorandr-git"
tags:
- aur
- autorandr
become: yes
become_user: "{{ user.name }}"

View file

@ -1,6 +1,10 @@
---
- name: Install SLiM
pacman: name=slim state=present
tags:
- slim
- name: Enable SLiM
service: name=slim.service enabled=yes
tags:
- slim

View file

@ -5,6 +5,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/srandrd
tags:
- aur
- srandrd
become: yes
become_user: "{{ user.name }}"
@ -12,5 +13,6 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/srandrd"
tags:
- aur
- srandrd
become: yes
become_user: "{{ user.name }}"

View file

@ -1,3 +1,5 @@
---
- name: Install sxhkd
pacman: name=sxhkd state=present
tags:
- sxhkd

View file

@ -1,6 +1,8 @@
---
- name: Install vte3-ng
pacman: name=vte3-ng state=present
tags:
- termite
- name: Download termite
command: cower -dq termite-git
@ -8,6 +10,7 @@
creates=/home/{{ user.name }}/{{ aur.dir }}/termite-git
tags:
- aur
- termite
become: yes
become_user: "{{ user.name }}"
@ -15,5 +18,6 @@
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/termite-git"
tags:
- aur
- termite
become: yes
become_user: "{{ user.name }}"

View file

@ -1,3 +1,5 @@
---
- name: Install unclutter
pacman: name=unclutter state=present
tags:
- unclutter

View file

@ -1,3 +1,5 @@
---
- name: Install volwheel
pacman: name=volwheel state=present
tags:
- volwheel