initial commit

This commit is contained in:
Pig Monkey 2015-09-06 15:51:37 -07:00
commit b6c6dd140e
107 changed files with 22809 additions and 0 deletions

98
INSTALL.md Normal file
View file

@ -0,0 +1,98 @@
The following is a brief installation tutorial for [Arch Linux][1]. It assumes
familiarity with the Arch [Beginner's Guide][2] and [Installation Guide][3].
It will provide a system with full-disk encryption using [LVM on LUKS][4].
There is no separate `/boot` partition. The entire installation is encrypted
and booted via [Grub's crypto hooks][5].
1. Boot into Arch installer
2. Verify that the [system clock is up to date][6].
$ timedatectl set-ntp true
3. Create a single partition for LUKS.
$ parted -s /dev/sda mklabel msdos
$ parted -s /dev/sda mkpart primary 2048s 100%
4. Create and mount the encrypted filesystem.
$ cryptsetup luksFormat /dev/sda1
$ cryptsetup luksOpen /dev/sda1 lvm
$ pvcreate /dev/mapper/lvm
$ vgcreate arch /dev/mapper/lvm
$ lvcreate -L 8G arch -n swap
$ lvcreate -L 30G arch -n root
$ lvcreate -l +100%FREE arch -n home
$ mkswap -L swap /dev/mapper/arch-swap
$ mkfs.ext4 /dev/mapper/arch-root
$ mkfs.ext4 /dev/mapper/arch-home
$ mount /dev/mapper/arch-root /mnt
$ mkdir /mnt/home
$ mount /dev/mapper/arch-home /mnt/home
$ swapon /dev/mapper/arch-swap
5. Optionally [edit the mirror list][7].
$ vi /etc/pacman.d/mirrorlist
6. Install the [base system][8].
$ pacstrap -i /mnt base base-devel
7. Generate and verify [fstab][9].
$ genfstab -U -p /mnt >> /mnt/etc/fstab
$ less /mnt/etc/fstab
8. Change root into the base install and perform [base configuration tasks][10].
$ arch-chroot /mnt /bin/bash
$ echo en_US.UTF-8 UTF-8 >> /etc/locale.gen
$ locale-gen
$ echo LANG=en_US.UTF-8 > /etc/locale.conf
$ export LANG=en_US.UTF-8
$ ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
$ hwclock --systohc --utc
$ echo mymachine > /etc/hostname
$ systemctl enable dhcpcd.service
$ passwd
9. Add a key file to decrypt the volume and properly set the hooks.
$ dd bs=512 count=8 if=/dev/urandom of=/crypto_keyfile.bin
$ cryptsetup luksAddKey /dev/sda1 /crypto_keyfile.bin
$ chmod 000 /crypto_keyfile.bin
$ sed -i 's/^FILES=.*/FILES="\/crypto_keyfile.bin"/' /etc/mkinitcpio.conf
$ sed -i 's/^HOOKS=.*/HOOKS="base udev autodetect modconf block keyboard encrypt lvm2 filesystems fsck"/' /etc/mkinitcpio.conf
$ mkinitcpio -p linux
10. Install GRUB.
$ pacman -S grub
$ echo GRUB_ENABLE_CRYPTODISK=y >> /etc/default/grub
$ sed -i 's/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="cryptdevice=\/dev\/sda1:lvm"/' /etc/default/grub
$ grub-mkconfig -o /boot/grub/grub.cfg
$ grub-install /dev/sda
$ chmod -R g-rwx,o-rwx /boot
11. Cleanup and reboot!
$ exit
$ umount -R /mnt
$ reboot
12. Run ansible!
[1]: https://www.archlinux.org/
[2]: https://wiki.archlinux.org/index.php/Beginners'_guide
[3]: https://wiki.archlinux.org/index.php/Installation_guide
[4]: https://wiki.archlinux.org/index.php/Encrypted_LVM#LVM_on_LUKS
[5]: http://www.pavelkogan.com/2014/05/23/luks-full-disk-encryption/
[6]: https://wiki.archlinux.org/index.php/Beginners'_guide#Update_the_system_clock
[7]: https://wiki.archlinux.org/index.php/Beginners'_Guide#Select_a_mirror
[8]: https://wiki.archlinux.org/index.php/Beginners'_Guide#Install_the_base_system
[9]: https://wiki.archlinux.org/index.php/Beginners'_guide#Generate_an_fstab
[10]: https://wiki.archlinux.org/index.php/Beginners'_guide#Configure_the_base_system

61
README.md Normal file
View file

@ -0,0 +1,61 @@
# Spark
Spark is an [Ansible][1] playbook meant to provision a personal machine running
[Arch Linux][2]. It is intended to run locally on a fresh Arch install (ie,
taking the place of any [post-installation][3]), but due to Ansible's
idempotent nature it may also be run on top of an already configured machine.
Spark assumes it will be run on a laptop -- specifically, a ThinkPad -- and
performs some configuration based on this assumption. This behaviour maybe
changed by removing the `laptop` and/or `thinkpad` role from the playbook, as
appropriate.
## Running
First, sync mirrors and install Ansible.
$ pacman -Syy python2-passlib ansible
Ansible will attempt to install the private SSH key for the user. The key
should be available at the path specified in the `ssh.user_key` variable.
Run the playbook as root.
$ ansible-playbook -i localhost playbook.yml
When run, Ansible will prompt for the user password. This only needs to be
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.
## AUR
All tasks involving the [AUR][4] are tagged `aur`. To provision an AUR-free
system, pass this tag to ansible's `--skip-tag`.
AUR packages will be downloaded via [cower][5] and installed with [makepkg][6].
It is assumed that the user will want to use an [AUR helper][7] after the
system has been provisioned, so whatever package is defined in `aur.helper`
will be installed. This helper will *not* be used during any of the
provisioning.
## Known Issues
* [tpfanco][8], normally installed as part of the `thinkpad` role is currently
[unavailable in the AUR][9]. No ThinkPad fan control software is currently
installed.
* [gpxpy][10], normally installed as part of the `mapping` role is currently
[unavailable in the AUR][11].
[1]: http://www.ansible.com
[2]: https://www.archlinux.org
[3]: https://wiki.archlinux.org/index.php/Installation_guide#Post-installation
[4]: https://aur.archlinux.org
[5]: https://github.com/falconindy/cower
[6]: https://wiki.archlinux.org/index.php/Makepkg
[7]: https://wiki.archlinux.org/index.php/AUR_helpers
[8]: https://code.google.com/p/tpfanco/
[9]: https://aur.archlinux.org/packages/?O=0&K=tpfanco
[10]: https://github.com/tkrajina/gpxpy
[11]: https://aur.archlinux.org/packages/?O=0&K=gpxpy

20
group_vars/all Normal file
View file

@ -0,0 +1,20 @@
user:
name: pigmonkey
group: pigmonkey
shell: /usr/bin/zsh
dotfiles:
url: git@github.com:pigmonkey/dotfiles.git
rcup_flags: -x README.md
hostname: nous
aur:
dir: aur
helper: aura-bin
makepkg: makepkg -csri --noconfirm --needed --noprogressbar
ssh:
port: 22
user_key: /root/id_rsa
enable_sshd: False

2
localhost Normal file
View file

@ -0,0 +1,2 @@
[localhost]
localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python2

34
playbook.yml Normal file
View file

@ -0,0 +1,34 @@
---
- hosts: localhost
sudo: yes
roles:
- { role: base }
- { role: fonts }
- { role: x }
- { role: i3 }
- { role: network }
- { role: npd }
- { role: unbound }
- { role: vim }
- { 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 }
vars_prompt:
- name: user_password
prompt: "Enter desired user password"

View file

@ -0,0 +1,3 @@
---
dependencies:
- { role: base }

View file

@ -0,0 +1,6 @@
---
- name: Install Tarsnap
pacman: name=tarsnap state=present
- name: Install rsnapshot
pacman: name=rsnapshot state=present

View file

@ -0,0 +1,3 @@
#!/bin/sh
/usr/bin/paccache -r

View file

@ -0,0 +1 @@
user_allow_other

View file

@ -0,0 +1,18 @@
[options]
HoldPkg = pacman glibc
Architecture = auto
CheckSpace
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
[multilib]
Include = /etc/pacman.d/mirrorlist

6
roles/base/files/sudoers Normal file
View file

@ -0,0 +1,6 @@
##
## User privilege specification
##
root ALL=(ALL) ALL
%wheel ALL=(ALL) ALL

View file

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

View file

@ -0,0 +1,36 @@
---
- name: Download rcm
command: cower -dq rcm
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/rcm
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install rcm
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/rcm"
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Clone user dotfiles
git: repo={{ dotfiles.url }} dest=/home/{{ user.name }}/.dotfiles accept_hostkey=yes update=no
become: yes
become_user: "{{ user.name }}"
- name: Initialize dotfile submodules
command: git submodule init chdir=/home/{{ user.name }}/.dotfiles
become: yes
become_user: "{{ user.name }}"
- name: Update dotfile submodules
command: git submodule update chdir=/home/{{ user.name }}/.dotfiles
become: yes
become_user: "{{ user.name }}"
- name: Install user dotfiles
command: rcup {{ dotfiles.rcup_flags }}
become: yes
become_user: "{{ user.name }}"

17
roles/base/tasks/main.yml Normal file
View file

@ -0,0 +1,17 @@
---
- name: Copy pacman configuration file
copy: src=pacman.conf dest=/etc/pacman.conf
- name: Refresh pacman mirrors
pacman: update_cache=yes
- name: Set the hostname
hostname: name={{ hostname }}
- include: shell.yml
- include: user.yml
- include: sudo.yml
- include: packages.yml
- include: cron.yml
- include: ssh.yml
- include: dotfiles.yml

View file

@ -0,0 +1,85 @@
---
- name: Install universal packages
pacman: name={{ item }} state=present
with_items:
- tmux
- git
- gnupg
- rsync
- glances
- task
- coreutils
- moreutils
- pass
- reflector
- zip
- unzip
- unrar
- bc
- ranger
- alsa-utils
- name: Create AUR directory
file: path=/home/{{ user.name }}/{{ aur.dir }}
state=directory
owner={{ user.name }}
group={{ user.group }}
tags:
- aur
- name: Download cower
get_url: url=https://aur.archlinux.org/cgit/aur.git/snapshot/cower.tar.gz
dest=/home/{{ user.name }}/{{ aur.dir }}
owner={{ user.name }}
group={{ user.group }}
tags:
- aur
- name: Extract cower
unarchive: src=/home/{{ user.name }}/{{ aur.dir }}/cower.tar.gz
dest=/home/{{ user.name }}/{{ aur.dir }}
copy=no
owner={{ user.name }}
group={{ user.group }}
creates=/home/{{ user.name }}/{{ aur.dir }}/cower
tags:
- aur
- name: Build and install cower
command: "{{ aur.makepkg }} --skippgpcheck chdir=/home/{{ user.name }}/{{ aur.dir }}/cower"
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Download AUR helper
command: cower -dq {{ aur.helper }}
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/{{ aur.helper }}
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install AUR helper
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/{{ aur.helper }}"
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Download pmount
command: cower -dq pmount
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/pmount
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install pmount
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/pmount"
tags:
- aur
become: yes
become_user: "{{ user.name }}"

View file

@ -0,0 +1,12 @@
---
- name: Install Bash
pacman: name={{ item }} state=present
with_items:
- bash
- bash-completion
- name: Install ZSH
pacman: name={{ item }} state=present
with_items:
- zsh
- zsh-completions

36
roles/base/tasks/ssh.yml Normal file
View file

@ -0,0 +1,36 @@
---
- name: Install OpenSSH
pacman: name=openssh state=present
- name: Push OpenSSH daemon configuration file
template: src=sshd_config.j2 dest=/etc/ssh/sshd_config
- name: Create OpenSSH systemd unit file directory
file: path=/etc/systemd/system/sshd.socket.d state=directory
when: ssh.enable_sshd == "True"
- 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"
- name: Enable and start OpenSSH
service: name=sshd.socket enabled=yes state=started
when: ssh.enable_sshd == "True"
- name: Install sshfs
pacman: name=sshfs state=present
- name: Copy fuse configuration file
copy: src=fuse.conf dest=/etc/fuse.conf
- name: Install keychain
pacman: name=keychain state=present
- name: Install x11-ask-pass
pacman: name=x11-ssh-askpass state=present
- name: Make directory for user SSH key
file: path=/home/{{ user.name }}/.ssh state=directory owner={{ user.name }} group={{ user.group }}
- 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 }}

View file

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

View file

@ -0,0 +1,6 @@
---
- name: Create user group
group: name={{ user.group }} state=present
- 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

View file

@ -0,0 +1,3 @@
[Socket]
ListenStream=
ListenStream={{ ssh.port }}

View file

@ -0,0 +1,17 @@
# {{ ansible_managed }}
Port {{ ssh.port }}
Protocol 2
PermitRootLogin no
PasswordAuthentication no
AllowTcpForwarding no
X11Forwarding no
PrintMotd no
PrintLastLog yes
AllowUsers {{ user }}
LoginGraceTime 1m
ChallengeResponseAuthentication no
PubkeyAuthentication yes
Subsystem sftp /usr/lib/ssh/sftp-server
Ciphers aes256-ctr
MACs hmac-sha2-512

View file

@ -0,0 +1,6 @@
---
dependencies:
- { role: base }
- { role: x }
- { role: fonts }
- { role: network }

View file

@ -0,0 +1,25 @@
---
- name: Install Lynx
pacman: name=lynx state=present
- name: Install Firefox
pacman: name=firefox state=present
- name: Install Chromium
pacman: name=chromium state=present
- name: Download Chromium Pepper Flash
command: cower -dq chromium-pepper-flash
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/chromium-pepper-flash
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install Chromium Pepper Flash
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/chromium-pepper-flash"
tags:
- aur
become: yes
become_user: "{{ user.name }}"

View file

@ -0,0 +1,6 @@
[settings]
RunMode = ForkDaemon
User = bitlbee
[defaults]
private = 1

4
roles/chat/meta/main.yml Normal file
View file

@ -0,0 +1,4 @@
---
dependencies:
- { role: base }
- { role: network }

View file

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

View file

@ -0,0 +1,3 @@
---
- include: weechat.yml
- include: bitlbee.yml

View file

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

View file

@ -0,0 +1,3 @@
---
dependencies:
- { role: base }

View file

@ -0,0 +1,49 @@
---
- name: Install virtualenv and virtualenvwrapper
pacman: name=python-virtualenvwrapper state=present
tags:
- python-dev
- name: Install tig
pacman: name=tig state=present
- name: Install Ruby
pacman: name=ruby state=present
tags:
- ruby-dev
- name: Download Ruby bundler
command: cower -dq ruby-bundler
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/ruby-bundler
tags:
- aur
- ruby-dev
become: yes
become_user: "{{ user.name }}"
- name: Build and install Ruby bundler
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/ruby-bundler"
tags:
- aur
- ruby-dev
become: yes
become_user: "{{ user.name }}"
- name: Download Compass
command: cower -dq ruby-compass
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/ruby-compass
tags:
- aur
- ruby-dev
become: yes
become_user: "{{ user.name }}"
- name: Build and install Compass
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/ruby-compass"
tags:
- aur
- ruby-dev
become: yes
become_user: "{{ user.name }}"

View file

@ -0,0 +1,3 @@
---
dependencies:
- { role: base }

View file

@ -0,0 +1,16 @@
---
- name: Download Firejail
command: cower -dq firejail
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/firejail
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install Firejail
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/firejail"
tags:
- aur
become: yes
become_user: "{{ user.name }}"

View file

@ -0,0 +1,3 @@
---
dependencies:
- { role: base }

View file

@ -0,0 +1,34 @@
---
- name: Add Infinality repository to pacman
lineinfile: dest=/etc/pacman.conf
state=present
insertafter=EOF
line="{{ item.line }}"
with_items:
- { line: "\n[infinality-bundle]" }
- { line: "Server = http://bohoomil.com/repo/$arch" }
- name: Verify root gnupg directory exists
file: path=/root/.gnupg/ state=directory
- name: Verify dirmngr is configured
file: path=/root/.gnupg/dirmngr_ldapservers.conf state=touch
- name: Verify dirmngr is running
command: dirmngr
- name: Install Infinality repository key
command: pacman-key -r AE6866C7962DDE58
- name: Trust Infinality repository key
command: pacman-key --lsign-key AE6866C7962DDE58
- name: Update package cache
pacman: update_cache=yes
- name: Install Infinality bundle
pacman: name={{ item }} state=present
with_items:
- freetype2-infinality-ultimate
- fontconfig-infinality-ultimate
- cairo-infinality-ultimate

View file

@ -0,0 +1,5 @@
---
- include: infinality.yml
- name: Install Terminus
pacman: name=terminus-font state=present

View file

@ -0,0 +1,3 @@
---
dependencies:
- { role: base }

View file

@ -0,0 +1,16 @@
---
- name: Download git-annex
command: cower -dq git-annex-bin
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/git-annex-bin
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install git-annex
command: "{{ aur.makepkg }} --skippgpcheck chdir=/home/{{ user.name }}/{{ aur.dir }}/git-annex-bin"
tags:
- aur
become: yes
become_user: "{{ user.name }}"

5
roles/i3/meta/main.yml Normal file
View file

@ -0,0 +1,5 @@
---
dependencies:
- { role: base }
- { role: x }
- { role: fonts }

5
roles/i3/tasks/main.yml Normal file
View file

@ -0,0 +1,5 @@
---
- name: Install i3
pacman: name=i3 state=present
- include: rofi.yml

35
roles/i3/tasks/rofi.yml Normal file
View file

@ -0,0 +1,35 @@
---
- name: Download rofi
command: cower -dq rofi-git
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/rofi-git
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install rofi
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/rofi-git"
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Download rofi-pass
command: cower -dq rofi-pass-git
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/rofi-pass-git
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install rofi-pass
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/rofi-pass-git"
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Install i3-wm for rofi window switching
pacman: name=i3-wm state=present

View file

@ -0,0 +1,37 @@
Section "InputClass"
Identifier "touchpad catchall"
Driver "synaptics"
MatchIsTouchpad "on"
Option "TapButton1" "1"
Option "TapButton2" "2"
Option "TapButton3" "3"
MatchDevicePath "/dev/input/event*"
EndSection
Section "InputClass"
Identifier "touchpad ignore duplicates"
MatchIsTouchpad "on"
MatchOS "Linux"
MatchDevicePath "/dev/input/mouse*"
Option "Ignore" "on"
EndSection
Section "InputClass"
Identifier "touchpad"
Driver "synaptics"
MatchIsTouchpad "on"
Option "TapButton1" "1"
Option "TapButton2" "2"
Option "TapButton3" "3"
Option "VertEdgeScroll" "off"
Option "VertTwoFingerScroll" "on"
Option "HorizEdgeScroll" "off"
Option "HorizTwoFingerScroll" "on"
Option "CircularScrolling" "on"
Option "CircScrollTrigger" "0"
Option "EmulateTwoFingerMinZ" "40"
Option "EmulateTwoFingerMinW" "8"
Option "CoastingSpeed" "0"
Option "FingerLow" "35"
Option "FingerHigh" "40"
EndSection

View file

@ -0,0 +1,5 @@
[Login]
HandlePowerKey=ignore
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=suspend

259
roles/laptop/files/tlp.conf Normal file
View file

@ -0,0 +1,259 @@
# ------------------------------------------------------------------------------
# tlp - Parameters for power save
# Hint: some features are disabled by default, remove the leading # to enable
# them.
# Set to 0 to disable, 1 to enable TLP.
TLP_ENABLE=1
# Seconds laptop mode has to wait after the disk goes idle before doing a sync.
# Non-zero value enables, zero disables laptop mode.
DISK_IDLE_SECS_ON_AC=0
DISK_IDLE_SECS_ON_BAT=2
# Dirty page values (timeouts in secs).
MAX_LOST_WORK_SECS_ON_AC=15
MAX_LOST_WORK_SECS_ON_BAT=60
# Hint: CPU parameters below are disabled by default, remove the leading #
# to enable them, otherwise kernel default values are used.
# Select a CPU frequency scaling governor:
# ondemand, powersave, performance, conservative
# Intel Core i processor with intel_pstate driver:
# powersave, performance
# Important:
# You *must* disable your distribution's governor settings or conflicts will
# occur. ondemand is sufficient for *almost all* workloads, you should know
# what you're doing!
#CPU_SCALING_GOVERNOR_ON_AC=ondemand
#CPU_SCALING_GOVERNOR_ON_BAT=ondemand
# Set the min/max frequency available for the scaling governor.
# Possible values strongly depend on your CPU. For available frequencies see
# tlp-stat output, Section "+++ Processor".
#CPU_SCALING_MIN_FREQ_ON_AC=0
#CPU_SCALING_MAX_FREQ_ON_AC=0
#CPU_SCALING_MIN_FREQ_ON_BAT=0
#CPU_SCALING_MAX_FREQ_ON_BAT=0
# Set Intel P-state performance: 0..100 (%)
# Limit the max/min P-state to control the power dissipation of the CPU.
# Values are stated as a percentage of the available performance.
# Requires an Intel Core i processor with intel_pstate driver.
#CPU_MIN_PERF_ON_AC=0
#CPU_MAX_PERF_ON_AC=100
#CPU_MIN_PERF_ON_BAT=0
#CPU_MAX_PERF_ON_BAT=30
# Set the CPU "turbo boost" feature: 0=disable, 1=allow
# Requires an Intel Core i processor.
# Important:
# - This may conflict with your distribution's governor settings
# - A value of 1 does *not* activate boosting, it just allows it
#CPU_BOOST_ON_AC=1
#CPU_BOOST_ON_BAT=0
# Minimize number of used CPU cores/hyper-threads under light load conditions
SCHED_POWERSAVE_ON_AC=0
SCHED_POWERSAVE_ON_BAT=1
# Kernel NMI Watchdog:
# 0=disable (default, saves power), 1=enable (for kernel debugging only)
NMI_WATCHDOG=0
# Change CPU voltages aka "undervolting" - Kernel with PHC patch required
# Frequency voltage pairs are written to:
# /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
# CAUTION: only use this, if you thoroughly understand what you are doing!
#PHC_CONTROLS="F:V F:V F:V F:V"
# Set CPU performance versus energy savings policy:
# performance, normal, powersave
# Requires kernel module msr and x86_energy_perf_policy from linux-tools
ENERGY_PERF_POLICY_ON_AC=performance
ENERGY_PERF_POLICY_ON_BAT=powersave
# Hard disk devices; separate multiple devices with spaces (default: sda).
# Devices can be specified by disk ID also (lookup with: tlp diskid).
#DISK_DEVICES="sda sdb"
# Hard disk advanced power management level: 1..254, 255 (max saving, min, off)
# Levels 1..127 may spin down the disk; 255 allowable on most drives.
# Separate values for multiple devices with spaces.
DISK_APM_LEVEL_ON_AC="254 254"
DISK_APM_LEVEL_ON_BAT="128 128"
# Hard disk spin down timeout:
# 0: spin down disabled
# 1..240: timeouts from 5s to 20min (in units of 5s)
# 241..251: timeouts from 30min to 5.5 hours (in units of 30min)
# See 'man hdparm' for details.
#DISK_SPINDOWN_TIMEOUT_ON_AC="0 0"
#DISK_SPINDOWN_TIMEOUT_ON_BAT="0 0"
# Select IO scheduler for the disk devices: noop, deadline, cfq (Default: cfq);
# Separate values for multiple devices with spaces.
#DISK_IOSCHED="cfq cfq"
# SATA aggressive link power management (ALPM):
# min_power, medium_power, max_performance
SATA_LINKPWR_ON_AC=max_performance
SATA_LINKPWR_ON_BAT=min_power
# PCI Express Active State Power Management (PCIe ASPM):
# default, performance, powersave
PCIE_ASPM_ON_AC=performance
PCIE_ASPM_ON_BAT=powersave
# Radeon graphics clock speed (profile method): low, mid, high, auto, default;
# auto = mid on BAT, high on AC; default = use hardware defaults.
# (Kernel >= 2.6.35 only, open-source radeon driver explicitly)
RADEON_POWER_PROFILE_ON_AC=high
RADEON_POWER_PROFILE_ON_BAT=low
# Radeon dynamic power management method (DPM): battery, performance
# (Kernel >= 3.11 only, requires boot option radeon.dpm=1)
RADEON_DPM_STATE_ON_AC=performance
RADEON_DPM_STATE_ON_BAT=battery
# Radeon DPM performance level: auto, low, high; auto is recommended.
RADEON_DPM_PERF_LEVEL_ON_AC=auto
RADEON_DPM_PERF_LEVEL_ON_BAT=auto
# WiFi power saving mode: 1=disable, 5=enable; not supported by all adapters.
WIFI_PWR_ON_AC=1
WIFI_PWR_ON_BAT=5
# Disable wake on LAN: Y/N
WOL_DISABLE=Y
# Enable audio power saving for Intel HDA, AC97 devices (timeout in secs).
# A value of 0 disables, >=1 enables power save.
SOUND_POWER_SAVE_ON_AC=0
SOUND_POWER_SAVE_ON_BAT=1
# Disable controller too (HDA only): Y/N
SOUND_POWER_SAVE_CONTROLLER=Y
# Set to 1 to power off optical drive in UltraBay/MediaBay when running on
# battery. A value of 0 disables this feature (Default).
# Drive can be powered on again by releasing (and reinserting) the eject lever
# or by pressing the disc eject button on newer models.
# Note: an UltraBay/MediaBay hard disk is never powered off.
BAY_POWEROFF_ON_BAT=0
# Optical drive device to power off (default sr0).
BAY_DEVICE="sr0"
# Runtime Power Management for PCI(e) bus devices: on=disable, auto=enable
RUNTIME_PM_ON_AC=on
RUNTIME_PM_ON_BAT=auto
# Runtime PM for *all* PCI(e) bus devices, except blacklisted ones:
# 0=disable, 1=enable
RUNTIME_PM_ALL=0
# Exclude PCI(e) device adresses the following list from Runtime PM
# (separate with spaces). Use lspci to get the adresses (1st column).
#RUNTIME_PM_BLACKLIST="bb:dd.f 11:22.3 44:55.6"
# Exclude PCI(e) devices assigned to the listed drivers from Runtime PM
# (should prevent accidential power on of hybrid graphics' discrete part).
# Default is "radeon nouveau"; use "" to disable the feature completely.
# Separate multiple drivers with spaces.
RUNTIME_PM_DRIVER_BLACKLIST="radeon nouveau"
# Set to 0 to disable, 1 to enable USB autosuspend feature.
USB_AUTOSUSPEND=1
# Exclude listed devices from USB autosuspend (separate with spaces).
# Use lsusb to get the ids.
# Note: input devices (usbhid) are excluded automatically (see below)
#USB_BLACKLIST="1111:2222 3333:4444"
# Exclude devices assigned to the listed drivers from USB autosuspend.
# Default is "usbhid" (input devices); use "" to disable the feature
# completely. Separate multiple drivers with spaces.
USB_DRIVER_BLACKLIST="usbhid"
# WWAN devices are excluded from USB autosuspend:
# 0=do not exclude / 1=exclude
USB_BLACKLIST_WWAN=1
# Include listed devices into USB autosuspend even if already excluded
# by the driver or WWAN blacklists above (separate with spaces).
# Use lsusb to get the ids.
#USB_WHITELIST="1111:2222 3333:4444"
# Set to 1 to disable autosuspend before shutdown, 0 to do nothing
# (workaround for USB devices that cause shutdown problems).
#USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN=1
# Restore radio device state (Bluetooth, WiFi, WWAN) from previous shutdown
# on system startup: 0=disable, 1=enable.
# Hint: the parameters DEVICES_TO_DISABLE/ENABLE_ON_STARTUP/SHUTDOWN below
# are ignored when this is enabled!
RESTORE_DEVICE_STATE_ON_STARTUP=0
# Radio devices to disable on startup: bluetooth, wifi, wwan.
# Separate multiple devices with spaces.
#DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wifi wwan"
# Radio devices to enable on startup: bluetooth, wifi, wwan.
# Separate multiple devices with spaces.
#DEVICES_TO_ENABLE_ON_STARTUP="wifi"
# Radio devices to disable on shutdown: bluetooth, wifi, wwan
# (workaround for devices that are blocking shutdown).
#DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth wifi wwan"
# Radio devices to enable on shutdown: bluetooth, wifi, wwan
# (to prevent other operating systems from missing radios).
#DEVICES_TO_ENABLE_ON_SHUTDOWN="wwan"
# Radio devices to enable on AC: bluetooth, wifi, wwan
#DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan"
# Radio devices to disable on battery: bluetooth, wifi, wwan
#DEVICES_TO_DISABLE_ON_BAT="bluetooth wifi wwan"
# Radio devices to disable on battery when not in use (not connected):
# bluetooth, wifi, wwan
#DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wifi wwan"
# Battery charge thresholds (ThinkPad only, tp-smapi or acpi-call kernel module
# required). Charging starts when the remaining capacity falls below the
# START_CHARGE_TRESH value and stops when exceeding the STOP_CHARGE_TRESH value.
# Main / Internal battery (values in %)
START_CHARGE_THRESH_BAT0=80
STOP_CHARGE_THRESH_BAT0=90
# Ultrabay / Slice / Replaceable battery (values in %)
START_CHARGE_THRESH_BAT1=80
STOP_CHARGE_THRESH_BAT1=90
# ------------------------------------------------------------------------------
# tlp-rdw - Parameters for the radio device wizard
# Possible devices: bluetooth, wifi, wwan
# Hints:
# - Parameters are disabled by default, remove the leading # to enable them.
# - Separate multiple radio devices with spaces.
# Radio devices to disable on connect.
DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
#DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
#DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"
# Radio devices to enable on disconnect.
DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi wwan"
#DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=""
#DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""
# Radio devices to enable/disable when docked.
#DEVICES_TO_ENABLE_ON_DOCK=""
#DEVICES_TO_DISABLE_ON_DOCK=""
# Radio devices to enable/disable when undocked.
#DEVICES_TO_ENABLE_ON_UNDOCK="wifi"
#DEVICES_TO_DISABLE_ON_UNDOCK=""

View file

@ -0,0 +1,3 @@
---
dependencies:
- { role: base }

View file

@ -0,0 +1,6 @@
---
- include: synaptics.yml
- include: tlp.yml
- name: Copy logind configuration file
copy: src=logind.conf dest=/etc/systemd/logind.conf

View file

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

View file

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

View file

@ -0,0 +1,3 @@
---
dependencies:
- { role: base }

View file

@ -0,0 +1,25 @@
---
- name: Install ledger dependencies
pacman: name={{ item }} state=present
with_items:
- boost
- cmake
- texlive-plainextra
tags:
- aur
- name: Download ledger
command: cower -dq ledger
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/ledger
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install ledger
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/ledger"
tags:
- aur
become: yes
become_user: "{{ user.name }}"

4
roles/mail/meta/main.yml Normal file
View file

@ -0,0 +1,4 @@
---
dependencies:
- { role: base }
- { role: network }

38
roles/mail/tasks/main.yml Normal file
View file

@ -0,0 +1,38 @@
---
- name: Download Mutt
command: cower -dq mutt-sidebar
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/mutt-sidebar
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install Mutt
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/mutt-sidebar"
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Download urlview
command: cower -dq urlview
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/urlview
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install urlview
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/urlview"
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Install OfflineIMAP
pacman: name=offlineimap state=present
- name: Install msmtp
pacman: name=msmtp-mta state=present

View file

@ -0,0 +1,4 @@
---
dependencies:
- { role: base }
- { role: x }

View file

@ -0,0 +1,19 @@
---
- name: Install Viking
pacman: name=viking state=present
#- name: Download gpxpy
# command: cower -dq python-gpxpy
# chdir=/home/{{ user.name }}/{{ aur.dir }}
# creates=/home/{{ user.name }}/{{ aur.dir }}/python-gpxpy
# tags:
# - aur
# become: yes
# become_user: "{{ user.name }}"
#- name: Build and install gpxpy
# command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/python-gpxpy"
# tags:
# - aur
# become: yes
# become_user: "{{ user.name }}"

View file

@ -0,0 +1,5 @@
---
dependencies:
- { role: base }
- { role: x }
- { role: fonts }

View file

@ -0,0 +1,6 @@
---
- name: Install abcde and dependencies
pacman: name={{ item }} state=present
with_items:
- cdparanoia
- abcde

View file

@ -0,0 +1,12 @@
---
- name: Install beets and dependencies
pacman: name={{ item }} state=present
with_items:
- python2-pylast
- python2-requests
- gstreamer0.10-bad-plugins
- gstreamer0.10-good-plugins
- gstreamer0.10-ffmpeg
- gstreamer0.10-python
- gstreamer0.10-ugly
- beets

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,9 @@
---
- name: Install imagemagick and dependencies
pacman: name={{ item }} state=present
with_items:
- libraw
- libpng
- librsvg
- openjpeg2
- imagemagick

View file

@ -0,0 +1,21 @@
---
- include: mpv.yml
- include: mpd.yml
- include: beets.yml
- include: abcde.yml
- include: xfburn.yml
- include: imagemagick.yml
- include: gimp.yml
- include: gthumb.yml
- include: feh.yml
- include: calibre.yml
- include: pianobar.yml
- name: Install misc media codecs and helpers
pacman: name={{ item }} state=present
with_items:
- flac
- lame
- gst-libav
- gst-plugins-good
- exiv2

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,3 @@
---
dependencies:
- { role: base }

View file

@ -0,0 +1,27 @@
---
- name: Install OpenVPN
pacman: name=openvpn state=present
- name: Install MTR
pacman: name=mtr state=present
- name: Install NetworkManager
pacman: name=networkmanager state=present
- name: Install NetworkManager OpenVPN plugin
pacman: name=networkmanager-openvpn state=present
- name: Install NetworkManager applet
pacman: name=network-manager-applet state=present
- name: Install Xfce notification daemon
pacman: name=xfce4-notifyd state=present
- name: Install GNOME Keyring
pacman: name=gnome-keyring state=present
- name: Enable and start NetworkManager
service: name=NetworkManager.service enabled=yes state=started
- name: Enable and start NetworkManager dispatcher
service: name=NetworkManager-dispatcher.service enabled=yes state=started

View file

@ -0,0 +1,3 @@
[Time]
NTP=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org
FallbackNTP=0.pool.ntp.org 1.pool.ntp.org 0.fr.pool.ntp.org

4
roles/npd/meta/main.yml Normal file
View file

@ -0,0 +1,4 @@
---
dependencies:
- { role: base }
- { role: network }

6
roles/npd/tasks/main.yml Normal file
View file

@ -0,0 +1,6 @@
---
- name: Copy systemd-timesyncd configuration file
copy: src=timesyncd.conf dest=/etc/systemd/timesyncd.conf
- name: Enable systemd-timesyncd
command: timedatectl set-ntp true

View file

@ -0,0 +1,4 @@
---
dependencies:
- { role: base }
- { role: x }

View file

@ -0,0 +1,25 @@
---
- name: Install CUPS and drivers
pacman: name={{ item }} state=present
with_items:
- ghostscript
- gsfonts
- cups
- cups-pdf
- gutenprint
- hplip
- name: Add a print admin group
group: name=printadmin state=present
- 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"
- name: Add the user to the print and print admin groups
user: name={{ user.name }} groups=printadmin,lp append=yes
- name: Enable and start CUPS
service: name=org.cups.cupsd.service enabled=yes state=started

View file

@ -0,0 +1,14 @@
---
- include: cups.yml
- name: Install LibreOffice
pacman: name=libreoffice-fresh state=present
- name: Install Zathura and dependencies
pacman: name={{ item }} state=present
with_items:
- zathura-pdf-mupdf
- zathura-ps
- name: Install Simple Scan
pacman: name=simple-scan state=present

View file

@ -0,0 +1,4 @@
---
dependencies:
- { role: base }
- { role: x }

View file

@ -0,0 +1,8 @@
---
- name: Install RedShift and dependencies
pacman: name={{ item }} state=present
with_items:
- librsvg
- python-gobject
- python-xdg
- redshift

View file

@ -0,0 +1,4 @@
---
dependencies:
- { role: base }
- { role: network }

View file

@ -0,0 +1,3 @@
---
- name: Install rtorrent
pacman: name=rtorrent state=present

View file

@ -0,0 +1,4 @@
---
dependencies:
- { role: base }
- { role: x }

View file

@ -0,0 +1,22 @@
---
- name: Install xautolock
pacman: name=xautolock state=present
- name: Download physlock
command: cower -dq physlock
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/physlock
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install physlock
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/physlock"
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Push sleep lock script
template: src=lock.sh.j2 dest=/usr/lib/systemd/system-sleep/lock.sh mode=755

View file

@ -0,0 +1,8 @@
#!/bin/bash
# {{ ansible_managed }}
if [ "$1" = "post" ]; then
if ! pidof physlock > /dev/null; then
/usr/sbin/physlock -u {{ user.name }}
fi
fi

View file

@ -0,0 +1,9 @@
sensor /sys/devices/virtual/thermal/thermal_zone0/temp
(0, 0, 35)
(1, 33, 38)
(2, 36, 45)
(3, 39, 49)
(4, 46, 58)
(5, 50, 62)
(7, 56, 32767)

View file

@ -0,0 +1,4 @@
---
dependencies:
- { role: base }
- { role: laptop }

View file

@ -0,0 +1,19 @@
---
- name: Install acpi_call for TLP battery functions
pacman: name=acpi_call state=present
- name: Download tpacpi-bat
command: cower -dq tpacpi-bat
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/tpacpi-bat
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install tpacpi-bat
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/tpacpi-bat"
tags:
- aur
become: yes
become_user: "{{ user.name }}"

View file

@ -0,0 +1,26 @@
---
- name: Download tpfanco
command: cower -dq tpfanco-svn
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/tpfanco-svn
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install tpfanco
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/tpfanco-svn"
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Copy tpfanco configuration file
copy: src=thinkfan.conf dest=/etc/thinkfan.conf
tags:
- aur
- name: Enable and start tpfanco
service: name=tpfand enabled=yes state=started
tags:
- aur

View file

@ -0,0 +1,3 @@
---
- include: battery.yml
#- include: fan.yml

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,21 @@
server:
interface: 127.0.0.1
username: "@UNBOUND_USERNAME@"
directory: "@UNBOUND_RUN_DIR@"
use-syslog: yes
do-not-query-localhost: no
access-control: 0.0.0.0/8 allow
# Set root DNS servers.
root-hints: "/etc/unbound/root.hints"
# Block hosts serving advertisements, trackers, etc.
# https://github.com/jodrell/unbound-block-hosts/
include: /etc/unbound/local-blocking-data.conf
# Define DNS servers to forward queries to.
forward-zone:
name: "."
forward-addr: 8.8.8.8 # Google
forward-addr: 205.171.3.25 # Qwest
forward-addr: 74.82.42.42 # Hurricane Electric

View file

@ -0,0 +1,4 @@
---
dependencies:
- { role: base }
- { role: network }

View file

@ -0,0 +1,15 @@
---
- name: Install Unbound
pacman: name=unbound state=present
- name: Download root hints
get_url: url=ftp://FTP.INTERNIC.NET/domain/named.cache dest=/etc/unbound/root.hints
- name: Copy ad blocking hosts file
copy: src=local-blocking-data.conf dest=/etc/unbound/local-blocking-data.conf
- name: Copy Unbound configuration file
copy: src=unbound.conf dest=/etc/unbound/unbound.conf
- name: Enable and start Unbound
service: name=unbound.service enabled=yes state=started

4
roles/vim/meta/main.yml Normal file
View file

@ -0,0 +1,4 @@
---
dependencies:
- { role: base }
- { role: x }

6
roles/vim/tasks/main.yml Normal file
View file

@ -0,0 +1,6 @@
---
- name: Install gvim
pacman: name=gvim state=present
- name: Install vim plugins
command: vim +PluginInstall! +qall

View file

@ -0,0 +1,3 @@
vboxdrv
vboxnetadp
vboxnetflt

3
roles/vm/meta/main.yml Normal file
View file

@ -0,0 +1,3 @@
---
dependencies:
- { role: base }

3
roles/vm/tasks/main.yml Normal file
View file

@ -0,0 +1,3 @@
---
- include: virtualbox.yml
- include: vagrant.yml

View file

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

View file

@ -0,0 +1,30 @@
---
- name: Install VirtualBox and dependencies
pacman: name={{ item }} state=present
with_items:
- net-tools
- qt4
- virtualbox-guest-iso
- virtualbox
- name: Download VirtualBox extensions
command: cower -dq virtualbox-ext-oracle
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/virtualbox-ext-oracle
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install VirtualBox extensions
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/virtualbox-ext-oracle"
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Copy kernel modules to load
copy: src=modules.conf dest=/etc/modules-load.d/virtualbox.conf
- name: Add the user to vboxusers group
user: name={{ user.name }} groups=vboxusers append=yes

4
roles/x/meta/main.yml Normal file
View file

@ -0,0 +1,4 @@
---
dependencies:
- { role: base }
- { role: fonts }

View file

@ -0,0 +1,16 @@
---
- name: Download autorandr
command: cower -dq autorandr-git
chdir=/home/{{ user.name }}/{{ aur.dir }}
creates=/home/{{ user.name }}/{{ aur.dir }}/autorandr-git
tags:
- aur
become: yes
become_user: "{{ user.name }}"
- name: Build and install autorandr
command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/autorandr-git"
tags:
- aur
become: yes
become_user: "{{ user.name }}"

22
roles/x/tasks/main.yml Normal file
View file

@ -0,0 +1,22 @@
---
- name: Install Xorg
pacman: name=xorg-server state=present
- name: Install Xinit
pacman: name=xorg-xinit state=present
- name: Install xmodmap
pacman: name=xorg-xmodmap state=present
- name: Install Intel video driver
pacman: name=xf86-video-intel state=present
- name: Add user to video group
user: name={{ user.name }} groups=video append=yes
- include: slim.yml
- include: sxhkd.yml
- include: unclutter.yml
- include: volwheel.yml
- include: autorandr.yml
- include: termite.yml

Some files were not shown because too many files have changed in this diff Show more