2015-10-04 04:19:50 +08:00
|
|
|
---
|
2015-12-11 18:32:13 +08:00
|
|
|
- name: create kubernetes config directory
|
|
|
|
file: path={{ kube_config_dir }} state=directory
|
|
|
|
|
|
|
|
- name: create kubernetes script directory
|
|
|
|
file: path={{ kube_script_dir }} state=directory
|
|
|
|
|
|
|
|
- name: Make sure manifest directory exists
|
|
|
|
file: path={{ kube_manifest_dir }} state=directory
|
|
|
|
|
|
|
|
|
2015-12-17 06:49:01 +08:00
|
|
|
- name: certs | create system kube-cert groups
|
|
|
|
group: name={{ kube_cert_group }} state=present system=yes
|
2015-12-11 18:32:13 +08:00
|
|
|
|
2015-12-17 06:49:01 +08:00
|
|
|
- name: create system kube user
|
|
|
|
user:
|
|
|
|
name=kube
|
|
|
|
comment="Kubernetes user"
|
|
|
|
shell=/sbin/nologin
|
|
|
|
state=present
|
|
|
|
system=yes
|
|
|
|
groups={{ kube_cert_group }}
|
2015-12-11 18:32:13 +08:00
|
|
|
|
2015-12-17 06:49:01 +08:00
|
|
|
- include: install.yml
|
|
|
|
|
|
|
|
- include: secrets.yml
|
|
|
|
tags:
|
|
|
|
- secrets
|
2015-12-11 18:32:13 +08:00
|
|
|
|
|
|
|
- name: Write kubelet config file
|
2015-12-31 21:05:55 +08:00
|
|
|
template: src=kubelet.j2 dest={{ kube_config_dir }}/kubelet backup=yes
|
2015-12-11 18:32:13 +08:00
|
|
|
notify:
|
|
|
|
- restart kubelet
|
|
|
|
|
|
|
|
- name: write the kubecfg (auth) file for kubelet
|
|
|
|
template: src=node-kubeconfig.yaml.j2 dest={{ kube_config_dir }}/node-kubeconfig.yaml backup=yes
|
|
|
|
notify:
|
|
|
|
- restart kubelet
|
|
|
|
|
|
|
|
- name: Write proxy manifest
|
|
|
|
template:
|
|
|
|
src: manifests/kube-proxy.manifest.j2
|
|
|
|
dest: "{{ kube_manifest_dir }}/kube-proxy.manifest"
|
|
|
|
|
2015-12-29 19:10:49 +08:00
|
|
|
- name: Write network-environment
|
|
|
|
template: src=network-environment.j2 dest=/etc/network-environment mode=640
|
|
|
|
|
2015-12-11 18:32:13 +08:00
|
|
|
- name: Enable kubelet
|
|
|
|
service:
|
|
|
|
name: kubelet
|
|
|
|
enabled: yes
|
|
|
|
state: started
|