diff options
Diffstat (limited to 'ansible/roles/rancher/tasks')
-rw-r--r-- | ansible/roles/rancher/tasks/main.yml | 2 | ||||
-rw-r--r-- | ansible/roles/rancher/tasks/rancher_agent.yml | 4 | ||||
-rw-r--r-- | ansible/roles/rancher/tasks/rancher_health.yml | 8 | ||||
-rw-r--r-- | ansible/roles/rancher/tasks/rancher_server.yml | 12 |
4 files changed, 12 insertions, 14 deletions
diff --git a/ansible/roles/rancher/tasks/main.yml b/ansible/roles/rancher/tasks/main.yml index 1370a39f..045363d0 100644 --- a/ansible/roles/rancher/tasks/main.yml +++ b/ansible/roles/rancher/tasks/main.yml @@ -1,2 +1,2 @@ --- -- include_tasks: "rancher_{{ rancher_role }}.yml" +- include_tasks: "rancher_{{ mode }}.yml" diff --git a/ansible/roles/rancher/tasks/rancher_agent.yml b/ansible/roles/rancher/tasks/rancher_agent.yml index 4c9cb8dd..091503c7 100644 --- a/ansible/roles/rancher/tasks/rancher_agent.yml +++ b/ansible/roles/rancher/tasks/rancher_agent.yml @@ -7,7 +7,7 @@ volumes: - "/var/run/docker.sock:/var/run/docker.sock" - "/var/lib/rancher:/var/lib/rancher" - auto_remove: yes - privileged: yes + auto_remove: true + privileged: true vars: server_hostvars: "{{ hostvars[groups.infrastructure.0] }}" diff --git a/ansible/roles/rancher/tasks/rancher_health.yml b/ansible/roles/rancher/tasks/rancher_health.yml new file mode 100644 index 00000000..b0323739 --- /dev/null +++ b/ansible/roles/rancher/tasks/rancher_health.yml @@ -0,0 +1,8 @@ +--- +- name: Check cluster health + uri: + url: "{{ rancher_server_url }}/v2-beta/projects/{{ k8s_env_id }}" + register: env_info + retries: 30 + delay: 15 + until: "env_info.json.healthState == 'healthy'" diff --git a/ansible/roles/rancher/tasks/rancher_server.yml b/ansible/roles/rancher/tasks/rancher_server.yml index 64b35e4c..d30be729 100644 --- a/ansible/roles/rancher/tasks/rancher_server.yml +++ b/ansible/roles/rancher/tasks/rancher_server.yml @@ -2,7 +2,7 @@ # DO NOT ADD SPACE AROUND ';' - name: Start rancher/server:{{ rancher_server_version }} docker_container: - name: rancher_server + name: rancher-server image: rancher/server:{{ rancher_server_version }} command: ["sh", "-c", "/usr/sbin/update-ca-certificates;/usr/bin/entry /usr/bin/s6-svscan /service"] ports: 8080:8080 @@ -39,13 +39,3 @@ key_private: "{{ env.data.apikey.private }}" rancher_agent_image: "{{ env.data.registration_tokens.image }}" rancher_agent_reg_url: "{{ env.data.registration_tokens.reg_url }}" - -- name: Ensure .kube directory exists - file: - path: "{{ kube_directory }}" - state: directory - -- name: Create kube config - template: - src: kube_config.j2 - dest: "{{ kube_directory }}/config" |