From a29fa5af783977e298777d5a870fc4191466371a Mon Sep 17 00:00:00 2001 From: binary Date: Mon, 1 Mar 2021 15:46:23 +0100 Subject: Add env role and meta tasks for workstation playbook --- roles/_workstation/sysconf/tasks/main.yml | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'roles/_workstation/sysconf/tasks') 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 -- cgit v1.2.3