aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2021-02-27 10:31:04 +0100
committerbinary <me@rgoncalves.se>2021-02-27 10:31:04 +0100
commit637d9584c27edd835c24f30eed4ab7d8b4189925 (patch)
tree474c4d65daec4287be2c6c6c575e277de4a44a10
parent5acdc00aaf6c65c1353cc02a59f33e0d6ba9a281 (diff)
downloadinfrastructure-637d9584c27edd835c24f30eed4ab7d8b4189925.tar.gz
Add task for setting weechat-matrix on workstation
-rw-r--r--playbooks/workstation.yml4
-rw-r--r--roles/_workstation/weechat-matrix/tasks/main.yml42
-rw-r--r--roles/_workstation/weechat-matrix/vars/main.yml7
3 files changed, 52 insertions, 1 deletions
diff --git a/playbooks/workstation.yml b/playbooks/workstation.yml
index e99963a..4911ade 100644
--- a/playbooks/workstation.yml
+++ b/playbooks/workstation.yml
@@ -10,5 +10,7 @@
msg: Run as root for full compatiblity
roles:
- { role: sshdns, tags: role_sshdns }
- - { role: workstation, tags: role_workstation }
+ - { role: _workstation/packages, tags: role_workstation_packages }
+ - { role: _workstation/weechat-matrix, tags: role_workstation_weechat }
+ - { role: _workstation/sysconf, tags: role_workstation_sysconf }
- { role: update, tags: role_update}
diff --git a/roles/_workstation/weechat-matrix/tasks/main.yml b/roles/_workstation/weechat-matrix/tasks/main.yml
new file mode 100644
index 0000000..4d86244
--- /dev/null
+++ b/roles/_workstation/weechat-matrix/tasks/main.yml
@@ -0,0 +1,42 @@
+
+# workstation/weechat-matrix ~~ roles/_workstation/weechat-matrix/tasks/main.yml
+# build weechat_matrix from source
+
+---
+
+- name: ensure weechat-matrix repository is latest
+ git:
+ repo: "{{ weechat_matrix_repo }}"
+ dest: "{{ weechat_matrix_local }}"
+
+- name: retrieve latest local pip version
+ shell: find /usr/bin /usr/local/bin -name "pip*" | sort -rV | head -n 1
+ register: pip_path
+
+- name: install more-itertools for user
+ pip:
+ name: more-itertools
+ extra_args: --user
+ executable: "{{ pip_path.stdout }}"
+
+- name: install weechat-matrix pip requirements
+ pip:
+ chdir: "{{ weechat_matrix_local }}"
+ requirements: requirements.txt
+ extra_args: --user
+ executable: "{{ pip_path.stdout }}"
+ environment:
+ PYTHONPATH: /usr/local/lib/python3.8/site-packages:$HOME/.local/bin
+ C_INCLUDE_PATH: $C_INCLUDE_PATH:/usr/local/include
+
+- name: ensure matrix plugin directory is copied to weechat directory
+ copy:
+ src: "{{ weechat_matrix_local }}/matrix"
+ dest: ~/.weechat/python
+ mode: preserve
+
+- name: ensure matrix plugin is copied to weechat directory
+ copy:
+ src: "{{ weechat_matrix_local }}/main.py"
+ dest: ~/.weechat/python/matrix.py
+ mode: preserve
diff --git a/roles/_workstation/weechat-matrix/vars/main.yml b/roles/_workstation/weechat-matrix/vars/main.yml
new file mode 100644
index 0000000..93fd937
--- /dev/null
+++ b/roles/_workstation/weechat-matrix/vars/main.yml
@@ -0,0 +1,7 @@
+
+# workstation/weechat-matrix ~~ roles/_workstation/weechat-matrix/tasks/main.yml
+
+---
+
+weechat_matrix_repo: https://github.com/poljar/weechat-matrix
+weechat_matrix_local: ~/git/weechat-matrix
remember that computers suck.