ansible-role-nginx/tasks/opensource/install-oss-bsd.yml

92 lines
3.1 KiB
YAML
Raw Normal View History

---
- name: "(Install: FreeBSD) Update Ports"
block:
- 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
when:
- ansible_system == "FreeBSD"
2020-08-19 18:39:17 +02:00
- nginx_bsd_update_ports | bool
- name: "(Install: FreeBSD)"
block:
- name: "(Install: FreeBSD) Install NGINX Package"
pkgng:
name: "www/nginx{{ nginx_version | default('') }}"
state: "{{ nginx_state }}"
2020-08-19 18:39:17 +02:00
when: nginx_bsd_install_packages | bool
notify: "(Handler: All OSs) Start NGINX"
- name: "(Install: FreeBSD) Install NGINX Port"
portinstall:
name: "www/nginx{{ nginx_version | default('') }}"
use_packages: "{{ nginx_bsd_portinstall_use_packages | default(omit) }}"
state: "{{ nginx_state }}"
2020-08-19 18:39:17 +02:00
when: not nginx_bsd_install_packages | bool
notify: "(Handler: All OSs) Start NGINX"
when: ansible_system == "FreeBSD"
- name: "(Install: OpenBSD)"
block:
- name: "(Install: OpenBSD) Install NGINX Package"
openbsd_pkg:
name: "nginx{{ nginx_version | default('') }}"
2020-07-30 12:47:08 +02:00
build: no
state: "{{ nginx_state }}"
2020-08-19 18:39:17 +02:00
when: nginx_bsd_install_packages | bool
notify: "(Handler: All OSs) Start NGINX"
- name: "(Install: OpenBSD) Install NGINX Port"
openbsd_pkg:
name: "nginx{{ nginx_version | default('') }}"
2020-07-30 12:47:08 +02:00
build: yes
state: "{{ nginx_state }}"
2020-08-19 18:39:17 +02:00
when: not nginx_bsd_install_packages | bool
notify: "(Handler: All OSs) Start NGINX"
when: ansible_system == "OpenBSD"
- name: "(Install: NetBSD)"
block:
- name: "(Install: NetBSD) Install NGINX Package"
command: "pkg_add www/nginx{{ nginx_version | default('') }}"
2020-08-19 18:39:17 +02:00
when: nginx_bsd_install_packages | bool
notify: "(Handler: All OSs) Start NGINX"
- name: "(Install: NetBSD) Install NGINX Port"
fail:
msg: "{{ ansible_system }} Install NGINX port not implemented."
2020-08-19 18:39:17 +02:00
when: not nginx_bsd_install_packages | bool
when: ansible_system == "NetBSD"
- name: "(Install: DragonFlyBSD)"
block:
- name: "(Install: DragonFlyBSD) Install NGINX Package"
command: "pkg install www/nginx{{ nginx_version | default('') }}"
2020-08-19 18:39:17 +02:00
when: nginx_bsd_install_packages | bool
notify: "(Handler: All OSs) Start NGINX"
- name: "(Install: DragonFlyBSD) Install NGINX port"
fail:
msg: "{{ ansible_system }} Install NGINX port not implemented."
2020-08-19 18:39:17 +02:00
when: not nginx_bsd_install_packages | bool
when: ansible_system == "DragonFlyBSD"
- name: "(Install: HardenedBSD)"
block:
- name: "(Install: HardenedBSD) Install NGINX package"
command: "pkg install www/nginx{{ nginx_version | default('') }}"
2020-08-19 18:39:17 +02:00
when: nginx_bsd_install_packages | bool
notify: "(Handler: All OSs) Start NGINX"
- name: "(Install: HardenedBSD) Install NGINX port"
fail:
msg: "{{ ansible_system }} Install NGINX port not implemented."
2020-08-19 18:39:17 +02:00
when: not nginx_bsd_install_packages | bool
when: ansible_system == "HardenedBSD"