1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
---
- hosts: localhost
roles:
- role: wsgi-app
- role: nrpe-external-master
check_name: check_http
check_params: "-I 127.0.0.1 -p 8080 -e ' 200 OK' -s '{{ nagios_index_content }}' -u '/'"
service_description: "Verify wsgi-app is responding."
tasks:
# Apt dependencies
# ===
- name: Install custom apt dependencies.
apt: "pkg={{ item }} state=latest update_cache=yes"
with_items: apt_dependencies.split()
tags:
- config-changed
- start
# Pip requirements
# ===
- name: Install pip if we need to install requirements.
apt: "pkg={{ item }} state=latest update_cache=yes"
with_items:
- python-pip
tags:
- config-changed
- start
when: requirements_path > ""
- name: Install pip requirements from PyPi
pip: "requirements='{{ current_code_dir }}/{{ requirements_path }}'"
tags:
- config-changed
- start
when: build_label > '' and archive_filename > '' and requirements_path > "" and pip_cache_path == ""
- name: Install pip requirements from pip cache
pip: "requirements='{{ current_code_dir }}/{{ requirements_path }}' extra_args='--no-index --find-links={{ current_code_dir }}/{{ pip_cache_path }}'"
tags:
- config-changed
- start
when: build_label > '' and archive_filename > '' and requirements_path > "" and pip_cache_path > ""
|