@@ -99,12 +99,51 @@ tasks:
9999 publish :
100100 - vm_info : <% result().output.vm_info %>
101101 - vm_id : <% result().output.vm_info.id %>
102- do : get_bootstrap_script
102+ do : check_for_ubuntu_xenial
103103 - when : <% failed() %>
104104 publish :
105105 - vm_id : <% result().output.get("vm_info", {}).get("id") %>
106106 - failed : True
107107 do : cleanup
108+ check_for_ubuntu_xenial :
109+ action : core.remote
110+ input :
111+ hosts : <% ctx().vm_info.private_ip_address %>
112+ cmd : cat /etc/issue
113+ next :
114+ - when : <% succeeded() %>
115+ publish :
116+ - cat_result : <% result() %>
117+ do : echo_result
118+ - when : <% succeeded() and "Ubuntu 16" in result().get(ctx().vm_info.private_ip_address).stdout %>
119+ do : install_python36
120+ - when : <% succeeded() and not "Ubuntu 16" in result().get(ctx().vm_info.private_ip_address).stdout %>
121+ do : get_bootstrap_script
122+ - when : <% failed() %>
123+ do : check_debug_mode
124+ echo_result :
125+ action : core.echo
126+ input :
127+ message : ' <% ctx().cat_result % >'
128+ next :
129+ - when : <% succeeded() %>
130+ do : install_python36
131+ install_python36 :
132+ action : core.remote_sudo
133+ input :
134+ hosts : <% ctx().vm_info.private_ip_address %>
135+ cmd : |-
136+ python3 --version
137+ add-apt-repository ppa:deadsnakes/ppa --yes
138+ apt-get update
139+ apt-get install --yes python3.6
140+ patch /etc/st2/st2.conf <<EOF
141+ 23a24
142+ > python3_binary = /usr/bin/python3.6
143+ EOF
144+ next :
145+ - when : <% succeeded() %>
146+ do : get_bootstrap_script
108147 get_bootstrap_script :
109148 action : core.remote_sudo
110149 input :
@@ -156,32 +195,6 @@ tasks:
156195 input :
157196 hosts : <% ctx().vm_info.private_ip_address %>
158197 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
185198 next :
186199 - when : <% succeeded() %>
187200 do : check_debug_mode
0 commit comments