aboutsummaryrefslogtreecommitdiffstats
path: root/roles/workstation/tasks/main.yml
blob: 6aa3322faad1d7579967789848d9cab7c03fc1fe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

# workstation ~~ roles/workstation/tasks/main.yml
# init workstation

---

- name: retrieve BECOME method
  stat: path=/usr/bin/doas 
  register: ws_become

- name: retrieve host facts
  set_fact:
    ws_distribution: "{{ ansible_distribution | lower }}"
    ansible_become_method: "{{ 'doas' if ws_become.stat.exists else 'sudo' }}"
    ansible_become_user: root

- name: download packages
  include_tasks: packages.yml
  tags: packages

- name: check for distribution specific task
  stat: path="{{ role_path }}/tasks/setup_{{ ws_distribution }}.yml"
  register: ws_distribution_task

- name: include distribution specific task
  include_tasks: "setup_{{ ws_distribution }}.yml"
  when: ws_distribution_task.stat.exists

- name: gracefully stop playbook and skip testing tasks
  meta: end_host

- name: download dotfiles configuration repository
  git: 
    repo: "{{ workstation_git_root }}/dot-config"
    dest: "{{ workstation_dotfiles_dir }}/config"
    bare: true
remember that computers suck.