From 680d88cdd468e7bed9a46f2550cac0e59f835cfa Mon Sep 17 00:00:00 2001 From: binary Date: Wed, 18 Nov 2020 09:41:20 +0100 Subject: Refactor package installation in tools role --- roles/tools/tasks/main.yml | 39 +++++++++++++++++++++++++++++++++++++++ roles/tools/vars/main.yml | 23 +++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 roles/tools/tasks/main.yml create mode 100644 roles/tools/vars/main.yml diff --git a/roles/tools/tasks/main.yml b/roles/tools/tasks/main.yml new file mode 100644 index 0000000..0abd228 --- /dev/null +++ b/roles/tools/tasks/main.yml @@ -0,0 +1,39 @@ + +# tools ~~ roles/tools/tasks/main.yml +# see : https://gitlab.archlinux.org/archlinux/infrastructure/-/blob/master/roles/tools/tasks/main.yml + +--- + +- set_fact: + packages: "{{ packages[os_distribution] }}" + +- name: install sysadmin tools + package: state=present name="{{ item }}" + loop: + - tmux + - htop + #failed_when: false + ignore_errors: true + +- name: install per distribution correspond tools + package: state=present name="{{ item }}" + loop: + - "{{ packages.sshfs }}" + - "{{ packages.wireguard }}" + ignore_errors: true + +- name: install misc utils + package: state=present name="{{ item }}" + loop: + - zsh + - neovim + - wget + - curl + - git + #failed_when: false + ignore_errors: true + +- name: install scripts repository + git: + repo: "https://gitlab.com/rgoncalves.se/infrastructure/infrastructure-scripts" + dest: /data/scripts diff --git a/roles/tools/vars/main.yml b/roles/tools/vars/main.yml new file mode 100644 index 0000000..80fd1a0 --- /dev/null +++ b/roles/tools/vars/main.yml @@ -0,0 +1,23 @@ + +# tools ~~ roles/tools/vars/main.yml + +--- + +packages: + + alpine: + sshfs: "sshfs" + wireguard: "wireguard" + + debian: + sshfs: "sshfs" + wireguard: "wireguard" + + freebsd: + sshfs: "fusefs-sshfs" + wireguard: "wireguard" + + openbsd: + sshfs: "sshfs-fuse" + wireguard: "wireguard-tools" + -- cgit v1.2.3