From 70a2906268f82946116b1eb2f1ffb75efad463ad Mon Sep 17 00:00:00 2001 From: Alessandro Fael Garcia Date: Wed, 9 May 2018 13:31:16 -0700 Subject: [PATCH] Implement FreeBSD support for NGINX Open Source Use FreeBSD ports instead of pkgng to fetch the latest version of NGINX Open Source --- tasks/opensource/install-oss.yml | 13 ++++++++++++- tasks/opensource/setup-freebsd.yml | 10 ++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tasks/opensource/setup-freebsd.yml diff --git a/tasks/opensource/install-oss.yml b/tasks/opensource/install-oss.yml index e93dbcb..94b25c1 100644 --- a/tasks/opensource/install-oss.yml +++ b/tasks/opensource/install-oss.yml @@ -8,8 +8,19 @@ - import_tasks: setup-suse.yml when: ansible_os_family == "Suse" -- name: "(Install: All OSs) Install NGINX" +- import_tasks: setup-freebsd.yml + when: ansible_os_family == "FreeBSD" + +- name: "(Install: Debian/Ubuntu/CentOS/RedHat) Install NGINX" package: name: nginx state: present + when: ansible_os_family != "FreeBSD" + notify: "(Handler: All OSs) Start NGINX" + +- name: "(Install: FreeBSD) Install NGINX" + package: + name: nginx + state: present + when: ansible_os_family == "FreeBSD" notify: "(Handler: All OSs) Start NGINX" diff --git a/tasks/opensource/setup-freebsd.yml b/tasks/opensource/setup-freebsd.yml new file mode 100644 index 0000000..fdc1ae5 --- /dev/null +++ b/tasks/opensource/setup-freebsd.yml @@ -0,0 +1,10 @@ +--- +- name: "(Install: FreeBSD) Fetch Ports" + command: portsnap fetch --interactive + args: + creates: /var/db/portsnap/INDEX + +- name: "(Install: FreeBSD) Extract Ports" + command: portsnap extract + args: + creates: /usr/ports