forked from saratov/infra
install prereqs only when needed
This commit is contained in:
parent
1208e753f8
commit
2e2fba457f
@ -28,9 +28,13 @@
|
|||||||
pre_tasks:
|
pre_tasks:
|
||||||
- meta: end_play
|
- meta: end_play
|
||||||
when: destroy_all is defined and destroy_all|bool
|
when: destroy_all is defined and destroy_all|bool
|
||||||
|
- name: check prereqs is already installed
|
||||||
|
shell: rpm -qa | grep -q python-modules-distutils
|
||||||
|
register: prereqs_found
|
||||||
|
changed_when: false
|
||||||
- name: install prereqs
|
- name: install prereqs
|
||||||
raw: 'apt-get update && apt-get install -qy python2.7\(distutils\)'
|
raw: 'apt-get update && apt-get install -qy python2.7\(distutils\)'
|
||||||
when: destroy_all is not defined or not destroy_all
|
when: (destroy_all is not defined or not destroy_all) and (prereqs_found.rc != 0)
|
||||||
- name: gather facts
|
- name: gather facts
|
||||||
setup:
|
setup:
|
||||||
when: destroy_all is not defined or not destroy_all
|
when: destroy_all is not defined or not destroy_all
|
||||||
|
Loading…
Reference in New Issue
Block a user