ansible-role-nginx/tasks/prerequisites/install-dependencies.yml

46 lines
1.5 KiB
YAML

---
- name: (Alpine Linux) Install dependencies
apk:
name: "{{ nginx_alpine_dependencies }}"
update_cache: true
state: latest # noqa package-latest
when: ansible_facts['os_family'] == "Alpine"
- name: (Debian/Ubuntu) Install dependencies
apt:
name: "{{ nginx_debian_dependencies }}"
update_cache: true
state: latest # noqa package-latest
when: ansible_facts['os_family'] == "Debian"
- name: (Amazon Linux/CentOS/Oracle Linux/RHEL) Install dependencies
yum:
name: "{{ nginx_redhat_dependencies }}"
update_cache: true
state: latest # noqa package-latest
when: ansible_facts['os_family'] == "RedHat"
- name: (SLES) Install dependencies
zypper:
name: "{{ nginx_sles_dependencies }}"
update_cache: true
state: latest # noqa package-latest
when: ansible_facts['os_family'] == "Suse"
- name: (FreeBSD) Install dependencies
block:
- name: (FreeBSD) Install dependencies using package(s)
pkgng:
name: "{{ nginx_freebsd_dependencies }}"
state: latest # noqa package-latest
when: nginx_bsd_install_packages | bool
- name: (FreeBSD) Install dependencies using port(s)
portinstall:
name: "{{ item }}"
use_packages: "{{ nginx_bsd_portinstall_use_packages | default(omit) }}"
state: latest # noqa package-latest
loop: "{{ nginx_freebsd_dependencies }}"
when: not nginx_bsd_install_packages | bool
when: ansible_facts['distribution'] == "FreeBSD"