aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--playbooks/workstation.yml28
-rw-r--r--roles/_workstation/env/tasks/main.yml24
-rw-r--r--roles/_workstation/sysconf/meta/main.yml8
-rw-r--r--roles/_workstation/sysconf/tasks/main.yml21
-rw-r--r--roles/_workstation/weechat-matrix/meta/main.yml8
-rw-r--r--roles/_workstation/weechat-matrix/tasks/main.yml8
6 files changed, 72 insertions, 25 deletions
diff --git a/playbooks/workstation.yml b/playbooks/workstation.yml
index 4911ade..b91c314 100644
--- a/playbooks/workstation.yml
+++ b/playbooks/workstation.yml
@@ -7,10 +7,26 @@
- hosts: localhost
tasks:
- debug:
- msg: Run as root for full compatiblity
+ msg: RUN AS ROOT
+
roles:
- - { role: sshdns, tags: role_sshdns }
- - { 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}
+
+ - role: sshdns
+ tags: role_sshdns
+
+ - role: _workstation/env
+ tags: role_workstation_env
+
+ - role: _workstation/packages
+ tags: role_workstation_packages
+
+ - role: _workstation/sysconf
+ tags: role_workstation_sysconf
+
+ #- role: _workstation/weechat-matrix
+ #tags: role_workstation_weechat
+ #become: true
+ #become_method: su
+
+ - role: update
+ tags: role_update
diff --git a/roles/_workstation/env/tasks/main.yml b/roles/_workstation/env/tasks/main.yml
new file mode 100644
index 0000000..35342df
--- /dev/null
+++ b/roles/_workstation/env/tasks/main.yml
@@ -0,0 +1,24 @@
+
+# _workstation/env ~~ roles/_workstation/env/tasks/main.yml
+# useful env. variables for workstation
+
+---
+
+- name: retrieve BECOME method
+ stat: path=/usr/bin/doas
+ register: _workstation_env_become
+
+- name: retrieve original user
+ shell: logname
+ register: _workstation_env_user
+
+- name: register username original user
+ set_fact:
+ _workstation_env_user: "{{ _workstation_env_user.stdout }}"
+
+- name: retrieve host facts
+ set_fact:
+ #ansible_become_method: "{{ 'doas' if _workstation_env_become.stat.exists else 'sudo' }}"
+ ansible_become_method: "su"
+ ansible_become_user: "{{ _workstation_env_user }}"
+
diff --git a/roles/_workstation/sysconf/meta/main.yml b/roles/_workstation/sysconf/meta/main.yml
new file mode 100644
index 0000000..bece799
--- /dev/null
+++ b/roles/_workstation/sysconf/meta/main.yml
@@ -0,0 +1,8 @@
+
+# _workstation/sysconf ~~ roles/_workstation/sysconf/meta/main.yml
+# Meta parameters
+
+---
+
+dependencies:
+ - { role: _workstation/env, tags: "dependency" }
diff --git a/roles/_workstation/sysconf/tasks/main.yml b/roles/_workstation/sysconf/tasks/main.yml
index 2a6f4a4..0f37962 100644
--- a/roles/_workstation/sysconf/tasks/main.yml
+++ b/roles/_workstation/sysconf/tasks/main.yml
@@ -4,20 +4,6 @@
---
-- name: retrieve BECOME method
- stat: path=/usr/bin/doas
- register: ws_become
-
-- name: retrieve original user
- shell: logname
- register: ws_user
-
-- name: retrieve host facts
- set_fact:
- ansible_become_method: "{{ 'doas' if ws_become.stat.exists else 'sudo' }}"
- ansible_become_user: root
- ws_user: "{{ ws_user.stdout }}"
-
- name: include distribution specific task
include_tasks: "_{{ ansible_distribution | lower }}.yml"
ignore_errors: true
@@ -25,8 +11,8 @@
- name: generate doas configuration
lineinfile:
path: /etc/doas.conf
- regexp: "^permit persist keepenv {{ ws_user }} as root"
- line: "permit persist keepenv {{ ws_user }} as root"
+ regexp: "^permit persist keepenv {{ _workstation_env_user }} as root"
+ line: "permit persist keepenv {{ _workstation_env_user }} as root"
owner: root
mode: 0644
create: true
@@ -49,6 +35,3 @@
when: sudo.rc == 0
register: sudo
ignore_errors: true
-
-- name: setup dotfiles from upstream and user script
- meta: end_host
diff --git a/roles/_workstation/weechat-matrix/meta/main.yml b/roles/_workstation/weechat-matrix/meta/main.yml
new file mode 100644
index 0000000..d48bb71
--- /dev/null
+++ b/roles/_workstation/weechat-matrix/meta/main.yml
@@ -0,0 +1,8 @@
+
+# _workstation/weechat-matrix ~~ roles/_workstation/weechat-matrix/meta/main.yml
+# Meta parameters
+
+---
+
+dependencies:
+ - { role: _workstation/env, tags: "dependency" }
diff --git a/roles/_workstation/weechat-matrix/tasks/main.yml b/roles/_workstation/weechat-matrix/tasks/main.yml
index 4d86244..6227b35 100644
--- a/roles/_workstation/weechat-matrix/tasks/main.yml
+++ b/roles/_workstation/weechat-matrix/tasks/main.yml
@@ -4,6 +4,12 @@
---
+- shell: whoami && ls ~
+ register: out
+
+- debug:
+ var: out
+
- name: ensure weechat-matrix repository is latest
git:
repo: "{{ weechat_matrix_repo }}"
@@ -34,9 +40,11 @@
src: "{{ weechat_matrix_local }}/matrix"
dest: ~/.weechat/python
mode: preserve
+ remote_src: true
- name: ensure matrix plugin is copied to weechat directory
copy:
src: "{{ weechat_matrix_local }}/main.py"
dest: ~/.weechat/python/matrix.py
mode: preserve
+ remote_src: true
remember that computers suck.