home · contact · privacy
Replace pentadactyl with qutebrowser in new Ansible setup.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 11 Sep 2017 20:10:17 +0000 (22:10 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 11 Sep 2017 20:10:17 +0000 (22:10 +0200)
ansible/config_new.yml
ansible/files/apt-mark_new/W530/browser_environment [new file with mode: 0644]
ansible/files/apt-mark_new/minimal/browser_environment
ansible/tasks/qutebrowser.yml [new file with mode: 0644]

index 1921cbe77871f67197b659969bb3acef9a173cbf..8153fc9199e206f4e870386070a1b6329e88529d 100644 (file)
@@ -9,8 +9,9 @@
     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
@@ -86,7 +87,9 @@
     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/ *#.*$//'
diff --git a/ansible/files/apt-mark_new/W530/browser_environment b/ansible/files/apt-mark_new/W530/browser_environment
new file mode 100644 (file)
index 0000000..cc9575c
--- /dev/null
@@ -0,0 +1,4 @@
+iceweasel
+vim-gtk  # used by pentadactyl for text editing
+xul-ext-noscript
+xul-ext-pentadactyl
index cc9575c1baa2c6887f263c573f52e587ea826d76..bbc220aeb2f1a8258ee74ef4dc9c68d9dfeb30d6 100644 (file)
@@ -1,4 +1 @@
-iceweasel
-vim-gtk  # used by pentadactyl for text editing
-xul-ext-noscript
-xul-ext-pentadactyl
+qutebrowser
diff --git a/ansible/tasks/qutebrowser.yml b/ansible/tasks/qutebrowser.yml
new file mode 100644 (file)
index 0000000..fdd4af2
--- /dev/null
@@ -0,0 +1,46 @@
+---
+
+- 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