commit bb833e61a654cb494a16ceb6b0b3ad925c06b42c Author: Simon Bruder Date: Fri Oct 12 20:44:28 2018 +0000 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e601699 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +playbook.retry diff --git a/playbook.yml b/playbook.yml new file mode 100644 index 0000000..942fdbb --- /dev/null +++ b/playbook.yml @@ -0,0 +1,18 @@ +--- +- hosts: 127.0.0.1 + connection: local + become: yes + any_errors_fatal: yes + roles: + - role: packages + tags: + - packages + - role: gui + tags: + - gui + - role: prog + tags: + - prog + - role: docker + tags: + - docker diff --git a/roles/docker/handlers/main.yml b/roles/docker/handlers/main.yml new file mode 100644 index 0000000..72b1e42 --- /dev/null +++ b/roles/docker/handlers/main.yml @@ -0,0 +1,3 @@ +--- +- name: update-grub + shell: update-grub diff --git a/roles/docker/tasks/kernel.yml b/roles/docker/tasks/kernel.yml new file mode 100644 index 0000000..9095a76 --- /dev/null +++ b/roles/docker/tasks/kernel.yml @@ -0,0 +1,7 @@ +--- +- name: add boot parameters for docker + lineinfile: + path: /etc/default/grub + regexp: '^GRUB_CMDLINE_LINUX_DEFAULT=' + line: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet cgroup_enable=memory swapaccount=1"' + notify: update-grub diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml new file mode 100644 index 0000000..380a370 --- /dev/null +++ b/roles/docker/tasks/main.yml @@ -0,0 +1,8 @@ +--- +- import_tasks: packages.yml + tags: + - docker:packages + +- import_tasks: kernel.yml + tags: + - docker:kernel diff --git a/roles/docker/tasks/packages.yml b/roles/docker/tasks/packages.yml new file mode 100644 index 0000000..b6ffdb6 --- /dev/null +++ b/roles/docker/tasks/packages.yml @@ -0,0 +1,21 @@ +--- +- name: install docker dependencies + apt: + name: "apt-transport-https" + state: present + +- name: add docker repository key + apt_key: + url: https://download.docker.com/linux/debian/gpg + state: present + +- name: add docker repository + apt_repository: + repo: deb https://download.docker.com/linux/debian buster stable + state: present + +- name: install docker + apt: + name: "docker-ce" + update_cache: yes + state: present diff --git a/roles/gui/files/20-intel.conf b/roles/gui/files/20-intel.conf new file mode 100644 index 0000000..36f6eb5 --- /dev/null +++ b/roles/gui/files/20-intel.conf @@ -0,0 +1,5 @@ +Section "Device" + Identifier "Intel Graphics" + Driver "intel" + Option "Backlight" "intel_backlight" +EndSection diff --git a/roles/gui/files/lock b/roles/gui/files/lock new file mode 100755 index 0000000..11e5658 --- /dev/null +++ b/roles/gui/files/lock @@ -0,0 +1,3 @@ +#!/bin/sh +i3lock -c 000000 +xset dpms force off diff --git a/roles/gui/files/lock.service b/roles/gui/files/lock.service new file mode 100644 index 0000000..66d4d05 --- /dev/null +++ b/roles/gui/files/lock.service @@ -0,0 +1,12 @@ +[Unit] +Description=Lock X session +Before=sleep.target + +[Service] +User=simon +Type=forking +Environment=DISPLAY=:0 +ExecStart=/usr/local/bin/lock + +[Install] +WantedBy=sleep.target diff --git a/roles/gui/files/wallpaper.jpg b/roles/gui/files/wallpaper.jpg new file mode 100644 index 0000000..ca356ba Binary files /dev/null and b/roles/gui/files/wallpaper.jpg differ diff --git a/roles/gui/tasks/awesome.yml b/roles/gui/tasks/awesome.yml new file mode 100644 index 0000000..007852d --- /dev/null +++ b/roles/gui/tasks/awesome.yml @@ -0,0 +1,5 @@ +--- +- name: install awesome + apt: + name: "awesome" + state: present diff --git a/roles/gui/tasks/lightdm.yml b/roles/gui/tasks/lightdm.yml new file mode 100644 index 0000000..b09a4d7 --- /dev/null +++ b/roles/gui/tasks/lightdm.yml @@ -0,0 +1,5 @@ +--- +- name: install lightdm + apt: + name: "lightdm" + state: present diff --git a/roles/gui/tasks/lock.yml b/roles/gui/tasks/lock.yml new file mode 100644 index 0000000..e09ae86 --- /dev/null +++ b/roles/gui/tasks/lock.yml @@ -0,0 +1,28 @@ +--- +- name: install i3lock + apt: + name: "i3lock" + state: present + +- name: install lock script + copy: + src: lock + dest: /usr/local/bin/lock + mode: 0755 + +- name: copy lock systemd service + copy: + src: lock.service + dest: /lib/systemd/system/lock.service + +- name: enable lock systemd service + service: + name: lock + enabled: true + +- name: susped at lid close when docked + ini_file: + path: /etc/systemd/logind.conf + section: Login + option: HandleLidSwitchDocked + value: suspend diff --git a/roles/gui/tasks/main.yml b/roles/gui/tasks/main.yml new file mode 100644 index 0000000..23659c1 --- /dev/null +++ b/roles/gui/tasks/main.yml @@ -0,0 +1,16 @@ +--- +- import_tasks: lightdm.yml + tags: + - gui:lightdm +- import_tasks: xorg.yml + tags: + - gui:xorg +- import_tasks: awesome.yml + tags: + - gui:awesome +- import_tasks: wallpaper.yml + tags: + - gui:wallpaper +- import_tasks: lock.yml + tags: + - gui:lock diff --git a/roles/gui/tasks/wallpaper.yml b/roles/gui/tasks/wallpaper.yml new file mode 100644 index 0000000..b73b45b --- /dev/null +++ b/roles/gui/tasks/wallpaper.yml @@ -0,0 +1,5 @@ +--- +- name: install wallpaper + copy: + src: wallpaper.jpg + dest: /usr/share/wallpapers/wallpaper.jpg diff --git a/roles/gui/tasks/xorg.yml b/roles/gui/tasks/xorg.yml new file mode 100644 index 0000000..0774928 --- /dev/null +++ b/roles/gui/tasks/xorg.yml @@ -0,0 +1,10 @@ +--- +- name: create xorg config directory + file: + path: /etc/X11/xorg.conf.d + state: directory + +- name: install xorg config for backlight + copy: + src: 20-intel.conf + dest: /etc/X11/xorg.conf.d/20-intel.conf diff --git a/roles/packages/tasks/base.yml b/roles/packages/tasks/base.yml new file mode 100644 index 0000000..53661b7 --- /dev/null +++ b/roles/packages/tasks/base.yml @@ -0,0 +1,18 @@ +--- +- name: install base packages + apt: + name: "{{ item }}" + state: present + with_items: + - git + - htop + - lm-sensors + - rxvt-unicode + - tmux + - vim-nox + - zsh + +- name: set urxvt as default terminal emulator + alternatives: + name: x-terminal-emulator + path: /usr/bin/urxvt diff --git a/roles/packages/tasks/communication.yml b/roles/packages/tasks/communication.yml new file mode 100644 index 0000000..9263b11 --- /dev/null +++ b/roles/packages/tasks/communication.yml @@ -0,0 +1,10 @@ +--- +- name: install network manager + apt: + name: "{{ item }}" + state: present + with_items: + - claws-mail + - claws-mail-pgpinline + - claws-mail-pgpmime + - mumble diff --git a/roles/packages/tasks/deps.yml b/roles/packages/tasks/deps.yml new file mode 100644 index 0000000..d3d6215 --- /dev/null +++ b/roles/packages/tasks/deps.yml @@ -0,0 +1,7 @@ +--- +- name: install generic dependencies + apt: + name: "{{ item }}" + state: present + with_items: + - libdbus-glib-1-2 diff --git a/roles/packages/tasks/design.yml b/roles/packages/tasks/design.yml new file mode 100644 index 0000000..9d74ff3 --- /dev/null +++ b/roles/packages/tasks/design.yml @@ -0,0 +1,11 @@ +--- +- name: install design packages + apt: + name: "{{ item }}" + state: present + with_items: + - darktable + - fonts-roboto + - fonts-texgyre + - gimp + - inkscape diff --git a/roles/packages/tasks/main.yml b/roles/packages/tasks/main.yml new file mode 100644 index 0000000..58fd470 --- /dev/null +++ b/roles/packages/tasks/main.yml @@ -0,0 +1,28 @@ +--- +- import_tasks: base.yml + tags: + - packages:base +- import_tasks: tools.yml + tags: + - packages:tools +- import_tasks: deps.yml + tags: + - packages:deps +- import_tasks: media.yml + tags: + - packages:media +- import_tasks: design.yml + tags: + - packages:design +- import_tasks: communication.yml + tags: + - packages:communication +- import_tasks: office.yml + tags: + - packages:office +- import_tasks: network.yml + tags: + - packages:network +- import_tasks: web.yml + tags: + - packages:web diff --git a/roles/packages/tasks/media.yml b/roles/packages/tasks/media.yml new file mode 100644 index 0000000..9e66141 --- /dev/null +++ b/roles/packages/tasks/media.yml @@ -0,0 +1,18 @@ +--- +- name: install media packages + apt: + name: "{{ item }}" + state: present + with_items: + - audacious + - audacity + - calibre + - eom + - jpegoptim + - mkvtoolnix + - mkvtoolnix-gui + - mpv + - pasystray + - pavucontrol + - pulseaudio + - sidplayfp diff --git a/roles/packages/tasks/network.yml b/roles/packages/tasks/network.yml new file mode 100644 index 0000000..ba5da42 --- /dev/null +++ b/roles/packages/tasks/network.yml @@ -0,0 +1,9 @@ +--- +- name: install network packages + apt: + name: "{{ item }}" + state: present + with_items: + - blueman + - network-manager + - network-manager-gnome diff --git a/roles/packages/tasks/office.yml b/roles/packages/tasks/office.yml new file mode 100644 index 0000000..a1af3da --- /dev/null +++ b/roles/packages/tasks/office.yml @@ -0,0 +1,13 @@ +--- +- name: install office packages + apt: + name: "{{ item }}" + state: present + with_items: + - evince + - gscan2pdf + - libreoffice + - libreoffice-gtk3 + - libreoffice-l10n-de + - mupdf + - texlive-full diff --git a/roles/packages/tasks/tools.yml b/roles/packages/tasks/tools.yml new file mode 100644 index 0000000..dd1507b --- /dev/null +++ b/roles/packages/tasks/tools.yml @@ -0,0 +1,19 @@ +--- +- name: installing tools + apt: + name: "{{ item }}" + state: present + with_items: + - arandr + - atool + - bmon + - dnsutils + - libnotify-bin + - mtr-tiny + - ncdu + - pass + - redshift-gtk + - ripgrep + - rsync + - thunar + - xbacklight diff --git a/roles/packages/tasks/web.yml b/roles/packages/tasks/web.yml new file mode 100644 index 0000000..912a5c4 --- /dev/null +++ b/roles/packages/tasks/web.yml @@ -0,0 +1,8 @@ +--- +- name: install web packages + apt: + name: "{{ item }}" + state: present + with_items: + - aria2 + - chromium diff --git a/roles/prog/tasks/go.yml b/roles/prog/tasks/go.yml new file mode 100644 index 0000000..04546d1 --- /dev/null +++ b/roles/prog/tasks/go.yml @@ -0,0 +1,5 @@ +--- +- name: install golang + apt: + name: "golang" + state: present diff --git a/roles/prog/tasks/main.yml b/roles/prog/tasks/main.yml new file mode 100644 index 0000000..d20f0a3 --- /dev/null +++ b/roles/prog/tasks/main.yml @@ -0,0 +1,7 @@ +--- +- import_tasks: python.yml + tags: + - prog:python +- import_tasks: go.yml + tags: + - prog:go diff --git a/roles/prog/tasks/python.yml b/roles/prog/tasks/python.yml new file mode 100644 index 0000000..46933f7 --- /dev/null +++ b/roles/prog/tasks/python.yml @@ -0,0 +1,15 @@ +--- +- name: install pip + apt: + name: "python3-pip" + state: present + +- name: install python modules via pip + pip: + name: "{{ item }}" + state: present + executable: pip3 + with_items: + - docker-compose + - ipython + - powerline-status