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-RedHat.yml

23 lines
530 B

---
- name: Enable nginx repo.
template:
src: nginx.repo.j2
dest: /etc/yum.repos.d/nginx.repo
owner: root
group: "{{ root_group }}"
mode: 0644
when: nginx_yum_repo_enabled | bool
register: repo
- name: Clean the nginx repo
command: >
yum clean all --disablerepo="*" --enablerepo=nginx
args:
warn: false
when: repo.changed
- name: Ensure nginx is installed.
package:
name: "{{ nginx_package_name }}"
state: "{{ 'latest' if repo.changed else 'present' }}"
notify: restart nginx