|
30 | 30 | - vm_windows_id: |
31 | 31 | - vm_fqdn: <% ctx().hostname %>.<% ctx().dns_zone %> |
32 | 32 | - vm_info: |
| 33 | + - ubuntu_variant: "" |
33 | 34 | - windows_hostname: <% ctx().hostname %>win |
34 | 35 | - vm_windows_fqdn: <% ctx().hostname %>win.<% ctx().dns_zone %> |
35 | 36 | - installed: |
@@ -99,12 +100,38 @@ tasks: |
99 | 100 | publish: |
100 | 101 | - vm_info: <% result().output.vm_info %> |
101 | 102 | - vm_id: <% result().output.vm_info.id %> |
102 | | - do: get_bootstrap_script |
| 103 | + do: check_for_ubuntu_xenial |
103 | 104 | - when: <% failed() %> |
104 | 105 | publish: |
105 | 106 | - vm_id: <% result().output.get("vm_info", {}).get("id") %> |
106 | 107 | - failed: True |
107 | 108 | do: cleanup |
| 109 | + check_for_ubuntu_xenial: |
| 110 | + action: core.remote |
| 111 | + input: |
| 112 | + hosts: <% ctx().vm_info.private_ip_address %> |
| 113 | + cmd: cat /etc/issue |
| 114 | + next: |
| 115 | + - when: <% succeeded() and "Ubuntu 16" in result().get(ctx().vm_info.private_ip_address).stdout %> |
| 116 | + publish: |
| 117 | + - ubuntu_variant: "Ubuntu 16" |
| 118 | + do: add_deadsnakes_ppa |
| 119 | + - when: <% succeeded() and not "Ubuntu 16" in result().get(ctx().vm_info.private_ip_address).stdout %> |
| 120 | + do: get_bootstrap_script |
| 121 | + - when: <% failed() %> |
| 122 | + do: check_debug_mode |
| 123 | + add_deadsnakes_ppa: |
| 124 | + action: core.remote_sudo |
| 125 | + input: |
| 126 | + hosts: <% ctx().vm_info.private_ip_address %> |
| 127 | + cmd: |- |
| 128 | + python3 --version |
| 129 | + add-apt-repository ppa:deadsnakes/ppa --yes |
| 130 | + apt-get update |
| 131 | + apt-get install --yes python3.6 |
| 132 | + next: |
| 133 | + - when: <% succeeded() %> |
| 134 | + do: get_bootstrap_script |
108 | 135 | get_bootstrap_script: |
109 | 136 | action: core.remote_sudo |
110 | 137 | input: |
@@ -156,32 +183,6 @@ tasks: |
156 | 183 | input: |
157 | 184 | hosts: <% ctx().vm_info.private_ip_address %> |
158 | 185 | timeout: 600 |
159 | | - next: |
160 | | - - when: <% succeeded() %> |
161 | | - do: check_for_ubuntu_xenial |
162 | | - check_for_ubuntu_xenial: |
163 | | - action: core.remote |
164 | | - input: |
165 | | - hosts: <% ctx().vm_info.private_ip_address %> |
166 | | - cmd: grep 'Ubuntu 16' /etc/issue |
167 | | - next: |
168 | | - - when: <% succeeded() %> |
169 | | - do: install_python36 |
170 | | - - when: <% failed() %> |
171 | | - do: check_debug_mode |
172 | | - install_python36: |
173 | | - action: core.remote_sudo |
174 | | - input: |
175 | | - hosts: <% ctx().vm_info.private_ip_address %> |
176 | | - cmd: |- |
177 | | - python3 --version |
178 | | - add-apt-repository ppa:deadsnakes/ppa --yes |
179 | | - apt-get update |
180 | | - apt-get install --yes python3.6 |
181 | | - patch /etc/st2/st2.conf <<EOF |
182 | | - 23a24 |
183 | | - > python3_binary = /usr/bin/python3.6 |
184 | | - EOF |
185 | 186 | next: |
186 | 187 | - when: <% succeeded() %> |
187 | 188 | do: check_debug_mode |
|
0 commit comments