Change the dpkg -l to dpkg-query -s
The dpkg -l python will give 0 as result, because the python has un (not-installed)status on xenial, switch to dpkg-query will give the right status code(1) if the package is not installed. Change-Id: I7faf1d922bdf0673d5daeec6fb2538f1786cbcd1
This commit is contained in:
parent
f48e76ae67
commit
e410759e8d
@ -36,7 +36,7 @@
|
|||||||
exit $result;
|
exit $result;
|
||||||
;;
|
;;
|
||||||
ubuntu)
|
ubuntu)
|
||||||
dpkg -l python
|
dpkg-query -s python $> /dev/null
|
||||||
result=$?
|
result=$?
|
||||||
|
|
||||||
if [ $result -eq 1 ]; then
|
if [ $result -eq 1 ]; then
|
||||||
@ -48,6 +48,7 @@
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
changed_when: "result.rc == 2"
|
changed_when: "result.rc == 2"
|
||||||
|
failed_when: "{{ result.rc not in [0, 2] }}"
|
||||||
|
|
||||||
- name: Basic host setup
|
- name: Basic host setup
|
||||||
hosts: "{{ openstack_host_group|default('hosts') }}"
|
hosts: "{{ openstack_host_group|default('hosts') }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user