mirror of
https://github.com/fscotto/infra.git
synced 2026-05-30 15:39:58 +00:00
Add Ubuntu common CLI tools
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
---
|
||||
ubuntu_packages_base:
|
||||
- curl
|
||||
- htop
|
||||
- fastfetch
|
||||
- build-essential
|
||||
- nodejs
|
||||
- git-delta
|
||||
- jq
|
||||
|
||||
ubuntu_manage_docker_repo: true
|
||||
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
---
|
||||
profile_packages:
|
||||
- htop
|
||||
- fastfetch
|
||||
- build-essential
|
||||
- nodejs
|
||||
- git-delta
|
||||
- meld
|
||||
- gufw
|
||||
- libreoffice
|
||||
|
||||
@@ -94,6 +94,98 @@
|
||||
}}
|
||||
state: present
|
||||
|
||||
- name: Set Ubuntu external tool release metadata
|
||||
tags: [packages]
|
||||
ansible.builtin.set_fact:
|
||||
ubuntu_tools_tmp_dir: /tmp/ubuntu-tools
|
||||
gitmux_version: v0.11.5
|
||||
bw_version: 1.22.1
|
||||
gitmux_arch: >-
|
||||
{{
|
||||
'amd64' if ansible_facts['architecture'] == 'x86_64'
|
||||
else 'arm64' if ansible_facts['architecture'] in ['aarch64', 'arm64']
|
||||
else ''
|
||||
}}
|
||||
|
||||
- name: Ensure architecture is supported for gitmux binary
|
||||
tags: [packages]
|
||||
ansible.builtin.fail:
|
||||
msg: "Unsupported architecture {{ ansible_facts['architecture'] }} for gitmux release binary"
|
||||
when: gitmux_arch == ''
|
||||
|
||||
- name: Ensure architecture is supported for bw binary
|
||||
tags: [packages]
|
||||
ansible.builtin.fail:
|
||||
msg: "Unsupported architecture {{ ansible_facts['architecture'] }} for bw release binary"
|
||||
when: ansible_facts['architecture'] != 'x86_64'
|
||||
|
||||
- name: Ensure temporary directory exists for Ubuntu external tools
|
||||
tags: [packages]
|
||||
ansible.builtin.file:
|
||||
path: "{{ ubuntu_tools_tmp_dir }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Set gitmux asset metadata
|
||||
tags: [packages]
|
||||
ansible.builtin.set_fact:
|
||||
gitmux_asset: "gitmux_{{ gitmux_version }}_linux_{{ gitmux_arch }}.tar.gz"
|
||||
|
||||
- name: Download gitmux release archive
|
||||
tags: [packages]
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/arl/gitmux/releases/download/{{ gitmux_version }}/{{ gitmux_asset }}"
|
||||
dest: "{{ ubuntu_tools_tmp_dir }}/{{ gitmux_asset }}"
|
||||
checksum: "sha256:https://github.com/arl/gitmux/releases/download/{{ gitmux_version }}/checksums.txt"
|
||||
mode: "0644"
|
||||
|
||||
- name: Extract gitmux release archive
|
||||
tags: [packages]
|
||||
ansible.builtin.unarchive:
|
||||
src: "{{ ubuntu_tools_tmp_dir }}/{{ gitmux_asset }}"
|
||||
dest: "{{ ubuntu_tools_tmp_dir }}"
|
||||
remote_src: true
|
||||
|
||||
- name: Install gitmux binary
|
||||
tags: [packages]
|
||||
ansible.builtin.copy:
|
||||
src: "{{ ubuntu_tools_tmp_dir }}/gitmux"
|
||||
dest: /usr/local/bin/gitmux
|
||||
remote_src: true
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
|
||||
- name: Set bw asset metadata
|
||||
tags: [packages]
|
||||
ansible.builtin.set_fact:
|
||||
bw_asset: "bw-linux-{{ bw_version }}.zip"
|
||||
|
||||
- name: Download bw release archive
|
||||
tags: [packages]
|
||||
ansible.builtin.get_url:
|
||||
url: "https://github.com/bitwarden/cli/releases/download/v{{ bw_version }}/{{ bw_asset }}"
|
||||
dest: "{{ ubuntu_tools_tmp_dir }}/{{ bw_asset }}"
|
||||
checksum: "sha256:https://github.com/bitwarden/cli/releases/download/v{{ bw_version }}/bw-linux-sha256-{{ bw_version }}.txt"
|
||||
mode: "0644"
|
||||
|
||||
- name: Extract bw release archive
|
||||
tags: [packages]
|
||||
ansible.builtin.unarchive:
|
||||
src: "{{ ubuntu_tools_tmp_dir }}/{{ bw_asset }}"
|
||||
dest: "{{ ubuntu_tools_tmp_dir }}"
|
||||
remote_src: true
|
||||
|
||||
- name: Install bw binary
|
||||
tags: [packages]
|
||||
ansible.builtin.copy:
|
||||
src: "{{ ubuntu_tools_tmp_dir }}/bw"
|
||||
dest: /usr/local/bin/bw
|
||||
remote_src: true
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
|
||||
- name: Add user to docker group
|
||||
tags: [packages]
|
||||
ansible.builtin.user:
|
||||
|
||||
Reference in New Issue
Block a user