/
uwsgi_install.yml
58 lines (54 loc) · 1.93 KB
/
uwsgi_install.yml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
---
# Copyright 2019, VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Create uWSGI system group
group:
name: "{{ uwsgi_system_group_name }}"
state: "present"
system: "yes"
- name: Create uWSGI system user
user:
name: "{{ uwsgi_system_user_name }}"
group: "{{ uwsgi_system_group_name }}"
comment: "uwsgi user"
shell: "/bin/false"
system: "yes"
createhome: "yes"
home: "/var/lib/{{ uwsgi_system_user_name }}"
- name: Install distro packages
package:
name: "{{ uwsgi_package_list }}"
state: "{{ uwsgi_package_state }}"
update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"
cache_valid_time: "{{ (ansible_facts['distribution'] | lower == 'debian') | ternary(cache_timeout, omit) }}"
register: install_packages
until: install_packages is success
retries: 5
delay: 2
notify:
- Restart uwsgi services
- name: Install the python venv
include_role:
name: "python_venv_build"
vars:
venv_install_destination_path: "{{ uwsgi_bin | dirname }}"
venv_pip_install_args: "{{ uwsgi_pip_install_args }}"
venv_pip_packages: "{{ uwsgi_pip_packages }}"
venv_build_distro_package_list: "{{ uwsgi_build_distro_package_list }}"
venv_python_executable: "{{ uwsgi_python_executable }}"
venv_facts_when_changed:
- section: 'uwsgi'
option: 'venv_tag'
value: "{{ uwsgi_venv_tag }}"
when: uwsgi_install_method == 'source'