with_lines: cat ~/config/ansible/files/dirs_new | sed -e 's/ *#.*$//'
- name: symlink system files
file: state=hard force=yes src={{item}} dest={{item|basename|regex_replace('___','/')}}
- with_fileglob: ~/config/ansible/files/system_new/minimal/*
- with_fileglob: ~/config/ansible/files/system_new/{{ system_name }}/*
+ with_fileglob:
+ - ~/config/ansible/files/system_new/minimal/*
+ - ~/config/ansible/files/system_new/{{ system_name }}/*
- name: set hostname for current session
shell: hostname {{ system_name }}
# Config user.
- name: create user plom with sudo privileges and bash shell
user: name=plom groups=sudo shell=/bin/bash
- - name: have config repo in user directory
- git: repo=https://github.com/plomlompom/config dest=/home/plom/config
- become_user: plom
- become_method: su
+ #- name: have config repo in user directory
+ # git: repo=https://github.com/plomlompom/config dest=/home/plom/config
+ # become_user: plom
+ # become_method: su
# Ensure X window environment.
- name: ensure minimal X window environment
apt: name={{item}} state=present
with_lines: cat ~/config/ansible/files/apt-mark_new/minimal/basic_x_tools | sed -e 's/ *#.*$//'
- # Set up pentadactyl.
+ # Set up qutebrowser.
+ - name: ensure qutebrowser
+ include: tasks/qutebrowser.yml
- name: ensure browser environment
apt: name={{item}} state=present
with_lines: cat ~/config/ansible/files/apt-mark_new/minimal/browser_environment | sed -e 's/ *#.*$//'
--- /dev/null
+---
+
+- name: Set qutebrowser, python3-pypeg2 facts.
+ set_fact:
+ qutebrowser_deb_url: https://github.com/qutebrowser/qutebrowser/releases/download/v0.11.0/qutebrowser_0.11.0-1_all.deb
+ python3pypeg2_deb_url: https://qutebrowser.org/python3-pypeg2_2.15.2-1_all.deb
+ qutebrowser_deb_path: /tmp/qutebrowser.deb
+ python3pypeg2_deb_path: /tmp/python3-pypeg2.deb
+
+
+- name: Check if qutebrowser is installed.
+ command: dpkg-query -W qutebrowser
+ register: qutebrowser_debcheck
+ failed_when: qutebrowser_debcheck.rc > 1
+ changed_when: qutebrowser_debcheck.rc == 1
+
+- name: Check if qutebrowser-dependency python3-pypeg2 is installed.
+ command: dpkg-query -W python3-pypeg2
+ register: python3pypeg2_debcheck
+ failed_when: python3pypeg2_debcheck.rc > 1
+ changed_when: python3pypeg2_debcheck.rc == 1
+ when: qutebrowser_debcheck.rc == 1
+
+- name: Download python3-pypeg2 package.
+ get_url: url={{ python3pypeg2_deb_url }} dest={{ python3pypeg2_deb_path }}
+ when: qutebrowser_debcheck.rc == 1 and python3pypeg2_debcheck.rc == 1
+
+- name: Download qutebrowser package.
+ get_url: url={{ qutebrowser_deb_url }} dest={{ qutebrowser_deb_path }}
+ when: qutebrowser_debcheck.rc == 1
+
+# We use command: apt as a workaround because the Ansible apt module installs
+# the Depends of the .deb marked as manual while we want them marked as auto.
+- name: Install python3-pypeg2 package,
+ command: apt install --yes "{{ python3pypeg2_deb_path}}"
+ when: qutebrowser_debcheck.rc == 1 and python3pypeg2_debcheck.rc == 1
+
+- name: Mark python3-pypeg2 package as automatically installed.
+ command: apt-mark auto python3-pypeg2
+ when: qutebrowser_debcheck.rc == 1 and python3pypeg2_debcheck.rc == 1
+
+# We use command: apt as a workaround because the Ansible apt module installs
+# the Depends of the .deb marked as manual while we want them marked as auto.
+- name: Install qutebrowser package.
+ command: apt install --yes "{{ qutebrowser_deb_path}}"
+ when: qutebrowser_debcheck.rc == 1