This repository has been archived on 2021-09-08. You can view files and clone it, but cannot push or open issues/pull-requests.
localdev-playbooks/cloud-tools.yml

112 lines
3.8 KiB
YAML
Raw Normal View History

---
- 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: clone k9s git
ansible.builtin.git:
repo: 'https://github.com/derailed/k9s.git'
dest: "{{ ansible_env.HOME }}/dev/k9s"
- name: build k9s-HEAD
ansible.builtin.shell: "gmake build && install -m 755 ./execs/k9s ~/.local/bin/k9s"
args:
chdir: "{{ ansible_env.HOME }}/dev/k9s"
creates: "{{ ansible_env.HOME }}/.local/bin/k9s"
- name: install stern-HEAD freebsd
when: ansible_facts['system']|lower == 'freebsd'
shell: go get -u github.com/stern/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/stern/stern/releases/latest | jq -r '.assets[] | select(.name | match("stern_.+_linux_amd64.tar.gz";"i")) | .browser_download_url') && chmod 755 ~/.local/bin/stern
args:
warn: False
creates: "{{ ansible_env.HOME }}/.local/bin/stern"
- name: install kubectx-HEAD
command: go get github.com/ahmetb/kubectx/cmd/kubectx
args:
creates: "{{ ansible_env.HOME }}/go/bin/kubectx"
- name: install bash kubectx completions
get_url:
url: https://raw.githubusercontent.com/ahmetb/kubectx/master/completion/kubectx.bash
dest: "{{ ansible_env.HOME }}/.bashrc.d/"
mode: "0640"
- name: install kubens-HEAD
command: go get github.com/ahmetb/kubectx/cmd/kubens
args:
creates: "{{ ansible_env.HOME }}/go/bin/kubens"
- name: install bash kubens completions
get_url:
url: https://raw.githubusercontent.com/ahmetb/kubectx/master/completion/kubens.bash
dest: "{{ ansible_env.HOME }}/.bashrc.d/"
mode: "0640"