aboutsummaryrefslogblamecommitdiffstats
path: root/roles/_workstation/env/tasks/main.yml
blob: 35342df9b172519ee337fb99c0df050e1d391256 (plain) (tree)























                                                                                             

# _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 }}"

remember that computers suck.