Use alternative apt repo way to specify nginx version

pull/18/head
Artyom Miroshnik 9 years ago
parent c892b0a2fe
commit fd43d95ce4
  1. 4
      defaults/main.yml
  2. 13
      tasks/setup-Debian.yml

@ -1,6 +1,6 @@
---
# Used only for Debian/Ubuntu installation, as the -t option for apt.
nginx_default_release: ""
# Used only for Debian/Ubuntu installation, as `add-apt-repository ppa:nginx/stable` command.
nginx_alternative_repo: ""
nginx_worker_processes: "1"
nginx_worker_connections: "1024"

@ -1,6 +1,11 @@
---
- name: Add alternative nginx repo.
apt_repository: repo={{ nginx_alternative_repo }}
when: nginx_alternative_repo != ""
- name: Update apt cache.
apt: update_cache=yes cache_valid_time=86400
when: nginx_alternative_repo != ""
- name: Ensure nginx is installed.
apt:
pkg: nginx
state: installed
default_release: "{{ nginx_default_release }}"
apt: pkg=nginx state=installed