mirror of
https://github.com/Crocmagnon/ansible.git
synced 2024-11-21 14:58:02 +01:00
add clean dependencies playbook
This commit is contained in:
parent
559c75c762
commit
191a09a137
2 changed files with 11 additions and 1 deletions
7
playbooks/dependencies/00-clean-deps.yaml
Normal file
7
playbooks/dependencies/00-clean-deps.yaml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
- name: clean ansible venv
|
||||||
|
hosts: servers
|
||||||
|
tasks:
|
||||||
|
- name: remove virtualenv
|
||||||
|
file:
|
||||||
|
path: /tmp/ansible
|
||||||
|
state: absent
|
|
@ -8,8 +8,11 @@
|
||||||
- python3-venv
|
- python3-venv
|
||||||
- name: setup venv
|
- name: setup venv
|
||||||
shell: |
|
shell: |
|
||||||
if [ -x /tmp/ansible/bin/python ]; then rm -rf /tmp/ansible; fi
|
if [ -x /tmp/ansible/bin/python ]; then exit 123; fi
|
||||||
/usr/bin/python3 -m venv /tmp/ansible
|
/usr/bin/python3 -m venv /tmp/ansible
|
||||||
/tmp/ansible/bin/pip install --upgrade 'github3.py >= 1.0.0a3'
|
/tmp/ansible/bin/pip install --upgrade 'github3.py >= 1.0.0a3'
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
|
register: venv
|
||||||
|
changed_when: "venv.rc != 123"
|
||||||
|
failed_when: "venv.rc != 0 and venv.rc != 123"
|
Loading…
Reference in a new issue