Last active
August 11, 2016 20:54
-
-
Save nicusX/1b92aa354e054ed566f3b9118a536c82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Expects `kubernetes_api_endpoint` as `--extra-vars "kubernetes_api_endpoint=xxxx"` | |
- hosts: 127.0.0.1 | |
connection: local | |
tasks: | |
- name: Set kubectl endpoint | |
shell: "kubectl config set-cluster {{ cluster_name }} --certificate-authority={{ playbook_dir }}/../cert/ca.pem --embed-certs=true --server=https://{{ kubernetes_api_endpoint }}:6443" | |
- name: Set kubectl credentials | |
shell: "kubectl config set-credentials {{ user }} --token {{ token }}" | |
- name: Set kubectl default context | |
shell: "kubectl config set-context default-context --cluster={{ cluster_name }} --user={{ user }}" | |
- name: Switch kubectl to default context | |
shell: "kubectl config use-context default-context" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment