65 lines
1.6 KiB
YAML
65 lines
1.6 KiB
YAML
---
|
|
- name: CREATE CLUSTER
|
|
tags:
|
|
- k8s
|
|
block:
|
|
- name: Add generic server taint
|
|
ansible.builtin.include_vars:
|
|
file: "server-taint.yml"
|
|
when:
|
|
- k8s_taint_servers and k8s_node_type != "agent"
|
|
|
|
- name: Add generic agent label
|
|
ansible.builtin.include_vars:
|
|
file: "agent-label.yml"
|
|
when:
|
|
- k8s_label_agents and k8s_node_type == "agent"
|
|
|
|
- name: Increase open file limit
|
|
ansible.posix.sysctl:
|
|
name: fs.inotify.max_user_instances
|
|
value: "{{ k8s_inotify_max }}"
|
|
state: present
|
|
|
|
- name: Download install script
|
|
ansible.builtin.get_url:
|
|
url: "{{ k8s_install_url | d(k8s_default_install_url) }}"
|
|
timeout: 120
|
|
dest: "{{ k8s_install_script }}"
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
|
|
# CLUSTER CONFIG
|
|
- name: Check config paths
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
mode: 0755
|
|
loop:
|
|
- "{{ k8s_config_path }}"
|
|
- "{{ k8s_manifests_path }}"
|
|
tags:
|
|
- k8s-config
|
|
|
|
- name: Template cluster config
|
|
ansible.builtin.template:
|
|
src: "templates/{{ k8s_type }}/config.yaml.j2"
|
|
dest: "{{ k8s_config_path }}/config.yaml"
|
|
mode: 0600
|
|
tags:
|
|
- k8s-config
|
|
|
|
- name: Type specific configuration
|
|
ansible.builtin.include_tasks: "{{ k8s_type }}/config.yml"
|
|
tags:
|
|
- k8s-config
|
|
|
|
# DEPLOY CLUSTER
|
|
- name: Begin cluster creation
|
|
ansible.builtin.include_tasks: "{{ k8s_type }}/main.yml"
|
|
|
|
# END Cluster Creation
|
|
when:
|
|
- k8s_action == "create"
|