|
27 | 27 | - name: Assert authentication (no KUBECONFIG) |
28 | 28 | ansible.builtin.assert: |
29 | 29 | that: |
30 | | - - k8s_auth_host|length > 0 |
31 | | - - k8s_auth_api_key|length > 0 |
| 30 | + - k8s_auth_host | length > 0 |
| 31 | + - k8s_auth_api_key | length > 0 |
32 | 32 | msg: "Define KUBECONFIG or set 'k8s_auth_host' and 'k8s_auth_api_key'" |
33 | | - when: k8s_kubeconfig|string|length == 0 |
| 33 | + when: k8s_kubeconfig | string | length == 0 |
34 | 34 |
|
35 | 35 | - name: Assert authentication (KUBECONFIG) |
36 | 36 | ansible.builtin.assert: |
37 | 37 | that: |
38 | | - - k8s_auth_host|length == 0 |
39 | | - - k8s_auth_api_key|length == 0 |
40 | | - when: k8s_kubeconfig|string|length > 0 |
| 38 | + - k8s_auth_host | length == 0 |
| 39 | + - k8s_auth_api_key | length == 0 |
| 40 | + when: k8s_kubeconfig | string | length > 0 |
41 | 41 |
|
42 | 42 | # Go... |
43 | 43 |
|
|
46 | 46 | group/k8s: |
47 | 47 | host: "{{ k8s_auth_host }}" |
48 | 48 | api_key: "{{ k8s_auth_api_key }}" |
49 | | - when: k8s_kubeconfig|string|length == 0 |
| 49 | + when: k8s_kubeconfig | string | length == 0 |
50 | 50 | block: |
51 | 51 |
|
52 | 52 | - name: Deploy |
53 | 53 | include_tasks: deploy.yaml |
54 | | - when: infra_state|string == 'present' |
| 54 | + when: infra_state | string == 'present' |
55 | 55 | - name: Undeploy |
56 | 56 | include_tasks: undeploy.yaml |
57 | | - when: infra_state|string == 'absent' |
| 57 | + when: infra_state | string == 'absent' |
58 | 58 |
|
59 | 59 | - name: Deploy (with KUBECONFIG) |
60 | 60 | module_defaults: |
61 | 61 | group/k8s: |
62 | 62 | kubeconfig: "{{ k8s_kubeconfig }}" |
63 | | - when: k8s_kubeconfig|string|length > 0 |
| 63 | + when: k8s_kubeconfig | string | length > 0 |
64 | 64 | block: |
65 | 65 |
|
66 | | - - ansible.builtin.include_tasks: deploy.yaml |
67 | | - when: infra_state|string == 'present' |
68 | | - - ansible.builtin.include_tasks: undeploy.yaml |
69 | | - when: infra_state|string == 'absent' |
| 66 | + - name: Deploy |
| 67 | + ansible.builtin.include_tasks: deploy.yaml |
| 68 | + when: infra_state | string == 'present' |
| 69 | + - name: Undeploy |
| 70 | + ansible.builtin.include_tasks: undeploy.yaml |
| 71 | + when: infra_state | string == 'absent' |
0 commit comments