commit 75594b5e43d9cecfdb1daaf16ef5d6f413c48d88 Author: Sonny Bakker Date: Tue Nov 24 16:55:00 2020 +0100 Initial commit diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..e99d805 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,5 @@ +parseable: true +quiet: true +skip_list: + - '501' +use_default_rules: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c17815f --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +*.retry +*.swp + +.venv +.env +env +venv + +node_modules/ + +.vault +.vaults/ +vault +vaults/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..369b1c8 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,42 @@ +stages: + - lint + - test + +cache: + key: "$CI_COMMIT_REF_SLUG" + paths: + - .cache/pip + - node_modules/ + +lint: + stage: lint + image: python:3.7 + before_script: + - pip install ansible ansible-lint --quiet + script: + - ansible-lint playbook.yml + only: + refs: + - development + - merge_requests + +pretty-lint: + stage: lint + image: node:12 + before_script: + - npm install + script: + - npx prettier "**/*.yml" --check + only: + refs: + - development + - merge_requests + +syntax-test: + stage: test + image: python:3.7 + before_script: + - pip install ansible ansible-lint --quiet + - ansible-galaxy install -r roles/requirements.yml + script: + - ansible-playbook playbook.yml --syntax-check diff --git a/.prettier.json b/.prettier.json new file mode 100644 index 0000000..9c76f6b --- /dev/null +++ b/.prettier.json @@ -0,0 +1,9 @@ +{ + "singleQuote": true, + "printWidth": 90, + "tabWidth": 2, + "useTabs": false, + "bracketSpacing": true, + "parser": "yaml" +} + diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..002a50d --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,2 @@ +[defaults] +roles_path = ./roles diff --git a/playbook.yml b/playbook.yml new file mode 100644 index 0000000..b2f17e0 --- /dev/null +++ b/playbook.yml @@ -0,0 +1,3 @@ +- hosts: localhost + roles: + - arch diff --git a/roles/.gitignore b/roles/.gitignore new file mode 100644 index 0000000..d10cc33 --- /dev/null +++ b/roles/.gitignore @@ -0,0 +1,6 @@ +# ignore all external roles and files in the roles dir +/* + +!.gitignore +!requirements.yml +!arch*/ diff --git a/roles/arch/tasks/git.yml b/roles/arch/tasks/git.yml new file mode 100644 index 0000000..e69de29 diff --git a/roles/arch/tasks/main.yml b/roles/arch/tasks/main.yml new file mode 100644 index 0000000..b174ca8 --- /dev/null +++ b/roles/arch/tasks/main.yml @@ -0,0 +1,30 @@ +- name: load desktop specific vars + include_vars: desktop.yml + when: not platform or platform == "desktop" + +- name: load laptop specific vars + include_vars: laptop.yml + when: platform and platform == "laptop" + +- name: install shared packages + pacman: + name: "{{ packages }}" + +- name: install platform specific packages + pacman: + name: "{{ platform_packages }}" + +# TODO +# - (systemd networkd/iwl) network setup +# - nftables setup depending on platform +# - daily systemd-timer +# - weekly systemd-timer +# - reflector setup + +- include_tasks: mpv.yml # TODO +- include_tasks: mpd.yml # TODO +- include_tasks: nfs.yml # TODO +- include_tasks: postgres.yml # TODO +- include_tasks: syncthing.yml # TODO depending on platform +- include_tasks: git.yml # TODO (identify) +- include_tasks: openvpn.yml # TODO depending on platform diff --git a/roles/arch/tasks/mpd.yml b/roles/arch/tasks/mpd.yml new file mode 100644 index 0000000..e69de29 diff --git a/roles/arch/tasks/mpv.yml b/roles/arch/tasks/mpv.yml new file mode 100644 index 0000000..e69de29 diff --git a/roles/arch/tasks/nfs.yml b/roles/arch/tasks/nfs.yml new file mode 100644 index 0000000..e69de29 diff --git a/roles/arch/tasks/openvpn.yml b/roles/arch/tasks/openvpn.yml new file mode 100644 index 0000000..e69de29 diff --git a/roles/arch/tasks/postgres.yml b/roles/arch/tasks/postgres.yml new file mode 100644 index 0000000..e69de29 diff --git a/roles/arch/tasks/syncthing.yml b/roles/arch/tasks/syncthing.yml new file mode 100644 index 0000000..e69de29 diff --git a/roles/arch/templates/input.j2 b/roles/arch/templates/input.j2 new file mode 100644 index 0000000..147b593 --- /dev/null +++ b/roles/arch/templates/input.j2 @@ -0,0 +1,27 @@ +# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }} +## Seek units are in seconds, but note that these are limited by keyframes +RIGHT seek 5 +LEFT seek -5 +SHIFT+RIGHT seek 60 +SHIFT+LEFT seek -60 + +# UP add volume 2 +# DOWN add volume -2 + +UP add ao-volume 2 +DOWN add ao-volume -2 +m cycle ao-mute + +PGUP add chapter 1 # skip to next chapter +PGDWN add chapter -1 # skip to previous chapter + +q quit + +j cycle sub # cycle through subtitles + +#SHARP cycle audio # switch audio streams + +f cycle fullscreen # toggle fullscreen +s screenshot # take a screenshot +S screenshot video # ...without subtitles + diff --git a/roles/arch/templates/mpv.j2 b/roles/arch/templates/mpv.j2 new file mode 100644 index 0000000..706daf1 --- /dev/null +++ b/roles/arch/templates/mpv.j2 @@ -0,0 +1,12 @@ +# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }} + +volume=100 +sub-auto=fuzzy +gpu-api=vulkan +vo=gpu +hwdec=vaapi + +ytdl-format=best + +audio-samplerate=96000 +audio-format=s64 diff --git a/roles/arch/vars/main.yml b/roles/arch/vars/main.yml new file mode 100644 index 0000000..48b25d1 --- /dev/null +++ b/roles/arch/vars/main.yml @@ -0,0 +1,24 @@ +packages: + - firefox + - mpv + - youtube-dl + - keepassxc + - gimp + - nftables + - mpd + - nfs + - openvpn + - okular + - postgres + - plasma-meta + - syncthing + - tmux + - unrar + - vim + - git + - openssl + - kmail + - iproute2 + - curl + - cantata + - reflector diff --git a/roles/requirements.yml b/roles/requirements.yml new file mode 100644 index 0000000..276b569 --- /dev/null +++ b/roles/requirements.yml @@ -0,0 +1,8 @@ +- src: git+https://git.fudiggity.nl/ansible/common.git + name: common + version: master + scm: git +- src: git+https://git.fudiggity.nl/ansible/npm.git + name: npm + version: master + scm: git