Skip to content

torrentalle/kubectl-ansible-role

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubectl-ansible-role

Build Status Ansible Galaxy

This role installs kubectl binary in all UNIX systems

Requirements

Ansible 2.2 or higher

Installation

Create or add to your roles dependency file (e.g requirements.yml):

- src: torrentalle.kubectl

Install the role with ansible-galaxy command:

ansible-galaxy install -p roles -r requirements.yml -f

Usage

    - hosts: bastion
      roles:
         - { role: kubectl }

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

kubectl_release: 'latest'
kubectl_install_path: /usr/local/bin

You can change the installation sources modifying following variables (see vars/main.yml):

kubectl_latest_info_url: https://storage.googleapis.com/kubernetes-release/release/stable.txt
kubectl_download_url: "https://storage.googleapis.com/kubernetes-release/release/{{ kubectl_release }}/bin/{{ ansible_system | lower }}/amd64/kubectl"
kubectl_sha1_url: "{{ kubectl_download_url }}.sha1"

Testing

Ansible Ansible Ansible Ansible Ansible Ansible

Tox, Docker, Molecule and Goss are used tot test this role. You must install docker and tox before launch tests

sudo apt install docker-ce
sudo pip install tox

Run tests launching tox command

tox

License

BSD

Author