add go tasks, cloud tools tasks, chezmoi tasks, and bw-cli tasks

main
Andrew Coleman 2021-04-16 14:50:30 -04:00
parent 5642995139
commit ce2737c5e3
7 changed files with 154 additions and 2 deletions

8
bitwarden.yml Normal file
View File

@ -0,0 +1,8 @@
---
- name: install bw-cli
become: yes
become_user: root
become_method: sudo
command: npm install -g @bitwarden/cli
args:
creates: /usr/local/bin/bw

5
chezmoi.yml Normal file
View File

@ -0,0 +1,5 @@
---
- name: install chezmoi
shell: mkdir -p ~/.local/bin && sh -c "$(curl -fsLS git.io/chezmoi)" && mv ~/bin/chezmoi ~/.local/bin/
args:
creates: "{{ ansible_env.HOME }}/.local/bin/chezmoi"

93
cloud-tools.yml Normal file
View File

@ -0,0 +1,93 @@
---
- name: create bin directory
command: mkdir -p ~/.local/bin
args:
creates: "{{ ansible_env.HOME }}/.local/bin/"
- name: install sops freebsd
become: yes
become_user: root
become_method: sudo
when: ansible_facts['system']|lower == 'freebsd'
community.general.pkgng:
name: sops
state: present
- name: install sops linux
command: curl -Lo ~/.local/bin/sops https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux
when: ansible_facts['system']|lower == 'linux'
args:
creates: "{{ ansible_env.HOME }}/.local/bin/sops"
- name: install helm freebsd
become: yes
become_user: root
become_method: sudo
when: ansible_facts['system']|lower == 'freebsd'
community.general.pkgng:
name: helm
state: present
- name: install latest helm linux
shell: cd /tmp && curl -Lo helm.tar.gz https://get.helm.sh/helm-$(curl -L https://api.github.com/repos/helm/helm/releases/latest | jq -r '.tag_name')-linux-amd64.tar.gz && tar xvzf helm.tar.gz && install -m 755 linux-amd64/helm ~/.local/bin/helm && rm -rf helm.tar.gz linux-amd64
args:
warn: False
creates: "{{ ansible_env.HOME }}/.local/bin/helm"
- name: install kubectl freebsd
become: yes
become_user: root
become_method: sudo
when: ansible_facts['system']|lower == 'freebsd'
community.general.pkgng:
name: kubectl
state: present
- name: install latest kubectl linux
shell: curl -Lo ~/.local/bin/kubectl "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && chmod 755 ~/.local/bin/kubectl
args:
warn: False
creates: "{{ ansible_env.HOME }}/.local/bin/kubectl"
- name: install kops freebsd
become: yes
become_user: root
become_method: sudo
when: ansible_facts['system']|lower == 'freebsd'
community.general.pkgng:
name: kops
state: present
- name: install latest kops linux
shell: curl -Lo ~/.local/bin/kops $(curl -L https://api.github.com/repos/kubernetes/kops/releases/latest | jq -r '.assets[] | select(.name == "kops-linux-amd64") | .browser_download_url') && chmod 755 ~/.local/bin/kops
args:
warn: False
creates: "{{ ansible_env.HOME }}/.local/bin/kops"
- name: install k9s-HEAD freebsd
when: ansible_facts['system']|lower == 'freebsd'
shell: cd ~/dev && git clone https://github.com/derailed/k9s.git k9s && cd k9s && gmake build && install -m 755 ./execs/k9s ~/.local/bin/k9s && cd .. && rm -rf k9s
args:
warn: False
creates: "{{ ansible_env.HOME }}/.local/bin/k9s"
- name: install newest k9s linux
when: ansible_facts['system']|lower == 'linux'
shell: curl -Lo ~/.local/bin/k9s $(curl -L https://api.github.com/repos/derailed/k9s/releases/latest | jq -r '.assets[] | select(.name == "k9s_Linux_x86_64.tar.gz") | .browser_download_url') && chmod 755 ~/.local/bin/k9s
args:
warn: False
creates: "{{ ansible_env.HOME }}/.local/bin/k9s"
- name: install stern-HEAD freebsd
when: ansible_facts['system']|lower == 'freebsd'
shell: go get github.com/wercker/stern && go build github.com/wercker/stern && go install github.com/wercker/stern
args:
creates: "{{ ansible_env.HOME }}/go/bin/stern"
- name: install newest stern linux
when: ansible_facts['system']|lower == 'linux'
shell: curl -Lo ~/.local/bin/stern $(curl -L https://api.github.com/repos/wercker/stern/releases/latest | jq -r '.assets[] | select(.name == "stern_linux_amd64") | .browser_download_url') && chmod 755 ~/.local/bin/stern
args:
warn: False
creates: "{{ ansible_env.HOME }}/.local/bin/stern"

View File

@ -4,5 +4,5 @@
become_user: root become_user: root
become_method: sudo become_method: sudo
dnf: dnf:
name: jq,vim,emacs,curl,htop,tmux,git,sqlite,sqlite-devel,make,automake,gcc,gcc-c++,kernel-devel,llvm,cmake,awscli,skopeo,ShellCheck,libtool,alien,fakeroot,openssl-devel,zlib-devel,flex,bison,uuid-devel,libtirpc-devel,libaio-devel,elfutils-libelf-devel,libffi-devel,libudev-devel,libblkid-devel,libuuid-devel,podman,libvirt-daemon-kvm,qemu-kvm,most,fzf,nodejs,npm,golang,llvm10,clang name: jq,vim,emacs,curl,htop,tmux,git,sqlite,sqlite-devel,make,automake,gcc,gcc-c++,kernel-devel,llvm,cmake,awscli,skopeo,ShellCheck,libtool,alien,fakeroot,openssl-devel,zlib-devel,flex,bison,uuid-devel,libtirpc-devel,libaio-devel,elfutils-libelf-devel,libffi-devel,libudev-devel,libblkid-devel,libuuid-devel,podman,libvirt-daemon-kvm,qemu-kvm,most,fzf,nodejs,npm,llvm10,clang
state: present state: present

34
go.yml Normal file
View File

@ -0,0 +1,34 @@
---
- name: install go freebsd
become: yes
become_user: root
become_method: sudo
when: ansible_facts['system']|lower == 'freebsd'
community.general.pkgng:
name: go
state: present
- name: install golang fedora
become: yes
become_user: root
become_method: sudo
when: ansible_facts['os_family']|lower == 'fedora'
dnf:
name: golang
state: present
- name: configure GOPATH / GOBIN
file:
state: directory
path: "{{ ansible_env.HOME }}/go/bin"
mode: "0700"
- name: install judo
command: go get github.com/rollcat/judo
args:
creates: "{{ ansible_env.HOME }}/go/bin/judo"
- name: install shfmt
shell: GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
args:
creates: "{{ ansible_env.HOME }}/go/bin/shfmt"

View File

@ -24,3 +24,15 @@
- name: Configure gnome settings - name: Configure gnome settings
import_tasks: gnome.yml import_tasks: gnome.yml
- name: Install bitwarden cli
import_tasks: bitwarden.yml
- name: Install chezmoi
import_tasks: chezmoi.yml
- name: Install and configure golang
import_tasks: go.yml
- name: Install cloud tools
import_tasks: cloud-tools.yml

View File

@ -4,7 +4,7 @@
become_user: root become_user: root
become_method: sudo become_method: sudo
community.general.pkgng: community.general.pkgng:
name: libtool,autogen,libuv,gettext,autoconf,automake,gmake,coreutils,bash,tmux,git,most,node,npm,go,cmake,llvm10 name: libtool,autogen,libuv,gettext,autoconf,automake,gmake,coreutils,bash,tmux,git,most,node,npm,cmake,llvm10
state: present state: present
- name: install desktop pkg applications - name: install desktop pkg applications