--- - 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 -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/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" - 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"