This file contains hidden or 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
| require 'yaml' | |
| require 'base64' | |
| kube_path = File.join(ENV['HOME'], '.kube') | |
| file_config = File.read File.join(kube_path, 'config') | |
| config = YAML.load file_config | |
| ca = Base64.decode64 config["clusters"][0]["cluster"]["certificate-authority-data"] | |
| File.open(File.join(kube_path, 'ca.crt'), File::CREAT|File::TRUNC|File::RDWR, 0644) do |f| | |
| f.write(ca) |
This file contains hidden or 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
| #!/usr/bin/python3 | |
| import logging, sys | |
| logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) | |
| from collections import namedtuple | |
| from ansible.parsing.dataloader import DataLoader | |
| from ansible.vars import VariableManager | |
| from ansible.inventory import Inventory | |
| from ansible.playbook.play import Play |