interop-workloads/workloads/ansible/shade/k8s/roles/post/tasks/apply.yml

35 lines
940 B
YAML
Executable File

---
- name: Setup couple variables
set_fact:
public_ip: "{{ ansible_host }}"
private_ip: "{{ hostvars[ansible_host].inter_ip }}"
- name: Upload addon service configuration files
template:
src: "roles/post/templates/{{ item }}.j2"
dest: "/etc/kubernetes/{{ item }}.yaml"
mode: 0644
with_items:
- dnscontroller
- dashboard
- cockroachdb-init-pod
- name: Label the master node
command: >-
/opt/bin/kubectl --server={{ private_ip }}:8080 label --overwrite=true
nodes master dashboardId=master
- name: Create addon services
command: >-
/opt/bin/kubectl --server={{ private_ip }}:8080 create
-f /etc/kubernetes/{{ item }}.yaml
with_items:
- dnscontroller
- dashboard
- name: Setup first cockroachdb node
command: >-
/opt/bin/kubectl --server={{ private_ip }}:8080 create
-f /etc/kubernetes/cockroachdb-init-pod.yaml
when: app_env.app_setting.own_cluster == True