diff options
author | binary <me@rgoncalves.se> | 2020-12-27 19:24:27 +0100 |
---|---|---|
committer | binary <me@rgoncalves.se> | 2020-12-27 19:24:27 +0100 |
commit | afcbc020bd78ba7257002846633a580aa5dd55dd (patch) | |
tree | 0980900a98e66bee565def5ea6d3e7d819ade414 /roles/workstation | |
parent | dcae345299f8f0f0dda322bb2849da51890474de (diff) | |
download | infrastructure-afcbc020bd78ba7257002846633a580aa5dd55dd.tar.gz |
Add openbsd workstation init
Diffstat (limited to 'roles/workstation')
-rw-r--r-- | roles/workstation/tasks/main.yml | 87 |
1 files changed, 73 insertions, 14 deletions
diff --git a/roles/workstation/tasks/main.yml b/roles/workstation/tasks/main.yml index f9c2852..41a640c 100644 --- a/roles/workstation/tasks/main.yml +++ b/roles/workstation/tasks/main.yml @@ -1,31 +1,90 @@ # workstation ~~ roles/workstation/tasks/main.yml -# init workstation with packages and dotfiles +# init workstation --- -- name: select correct distribution packages +- name: retrieve BECOME method + stat: path=/usr/bin/doas + register: ws_become + +- name: retrieve host facts set_fact: - packages: "{{ packages[ansible_distribution | lower] }}" + ws_distribution: "{{ ansible_distribution | lower }}" + ansible_become_method: "{{ 'doas' if ws_become.stat.exists else 'sudo' }}" + ansible_become_user: root - name: download development packages - package: name="{{ packages[item] }}" state=present + package: name="{{ item }}" state=present loop: + # DEVEL + - base + - base-devel + - go + # EDITOR + - emacs - neovim - #- qutebrowser - #- vlc - #- feh + - python-neovim + - py3-neovim + # PYTHON + - python-pip + - py3-pip + - python-requests + - py3-requests + - python-jedi + - py3-jedi + # UTILS + - i3 + - i3status + - gnupg + - py3-pip + - python-pip + - zsh + - zip + - unzip + - tar + - git + - curl + - wget + - wireguard + - wireguard-dkms + - wireguard-tools + # PRIVACY + - tor + - tor-browser + - torsocks + # MULTIMEDIA + - qutebrowser + - firefox + - feh + - imv + - mpv + - cmus + - vlc + - syncthing + failed_when: false ignore_errors: true - become: true + tags: packages + +- name: flush fonts cache + shell: fc-cache -fv + +- name: check for distribution specific task + stat: path="{{ role_path }}/tasks/setup_{{ ws_distribution }}.yml" + register: ws_distribution_task + +- debug: + var: ws_distribution_task + +- name: include distribution specific task + include_tasks: "setup_{{ ws_distribution }}.yml" + when: ws_distribution_task.stat.exists -- name: ensure dotfiles local directory exists - file: - path: "{{ workstation_dotfiles_dir }}" - state: directory - mode: 0755 +- 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 }}/dot-config" + dest: "{{ workstation_dotfiles_dir }}/config" bare: true |