| --- |
| - name: "Check if rke is deployed" |
| command: "rke version" |
| args: |
| chdir: "{{ cluster_config_dir }}" |
| failed_when: false |
| changed_when: false |
| register: rke_deployed |
| |
| - name: Run rke up |
| command: "{{ rke_bin_dir }}/rke up --config cluster.yml" |
| args: |
| chdir: "{{ cluster_config_dir }}" |
| when: rke_deployed.rc != 0 or cluster_yml.changed # noqa 503 |
| |
| - name: Ensure .kube directory is present |
| file: |
| path: "{{ kube_config_dir }}" |
| state: directory |
| |
| - name: Setup kubeconfig |
| copy: |
| src: "{{ cluster_config_dir }}/kube_config_cluster.yml" |
| dest: "{{ kube_config_dir }}/config" |
| remote_src: true |
| mode: 0755 |