PR #45: Clean up var names and document new feature.

pull/52/head 1.8.0
Jeff Geerling 8 years ago
parent 3af0b284c1
commit e818255465
  1. 5
      README.md
  2. 7
      defaults/main.yml
  3. 21
      tasks/setup-Ubuntu.yml

@ -94,6 +94,11 @@ Extra lines to be inserted in the top-level `http` block in `nginx.conf`. The va
(For Debian/Ubuntu only) Allows you to set a different repository for the installation of Nginx. As an example, if you are running Debian's wheezy release, and want to get a newer version of Nginx, you can install the `wheezy-backports` repository and set that value here, and Ansible will use that as the `-t` option while installing Nginx. (For Debian/Ubuntu only) Allows you to set a different repository for the installation of Nginx. As an example, if you are running Debian's wheezy release, and want to get a newer version of Nginx, you can install the `wheezy-backports` repository and set that value here, and Ansible will use that as the `-t` option while installing Nginx.
nginx_ppa_use: false
nginx_ppa_version: stable
(For Ubuntu only) Allows you to use the official Nginx PPA instead of the system's package. You can set the version to `stable` or `development`.
## Dependencies ## Dependencies
None. None.

@ -2,6 +2,10 @@
# Used only for Debian/Ubuntu installation, as the -t option for apt. # Used only for Debian/Ubuntu installation, as the -t option for apt.
nginx_default_release: "" nginx_default_release: ""
# Use the official Nginx PPA for Ubuntu, and the version to use if so.
nginx_ppa_use: false
nginx_ppa_version: stable
# The name of the nginx apt/yum package to install. # The name of the nginx apt/yum package to install.
nginx_package_name: "nginx" nginx_package_name: "nginx"
@ -60,6 +64,3 @@ nginx_upstreams: []
# "srv2.example.com weight=3", # "srv2.example.com weight=3",
# "srv3.example.com" # "srv3.example.com"
# } # }
nginx_ppa_version: stable
nginx_use_ppa: false

@ -1,11 +1,14 @@
--- ---
- name: Add PPA for Nginx. - name: Add PPA for Nginx.
apt_repository: repo='ppa:nginx/{{ nginx_ppa_version }}' state=present update_cache=yes apt_repository:
register: added_ppa repo: 'ppa:nginx/{{ nginx_ppa_version }}'
when: nginx_use_ppa state: present
update_cache: yes
register: nginx_ppa_added
when: nginx_ppa_use
- name: ensure nginx is not installed when the ppa was just added - name: Ensure nginx will reinstall if the PPA was just added.
apt: apt:
pkg: nginx name: nginx
state: absent state: absent
when: added_ppa.changed when: nginx_ppa_added.changed