From 2aa70d66fb1d6f4af5a815fbc765058afdba5bbc Mon Sep 17 00:00:00 2001 From: Owe Bretthauer Date: Sun, 31 Dec 2017 00:56:01 +0100 Subject: [PATCH] initial commit --- .gitignore | 1 + .yamllint | 11 ++ README.md | 103 +++++++++++ defaults/main.yml | 22 +++ meta/main.yml | 15 ++ molecule/default/Dockerfile.j2 | 9 + molecule/default/INSTALL.rst | 16 ++ molecule/default/create.yml | 59 ++++++ molecule/default/destroy.yml | 27 +++ molecule/default/molecule.yml | 32 ++++ molecule/default/playbook.yml | 51 ++++++ molecule/default/prepare.yml | 5 + .../test_default.cpython-27-PYTEST.pyc | Bin 0 -> 2052 bytes molecule/default/tests/test_default.py | 14 ++ molecule/default/tests/test_default.pyc | Bin 0 -> 1021 bytes molecule/no_vars/Dockerfile.j2 | 9 + molecule/no_vars/INSTALL.rst | 16 ++ molecule/no_vars/create.yml | 59 ++++++ molecule/no_vars/destroy.yml | 27 +++ molecule/no_vars/molecule.yml | 28 +++ molecule/no_vars/playbook.yml | 6 + molecule/no_vars/prepare.yml | 5 + .../test_default.cpython-27-PYTEST.pyc | Bin 0 -> 2058 bytes molecule/no_vars/tests/test_default.py | 14 ++ molecule/no_vars/tests/test_default.pyc | Bin 0 -> 1021 bytes tasks/main.yml | 48 +++++ tasks/setup-Debian.yml | 7 + tasks/variables.yml | 32 ++++ templates/config.j2 | 172 ++++++++++++++++++ .../debian/virtualbox/action_provision | 1 + .../debian/virtualbox/action_set_name | 1 + .../machines/debian/virtualbox/creator_uid | 1 + tests/.vagrant/machines/debian/virtualbox/id | 1 + .../machines/debian/virtualbox/index_uuid | 1 + .../machines/debian/virtualbox/private_key | 27 +++ .../machines/debian/virtualbox/synced_folders | 1 + .../xenial/virtualbox/action_provision | 1 + .../xenial/virtualbox/action_set_name | 1 + .../machines/xenial/virtualbox/creator_uid | 1 + tests/.vagrant/machines/xenial/virtualbox/id | 1 + .../machines/xenial/virtualbox/index_uuid | 1 + .../machines/xenial/virtualbox/private_key | 27 +++ .../machines/xenial/virtualbox/synced_folders | 1 + .../inventory/vagrant_ansible_inventory | 8 + tests/Vagrantfile | 30 +++ tests/playbook.yml | 52 ++++++ vars/Debian.yml | 8 + vars/main.yml | 46 +++++ 48 files changed, 998 insertions(+) create mode 100644 .gitignore create mode 100644 .yamllint create mode 100644 README.md create mode 100644 defaults/main.yml create mode 100644 meta/main.yml create mode 100644 molecule/default/Dockerfile.j2 create mode 100644 molecule/default/INSTALL.rst create mode 100644 molecule/default/create.yml create mode 100644 molecule/default/destroy.yml create mode 100644 molecule/default/molecule.yml create mode 100644 molecule/default/playbook.yml create mode 100644 molecule/default/prepare.yml create mode 100644 molecule/default/tests/__pycache__/test_default.cpython-27-PYTEST.pyc create mode 100644 molecule/default/tests/test_default.py create mode 100644 molecule/default/tests/test_default.pyc create mode 100644 molecule/no_vars/Dockerfile.j2 create mode 100644 molecule/no_vars/INSTALL.rst create mode 100644 molecule/no_vars/create.yml create mode 100644 molecule/no_vars/destroy.yml create mode 100644 molecule/no_vars/molecule.yml create mode 100644 molecule/no_vars/playbook.yml create mode 100644 molecule/no_vars/prepare.yml create mode 100644 molecule/no_vars/tests/__pycache__/test_default.cpython-27-PYTEST.pyc create mode 100644 molecule/no_vars/tests/test_default.py create mode 100644 molecule/no_vars/tests/test_default.pyc create mode 100644 tasks/main.yml create mode 100644 tasks/setup-Debian.yml create mode 100644 tasks/variables.yml create mode 100644 templates/config.j2 create mode 100644 tests/.vagrant/machines/debian/virtualbox/action_provision create mode 100644 tests/.vagrant/machines/debian/virtualbox/action_set_name create mode 100644 tests/.vagrant/machines/debian/virtualbox/creator_uid create mode 100644 tests/.vagrant/machines/debian/virtualbox/id create mode 100644 tests/.vagrant/machines/debian/virtualbox/index_uuid create mode 100644 tests/.vagrant/machines/debian/virtualbox/private_key create mode 100644 tests/.vagrant/machines/debian/virtualbox/synced_folders create mode 100644 tests/.vagrant/machines/xenial/virtualbox/action_provision create mode 100644 tests/.vagrant/machines/xenial/virtualbox/action_set_name create mode 100644 tests/.vagrant/machines/xenial/virtualbox/creator_uid create mode 100644 tests/.vagrant/machines/xenial/virtualbox/id create mode 100644 tests/.vagrant/machines/xenial/virtualbox/index_uuid create mode 100644 tests/.vagrant/machines/xenial/virtualbox/private_key create mode 100644 tests/.vagrant/machines/xenial/virtualbox/synced_folders create mode 100644 tests/.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory create mode 100644 tests/Vagrantfile create mode 100644 tests/playbook.yml create mode 100644 vars/Debian.yml create mode 100644 vars/main.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a732325 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.molecule diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..1a3136b --- /dev/null +++ b/.yamllint @@ -0,0 +1,11 @@ +extends: default + +rules: + braces: + max-spaces-inside: 1 + level: error + brackets: + max-spaces-inside: 1 + level: error + line-length: disable + comments-indentation: disable \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f2e7647 --- /dev/null +++ b/README.md @@ -0,0 +1,103 @@ +I3 WM +===== + +Install and a basic configuration of I3 Window Manager +See: https://i3wm.org/ + +Requirements +------------ + +No requirements. + +Role Variables +-------------- + +*additional i3 packages* + + i3_packages_extra: + +*background image* + + i3_desktop_env: + +*i3 workspaces* + +`__i3_workspaces` could be overwritte with `i3_workspaces` + +*i3 keybindings* + +`__i3_keybindings` coud be overwritten with `i3_keybindings` + +*additional i3 keybindings* + + i3_keybindings_extra: [] + +*monitor settings and bindings to i3 workspaces* + + i3_monitors: [] + +*applications bindings to i3 workspaces* + + i3_applications: [] + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: all + vars_files: + - vars/main.yml + roles: + - { role: i3 } + +*`vars/main.yml`* + + i3_desktop_env: + background: "~/wallpaper.jpg" + + i3_packages_extra: + - ranger + + i3_keybindings_extra: + - keybinding: + name: Volume (mute/unmute) + key: $mod+F12 + exec: --no-startup-id amixer sset Master toggle + - keybinding: + name: Volue (default) + key: $mod+Shift+F12 + exec: --no-startup-id amixer sset Master 40% + + i3_monitors: + - monitor: + id: 1 + output: "VGA-1" + mode: "1920x1080" + pos: "0x0" + rotate: "normal" + workspaces: [1,2,3,4,5,6] + - monitor: + id: 2 + output: "HDMI-1" + mode: "1920x1080" + pos: "1920x0" + rotate: "normal" + workspaces: [7,8,9,0] + + i3_applications: + - application: + class: "Firefox" + name: "firefox" + workspace: 1 + on_startup: false + - application: + class: "Code" + name: "code" + workspace: 7 + on_startup: true + +License +------- + +Apache diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..a856c6b --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,22 @@ +--- +i3_keybindings_extra: [] +# - keybinding: +# name: example +# key: $mod+Shift+F10 +# exec: --no-startup-id touch /tmp/example.txt + +i3_monitors: [] # see: xrandr +# - monitor: +# id: 1 +# output: "VGA-1" +# mode: "1920x1080" +# pos: "0x0" +# rotate: "normal" +# workspaces: [1,2,3,4,5,6,7,8,9,0] # bind workspace to a specific monitor + +i3_applications: [] +# - application: +# class: "Firefox" +# name: "firefox" +# workspace: 1 # bind application to a specific workspace +# on_startup: false diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..b683f49 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,15 @@ +--- +galaxy_info: + author: Owe Bretthauer + description: i3wm (https://i3wm.org/) + license: license (Apache) + min_ansible_version: 2.2 + platforms: + - name: Debian + versions: + - stretch + - name: Ubuntu + versions: + - xenial + galaxy_tags: [i3wm] +dependencies: [] diff --git a/molecule/default/Dockerfile.j2 b/molecule/default/Dockerfile.j2 new file mode 100644 index 0000000..f8b4e75 --- /dev/null +++ b/molecule/default/Dockerfile.j2 @@ -0,0 +1,9 @@ +# Molecule managed + +FROM {{ item.image }} + +RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y python sudo bash ca-certificates && apt-get clean; \ + elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python2-dnf bash && dnf clean all; \ + elif [ $(command -v yum) ]; then yum makecache fast && yum update -y && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ + elif [ $(command -v zypper) ]; then zypper refresh && zypper update -y && zypper install -y python sudo bash python-xml && zypper clean -a; \ + elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; fi diff --git a/molecule/default/INSTALL.rst b/molecule/default/INSTALL.rst new file mode 100644 index 0000000..e26493b --- /dev/null +++ b/molecule/default/INSTALL.rst @@ -0,0 +1,16 @@ +******* +Install +******* + +Requirements +============ + +* Docker Engine +* docker-py + +Install +======= + +.. code-block:: bash + + $ sudo pip install docker-py diff --git a/molecule/default/create.yml b/molecule/default/create.yml new file mode 100644 index 0000000..bfb2149 --- /dev/null +++ b/molecule/default/create.yml @@ -0,0 +1,59 @@ +--- +- name: Create + hosts: localhost + connection: local + gather_facts: false + no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}" + vars: + molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}" + molecule_ephemeral_directory: "{{ lookup('env', 'MOLECULE_EPHEMERAL_DIRECTORY') }}" + molecule_scenario_directory: "{{ lookup('env', 'MOLECULE_SCENARIO_DIRECTORY') }}" + molecule_yml: "{{ lookup('file', molecule_file) | molecule_from_yaml }}" + tasks: + - name: Create Dockerfiles from image names + template: + src: "{{ molecule_scenario_directory }}/Dockerfile.j2" + dest: "{{ molecule_ephemeral_directory }}/Dockerfile_{{ item.image | regex_replace('[^a-zA-Z0-9_]', '_') }}" + with_items: "{{ molecule_yml.platforms }}" + register: platforms + + - name: Discover local Docker images + docker_image_facts: + name: "molecule_local/{{ item.item.name }}" + with_items: "{{ platforms.results }}" + register: docker_images + + - name: Build an Ansible compatible image + docker_image: + path: "{{ molecule_ephemeral_directory }}" + name: "molecule_local/{{ item.item.image }}" + dockerfile: "{{ item.item.dockerfile | default(item.invocation.module_args.dest) }}" + force: "{{ item.item.force | default(true) }}" + with_items: "{{ platforms.results }}" + when: platforms.changed or docker_images.results | map(attribute='images') | select('equalto', []) | list | count >= 0 + + - name: Create molecule instance(s) + docker_container: + name: "{{ item.name }}" + hostname: "{{ item.name }}" + image: "molecule_local/{{ item.image }}" + state: started + recreate: false + log_driver: syslog + command: "{{ item.command | default('bash -c \"while true; do sleep 10000; done\"') }}" + privileged: "{{ item.privileged | default(omit) }}" + volumes: "{{ item.volumes | default(omit) }}" + capabilities: "{{ item.capabilities | default(omit) }}" + ports: "{{ item.exposed_ports | default(omit) }}" + register: server + with_items: "{{ molecule_yml.platforms }}" + async: 7200 + poll: 0 + + - name: Wait for instance(s) creation to complete + async_status: + jid: "{{ item.ansible_job_id }}" + register: docker_jobs + until: docker_jobs.finished + retries: 300 + with_items: "{{ server.results }}" diff --git a/molecule/default/destroy.yml b/molecule/default/destroy.yml new file mode 100644 index 0000000..3ce7478 --- /dev/null +++ b/molecule/default/destroy.yml @@ -0,0 +1,27 @@ +--- +- name: Destroy + hosts: localhost + connection: local + gather_facts: false + no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}" + vars: + molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}" + molecule_yml: "{{ lookup('file', molecule_file) | molecule_from_yaml }}" + tasks: + - name: Destroy molecule instance(s) + docker_container: + name: "{{ item.name }}" + state: absent + force_kill: "{{ item.force_kill | default(true) }}" + register: server + with_items: "{{ molecule_yml.platforms }}" + async: 7200 + poll: 0 + + - name: Wait for instance(s) deletion to complete + async_status: + jid: "{{ item.ansible_job_id }}" + register: docker_jobs + until: docker_jobs.finished + retries: 300 + with_items: "{{ server.results }}" diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml new file mode 100644 index 0000000..9aff02e --- /dev/null +++ b/molecule/default/molecule.yml @@ -0,0 +1,32 @@ +--- +dependency: + name: galaxy +driver: + name: docker +lint: + name: yamllint +platforms: + - name: debian_stretch_default + image: debian:stretch +# - name: debian_jessie_default +# image: debian:jessie + - name: ubuntu_xenial_default + image: ubuntu:xenial +# - name: ubuntu_trusty_default +# image: ubuntu:trusty +provisioner: + name: ansible + lint: + name: ansible-lint +scenario: + name: default + test_sequence: + - lint + - syntax + - create + - prepare + - converge +verifier: + name: testinfra + lint: + name: flake8 diff --git a/molecule/default/playbook.yml b/molecule/default/playbook.yml new file mode 100644 index 0000000..4ec227d --- /dev/null +++ b/molecule/default/playbook.yml @@ -0,0 +1,51 @@ +--- +- name: Converge + hosts: all + + vars: + i3_desktop_env: + background: "~/wallpaper.jpg" + + i3_packages_extra: + - ranger + + i3_keybindings_extra: + - keybinding: + name: Volume (mute/unmute) + key: $mod+F12 + exec: --no-startup-id amixer sset Master toggle + - keybinding: + name: Volue (default) + key: $mod+Shift+F12 + exec: --no-startup-id amixer sset Master 40% + + i3_monitors: + - monitor: + id: 1 + output: "VGA-1" + mode: "1920x1080" + pos: "0x0" + rotate: "normal" + workspaces: [1, 2, 3, 4, 5, 6] + - monitor: + id: 2 + output: "HDMI-1" + mode: "1920x1080" + pos: "1920x0" + rotate: "normal" + workspaces: [7, 8, 9, 0] + + i3_applications: + - application: + class: "Firefox" + name: "firefox" + workspace: 1 + on_startup: false + - application: + class: "Code" + name: "code" + workspace: 7 + on_startup: true + + roles: + - role: i3 diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml new file mode 100644 index 0000000..5358b3b --- /dev/null +++ b/molecule/default/prepare.yml @@ -0,0 +1,5 @@ +--- +- name: Prepare + hosts: all + gather_facts: false + tasks: [] diff --git a/molecule/default/tests/__pycache__/test_default.cpython-27-PYTEST.pyc b/molecule/default/tests/__pycache__/test_default.cpython-27-PYTEST.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d788875d87525391a89900fcc89ef1306a6d4e02 GIT binary patch literal 2052 zcmcIkUvCpf5T84r9mjDJ5)hDwqP$dc3iu#EXr;OWAtOZ!Ml#SAznm_v zf#@w!;Lr=$U1kRl8f7>O|H0SM=Rn@Oztg_+Xs7LMcYbeo9^UUh_U>-)v^9hC`C;*d5`JSRG+klH5gP*mmvI4S=$ zY^7k666*(L+F~W_+N=~*XzT2xM0(CBS7~g*g5;S+iOCx~27($R2DR+kH%0h~A#8rR35zB>-JWGs9cY60Cb&}$4G1v^C{k_4j88wg|; z%N*-{9E*b(9H8bP5L5lXW4dS;F|ABvTK!T?uT2oM^uPH(F`fRVn9$`98fVZ(9aY2Z z3f*`2Q>B##N9rd`zEVQ!^&cDA(dLG#{Z$a_EwgoHLp8gayv;qCjl1MPZS<>geah-0pqeZW!dPg&_<6>49ptU-$lD!-u?`buWO3T}W2L#AkZGZ` z=SzJatf%(VQ5<+uWYXJ<(_KII5`QT4yb<~X!4l1BzHN#grb%1MRO-{LFi7Rl*PeKq z#eU*z2o0!Cng~O1;q(e?0zhoM^wVMHOQHFVGc{=N(`B@|%ewri=><$2MPAygGd}ls zZN}&F>nHdR@?3vwCeQhw8!%61Qujciy@$e04~2V}$^(`8ec@&@eBx{2`iTm6W8sF^ z++iAv{s?p+2L344E+=$b3_ZLmBG4bhBN&W4LO$q-(l{uN)G6fej&m zFd0a{InrUQnnkdl93=?~$FOHAreH?Rbi)Z%wtPEJRX0D(ens*ml;{aIv?sKeKO@rw n8PEA%_XlWvsLJ;$O%+~#9i{<__?x-xd|T?YN_87QYpwJirf=1_ literal 0 HcmV?d00001 diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py new file mode 100644 index 0000000..eedd64a --- /dev/null +++ b/molecule/default/tests/test_default.py @@ -0,0 +1,14 @@ +import os + +import testinfra.utils.ansible_runner + +testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( + os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') + + +def test_hosts_file(host): + f = host.file('/etc/hosts') + + assert f.exists + assert f.user == 'root' + assert f.group == 'root' diff --git a/molecule/default/tests/test_default.pyc b/molecule/default/tests/test_default.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2bf46a6e12dcbd714aa4a01b73b4359a7e788896 GIT binary patch literal 1021 zcmdr~%}(4f5FRJtSEYNZDlVLJVRPVGRYfSMRNF;bT2S{AWfN!X;I$)rf{I`-Ef2vP z^?~{T?bz7>rEkzA9*@6_zZrky@Yl|EbbmZ8VD*GFzoTJ4kSXb7AOWTiK7(lhJb*fc zI)Zu)I6%D)WdOTB7}Oh3hCt4A6UqqgXy=xrIE&YaPW+~4jIYW4csfdtK9ADuWPF~E zKb=m#WXC6?6kYmU%7W1xti}<|c0}fuQu&G~!IHr(mXmPTvz<@!}6B*%4v`8VMrUXpugEjK8%N{!LRhqVrI zXPg_|HnA(+K(m*ApF8qw^}S|Q7QJeW5Zvt*$qFIveTokHtNK^P)8 zi7mLwjnK&zH=+`RAh#$~W%A_a=4t4#XUa-pc!AnnFPG0_db&*I3;yr#KFMDcE@4*k zDsLqYn`<1= 0 + + - name: Create molecule instance(s) + docker_container: + name: "{{ item.name }}" + hostname: "{{ item.name }}" + image: "molecule_local/{{ item.image }}" + state: started + recreate: false + log_driver: syslog + command: "{{ item.command | default('bash -c \"while true; do sleep 10000; done\"') }}" + privileged: "{{ item.privileged | default(omit) }}" + volumes: "{{ item.volumes | default(omit) }}" + capabilities: "{{ item.capabilities | default(omit) }}" + ports: "{{ item.exposed_ports | default(omit) }}" + register: server + with_items: "{{ molecule_yml.platforms }}" + async: 7200 + poll: 0 + + - name: Wait for instance(s) creation to complete + async_status: + jid: "{{ item.ansible_job_id }}" + register: docker_jobs + until: docker_jobs.finished + retries: 300 + with_items: "{{ server.results }}" diff --git a/molecule/no_vars/destroy.yml b/molecule/no_vars/destroy.yml new file mode 100644 index 0000000..3ce7478 --- /dev/null +++ b/molecule/no_vars/destroy.yml @@ -0,0 +1,27 @@ +--- +- name: Destroy + hosts: localhost + connection: local + gather_facts: false + no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}" + vars: + molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}" + molecule_yml: "{{ lookup('file', molecule_file) | molecule_from_yaml }}" + tasks: + - name: Destroy molecule instance(s) + docker_container: + name: "{{ item.name }}" + state: absent + force_kill: "{{ item.force_kill | default(true) }}" + register: server + with_items: "{{ molecule_yml.platforms }}" + async: 7200 + poll: 0 + + - name: Wait for instance(s) deletion to complete + async_status: + jid: "{{ item.ansible_job_id }}" + register: docker_jobs + until: docker_jobs.finished + retries: 300 + with_items: "{{ server.results }}" diff --git a/molecule/no_vars/molecule.yml b/molecule/no_vars/molecule.yml new file mode 100644 index 0000000..3d5c500 --- /dev/null +++ b/molecule/no_vars/molecule.yml @@ -0,0 +1,28 @@ +--- +dependency: + name: galaxy +driver: + name: docker +lint: + name: yamllint +platforms: + - name: debian_stretch_empty_vars + image: debian:stretch + - name: ubuntu_xenial_empty_vars + image: ubuntu:xenial +provisioner: + name: ansible + lint: + name: ansible-lint +scenario: + name: no_vars + test_sequence: + - lint + - syntax + - create + - prepare + - converge +verifier: + name: testinfra + lint: + name: flake8 diff --git a/molecule/no_vars/playbook.yml b/molecule/no_vars/playbook.yml new file mode 100644 index 0000000..de57e3c --- /dev/null +++ b/molecule/no_vars/playbook.yml @@ -0,0 +1,6 @@ +--- +- name: Converge + hosts: all + + roles: + - role: i3 diff --git a/molecule/no_vars/prepare.yml b/molecule/no_vars/prepare.yml new file mode 100644 index 0000000..5358b3b --- /dev/null +++ b/molecule/no_vars/prepare.yml @@ -0,0 +1,5 @@ +--- +- name: Prepare + hosts: all + gather_facts: false + tasks: [] diff --git a/molecule/no_vars/tests/__pycache__/test_default.cpython-27-PYTEST.pyc b/molecule/no_vars/tests/__pycache__/test_default.cpython-27-PYTEST.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b5422a4cd2fac1666cda006c7b3148cd2dd5479 GIT binary patch literal 2058 zcmcIkUvC>l5T84r9mjE!rbV=Q0ObYAf#NGIO{s)YtICxk1-Eirpnf@ReCy;c=eyJH zI%!nF3jp8PSE^WSWC|;$o zLLdff6ngX%?5?weN3ANHMStPznad!*eX!TP_hhdd?DoFv_8vdzKMn5h?sW}=6G<`z zV5(!(Fz#XKj!QHpiY;C^m^n0sKM*cWUD7`@1o*xjVe!b=C|(d9)kyD>@hGnH0i0An zShiNOX@&K}D($cmc3oBqYqay>tU_kVD%WXh!-C{Thf^^_YRv}p>U1a5v;D4IwLsoD6+24K>hP9)QYw6Zm1=6&q8l7bQJ6YMMx5eCT}2+ zMJ!9K_i8L2V(@^PgFsBpH^=muTgJ38kLlvOV*1qvu}J^#|0SkN|0*VQ`J>hcXrrEP zVD_aM`iGe|+JGbdDJG${RA%dwR(^VYTQ{DU#8$^{UE9`e`7FYT#>{YUj%=sqr`O8$ zIqkGe%pC zwM10V?+fcSaQY$H>MEexERLc?8ou~N#!VCCo%}S|pG1j?Qf*~PHWZ0ATu#W0 z)Fu$hTmc*C!)%g-fs(lj4w7tNBta_1(kxq{7)h2GPV-$`^e9WaN@dDiVuewr#=->h zS)Pbg7ziz>UY1HraN*1bYXU%Gy$rK)E|fI<#@QOQ`029R++}@!)XWMdj-n{-7Yn}d zcVod9@-NTvFXe^)&O%=BU$tPK?4%!pLVJ&;pPfkmBvVH^7endiDmoTM`XbfQej@$o zhCj{{Ih=r&rEkzA9*@6_zZrky@Yl|EbbmZ8VD*GFzoTJ4kSXb7AOWTiK7(lhJb*fc zI)Zu)I6%D)WdOTB7}Oh3hCt4A6UqqgXy=xrIE&YaPW+~4jIYW4csfdtK9ADuWPF~E zKb=m#WXC6?6kYmU%7W1xti}<|c0}fuQu&G~!IHr(mXmPTvz<@!}6B*%4v`8VMrUXpugEjK8%N{!LRhqVrI zXPg_|HnA(+K(m*ApF8qw^}S|Q7QJeW5Zvt*$qFIveTokHtNK^P)8 zi7mLwjnK&zH=+`RAh#$~W%A_a=4t4#XUa-pc!AnnFPG0_db&*I3;yr#KFMDcE@4*k zDsLqYn`<1 ["debian", "xenial"] + } + ansible.raw_arguments = ["-u vagrant"] + end + +end diff --git a/tests/playbook.yml b/tests/playbook.yml new file mode 100644 index 0000000..6c0b7f8 --- /dev/null +++ b/tests/playbook.yml @@ -0,0 +1,52 @@ +--- +- hosts: all + user: vagrant + + vars: + + desktop_env: + background: "~/Bilder/bg/background.jpg" + + i3_packages_extra: + - ranger + + i3_keybindings_extra: + - keybinding: + name: Volume (mute/unmute) + key: $mod+F12 + exec: --no-startup-id amixer sset Master toggle + - keybinding: + name: Volue (default) + key: $mod+Shift+F12 + exec: --no-startup-id amixer sset Master 40% + + i3_monitors: + - monitor: + id: 1 + output: "VGA-1" + mode: "1920x1080" + pos: "0x0" + rotate: "normal" + workspaces: [1, 2, 3, 4, 5, 6] + - monitor: + id: 2 + output: "HDMI-1" + mode: "1920x1080" + pos: "1920x0" + rotate: "normal" + workspaces: [7, 8, 9, 0] + + i3_applications: + - application: + class: "Firefox" + name: "firefox" + workspace: 1 + on_startup: false + - application: + class: "Code" + name: "code" + workspace: 7 + on_startup: true + + roles: + - i3 diff --git a/vars/Debian.yml b/vars/Debian.yml new file mode 100644 index 0000000..beb69f9 --- /dev/null +++ b/vars/Debian.yml @@ -0,0 +1,8 @@ +--- +__i3_packages: + - i3 + - rxvt-unicode + - rofi + - compton + - feh + - tmux diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..123185a --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,46 @@ +--- +__i3_workspaces: + - workspace: + id: 1 + name: "01: " + - workspace: + id: 2 + name: "02: " + - workspace: + id: 3 + name: "03: " + - workspace: + id: 4 + name: "04: " + - workspace: + id: 5 + name: "05: " + - workspace: + id: 6 + name: "06: " + - workspace: + id: 7 + name: "07: " + - workspace: + id: 8 + name: "08: " + - workspace: + id: 9 + name: "09: " + - workspace: + id: 0 + name: "10: " + +__i3_keybindings: + - keybinding: + name: Volume (-5%) + key: XF86AudioLowerVolume + exec: --no-startup-id amixer sset Master 5%- + - keybinding: + name: Volume (+5%) + key: XF86AudioRaiseVolume + exec: --no-startup-id amixer sset Master 5%+ + - keybinding: + name: Volume (mute/unmute) + key: XF86AudioMute + exec: --no-startup-id amixer sset Master toggle