aboutsummaryrefslogtreecommitdiffstats
path: root/roles/_workstation/sysconf
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2021-03-01 15:46:23 +0100
committerbinary <me@rgoncalves.se>2021-03-01 15:46:23 +0100
commita29fa5af783977e298777d5a870fc4191466371a (patch)
treef8e9bf5ae86170b441dffde43caa7430efe72575 /roles/_workstation/sysconf
parent637d9584c27edd835c24f30eed4ab7d8b4189925 (diff)
downloadinfrastructure-a29fa5af783977e298777d5a870fc4191466371a.tar.gz
Add env role and meta tasks for workstation playbook
Diffstat (limited to 'roles/_workstation/sysconf')
-rw-r--r--roles/_workstation/sysconf/meta/main.yml8
-rw-r--r--roles/_workstation/sysconf/tasks/main.yml21
2 files changed, 10 insertions, 19 deletions
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
remember that computers suck.