Verified Commit df11efcd authored by Radim Peša's avatar Radim Peša
Browse files

Several changes

parent eebf9986
......@@ -11,18 +11,17 @@ destroy: tf-destroy
load-secrets:
source secrets.sh
tf-plan:
cd tf && terraform init
cd tf && terraform plan
tf-apply:
cd tf
terraform init
terraform plan
terraform apply
cd tf && terraform init
cd tf && terraform apply
ansible-configure:
cd ansible
ansible-playbook k8s-dynamic.yml
ansible-playbook --private-key=~/.ssh/tf-edirex/id_rsa --extra-vars "RANCHER_TOKEN=$ENV_RANCHER_TOKEN" k8s-dynamic.yml
cd ansible && ansible-playbook --private-key=~/.ssh/tf-edirex/id_rsa --extra-vars "RANCHER_TOKEN=$ENV_RANCHER_TOKEN" k8s-dynamic.yml
tf-destroy:
cd tf
terraform init
terraform destroy
cd tf && terraform init
cd tf && terraform destroy
......@@ -32,8 +32,8 @@
tasks:
- command: sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.2.2 --server https://barn.ics.muni.cz --token "{{ RANCHER_TOKEN }}" --worker --etcd --controlplane
- name: Start master containers
hosts:
- "{{ hgroup | default('g_k8s-test') }}_worker"
tasks:
- command: sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.2.2 --server https://barn.ics.muni.cz --token "{{ RANCHER_TOKEN }}" --worker
#- name: Start worker containers
# hosts:
# - "{{ hgroup | default('g_k8s-test') }}_worker"
# tasks:
# - command: sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.2.2 --server https://barn.ics.muni.cz --token "{{ RANCHER_TOKEN }}" --worker
- hosts: all
become: "true"
gather_facts: False
pre_tasks:
- name: Install python for Ansible
raw: test -e /usr/bin/python || (dpkg --configure -a && apt-get -y update && apt-get install -y python-minimal)
changed_when: False
- name: Gathering facts
setup:
- name: upgrade
apt: upgrade=dist update_cache=yes
- name: Setup k8s-europdx
hosts: k8s
become: "true"
roles:
- {role: host-settings, tags: host}
- {role: user, tags: lasuser}
- {role: dockermtufix, tags: dockermtufix, when: ansible_virtualization_type == 'openstack'}
- name: Start worker container
hosts: k8s-workers
tasks:
- command: sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.2.2 --server https://barn.ics.muni.cz --token "{{ RANCHER_TOKEN }}" --worker
# become: "true"
# tasks:
# - name: start docker
# docker_container:
# name: k8s-worker
# command: --server https://barn.ics.muni.cz --token "{{ RANCHER_TOKEN }}" --worker --net=host
# state: started
# detach: yes
# privileged: yes
# restart_policy: unless-stopped
# image: rancher/rancher-agent:v2.2.2
# volumes:
# - /var/run:/var/run
# - /etc/kubernetes:/etc/kubernetes
- name: Setup nfs
hosts: nfs
become: "true"
roles:
- {role: host-settings, tags: host}
- {role: user, tags: lasuser}
- {role: nfs-server, tags: nfs-server}
- {role: dockermtufix, tags: dockermtufix, when: ansible_virtualization_type == 'openstack'}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment