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

79 lines
2.5 KiB
YAML
Raw Normal View History

2020-09-15 21:27:06 +02:00
---
2020-09-19 17:32:17 +02:00
- name: (FreeBSD) Update ports
2020-09-15 21:27:06 +02:00
block:
2020-09-19 17:32:17 +02:00
- name: (FreeBSD) Fetch ports
2020-09-15 21:27:06 +02:00
command: portsnap fetch --interactive
args:
creates: /var/db/portsnap/INDEX
2020-09-19 17:32:17 +02:00
- name: (FreeBSD) Extract ports
2020-09-15 21:27:06 +02:00
command: portsnap extract
args:
creates: /usr/ports
when:
- ansible_facts['system'] == "FreeBSD"
- nginx_bsd_update_ports | bool
2020-09-19 17:32:17 +02:00
- name: (FreeBSD) Install NGINX
2020-09-15 21:27:06 +02:00
block:
2020-09-19 17:32:17 +02:00
- name: (FreeBSD) Install NGINX package
2020-09-15 21:27:06 +02:00
pkgng:
name: "www/nginx{{ nginx_version | default('') }}"
state: "{{ nginx_state }}"
when: nginx_bsd_install_packages | bool
2020-09-19 17:32:17 +02:00
notify: (Handler) Run NGINX
2020-09-15 21:27:06 +02:00
2020-09-19 17:32:17 +02:00
- name: (FreeBSD) Install NGINX port
2020-09-15 21:27:06 +02:00
portinstall:
name: "www/nginx{{ nginx_version | default('') }}"
use_packages: "{{ nginx_bsd_portinstall_use_packages | default(omit) }}"
state: "{{ nginx_state }}"
when: not nginx_bsd_install_packages | bool
2020-09-19 17:32:17 +02:00
notify: (Handler) Run NGINX
2020-09-15 21:27:06 +02:00
when: ansible_facts['system'] == "FreeBSD"
2020-09-19 17:32:17 +02:00
- name: (OpenBSD) Install NGINX
2020-09-15 21:27:06 +02:00
block:
2020-09-19 17:32:17 +02:00
- name: (OpenBSD) Install NGINX package
2020-09-15 21:27:06 +02:00
openbsd_pkg:
name: "nginx{{ nginx_version | default('') }}"
build: no
state: "{{ nginx_state }}"
when: nginx_bsd_install_packages | bool
2020-09-19 17:32:17 +02:00
notify: (Handler) Run NGINX
2020-09-15 21:27:06 +02:00
2020-09-19 17:32:17 +02:00
- name: (OpenBSD) Install NGINX port
2020-09-15 21:27:06 +02:00
openbsd_pkg:
name: "nginx{{ nginx_version | default('') }}"
build: yes
state: "{{ nginx_state }}"
when: not nginx_bsd_install_packages | bool
2020-09-19 17:32:17 +02:00
notify: (Handler) Run NGINX
2020-09-15 21:27:06 +02:00
when: ansible_facts['system'] == "OpenBSD"
2020-09-19 17:32:17 +02:00
- name: (NetBSD) Install NGINX
2020-09-15 21:27:06 +02:00
block:
2020-09-19 17:32:17 +02:00
- name: (NetBSD) Install NGINX package
2020-09-15 21:27:06 +02:00
command: "pkg_add www/nginx{{ nginx_version | default('') }}"
when: nginx_bsd_install_packages | bool
2020-09-19 17:32:17 +02:00
notify: (Handler) Run NGINX
2020-09-15 21:27:06 +02:00
2020-09-19 17:32:17 +02:00
- name: (NetBSD) Install NGINX port
2020-09-15 21:27:06 +02:00
fail:
msg: "{{ ansible_facts['system'] }} Install NGINX port not implemented."
when: not nginx_bsd_install_packages | bool
when: ansible_facts['system'] == "NetBSD"
2020-09-19 17:32:17 +02:00
- name: (DragonFlyBSD/HardenedBSD) Install NGINX
2020-09-15 21:27:06 +02:00
block:
2020-09-19 17:32:17 +02:00
- name: Install NGINX package
2020-09-15 21:27:06 +02:00
command: "pkg install www/nginx{{ nginx_version | default('') }}"
when: nginx_bsd_install_packages | bool
2020-09-19 17:32:17 +02:00
notify: (Handler) Run NGINX
2020-09-15 21:27:06 +02:00
2020-09-19 17:32:17 +02:00
- name: Install NGINX port
2020-09-15 21:27:06 +02:00
fail:
msg: "{{ ansible_facts['system'] }} Install NGINX port not implemented."
when: not nginx_bsd_install_packages | bool
when: ansible_facts['system'] in ['DragonFlyBSD', 'HardenedBSD']