You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 

48 lines
1.1 KiB

---
- hosts: k8s
- name: Disable all swaps from /proc/swaps
shell: |
swapoff --all
- name: Disable SWAP in fstab
lineinfile:
path: /etc/fstab
regexp: 'swap'
state: absent
- name: Add Google GPG key
apt_key:
url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
state: present
- name: Add Kubernetes' APT repository
apt_repository:
repo: deb http://apt.kubernetes.io/ kubernetes-xenial main
state: present
filename: 'kubernetes'
mode: 0600
- name: Installing Kubernetes Cluster Packages
apt:
name: "{{ item }}"
state: present
cache_valid_time: "{{ aptcachetime }}"
with_items:
- kubelet-{{kubelet_version}}
- kubeadm
- kubectl
loop: [ 'kubeadm', 'kubectl', 'kubelet' ]
- name: Enable service kubelet persistently
service:
name: kubelet
enabled: yes
# TODO ???
# - name: Reboot all the kubernetes nodes.
# reboot:
# post_reboot_delay: 10
# reboot_timeout: 40
# connect_timeout: 60
# test_command: uptime
...