# workstation ~~ roles/workstation/tasks/main.yml # init workstation --- - 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.results.stdout - name: include distribution specific task include_tasks: "_{{ ansible_distribution | lower }}.yml" ignore_errors: true - name: setup dotfiles from upstream and user script meta: end_host