You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
ansible-role-nginx/tasks/setup-Ubuntu.yml

30 lines
852 B

---
- name: Ensure dirmngr is installed (gnupg dependency).
apt:
name: dirmngr
state: present
- apt_repository:
repo: ppa:nginx/stable
state: absent
- name: add nginx public key
apt_key: url=https://nginx.org/keys/nginx_signing.key
state=present
register: nginx_repo_added
when: nginx_repo_use | bool
- name: add nginx stable repository
apt_repository: repo='deb http://nginx.org/packages/{{ '/mainline' if nginx_repo_mainline else ''}}ubuntu {{ ansible_distribution_release }} nginx'
state=present
mode=0644
update_cache=true
register: nginx_repo_added
when: nginx_repo_use | bool
- name: Ensure nginx will reinstall if the repo was just added.
apt:
name: nginx
state: absent
when: nginx_repo_added is changed
tags: ['skip_ansible_lint']