Petr OspalĂ˝ | fe49ee9 | 2019-04-20 00:53:01 +0200 | [diff] [blame] | 1 | --- |
Michal Zegan | 1ec19b0 | 2019-04-30 14:52:13 +0200 | [diff] [blame] | 2 | - name: "Check if rke is deployed" |
| 3 | command: "rke version" |
| 4 | args: |
| 5 | chdir: "{{ cluster_config_dir }}" |
| 6 | failed_when: false |
| 7 | changed_when: false |
| 8 | register: rke_deployed |
| 9 | |
Petr OspalĂ˝ | fe49ee9 | 2019-04-20 00:53:01 +0200 | [diff] [blame] | 10 | - name: Run rke up |
| 11 | command: "{{ rke_bin_dir }}/rke up --config cluster.yml" |
| 12 | args: |
| 13 | chdir: "{{ cluster_config_dir }}" |
Michal Zegan | 1ec19b0 | 2019-04-30 14:52:13 +0200 | [diff] [blame] | 14 | when: rke_deployed.rc != 0 or cluster_yml.changed # noqa 503 |
Michal Zegan | 119f760 | 2019-04-23 16:34:58 +0200 | [diff] [blame] | 15 | |
| 16 | - name: Ensure .kube directory is present |
| 17 | file: |
| 18 | path: "{{ kube_config_dir }}" |
| 19 | state: directory |
| 20 | |
| 21 | - name: Setup kubeconfig |
| 22 | copy: |
| 23 | src: "{{ cluster_config_dir }}/kube_config_cluster.yml" |
| 24 | dest: "{{ kube_config_dir }}/config" |
| 25 | remote_src: true |
| 26 | mode: 0755 |