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

79 lines
3.0 KiB
YAML
Raw Permalink 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
ansible.builtin.command: portsnap fetch --interactive
2020-09-15 21:27:06 +02:00
args:
creates: /var/db/portsnap/INDEX
2020-09-19 17:32:17 +02:00
- name: (FreeBSD) Extract ports
ansible.builtin.command: portsnap extract
2020-09-15 21:27:06 +02:00
args:
creates: /usr/ports
when:
- ansible_facts['system'] == "FreeBSD"
- nginx_bsd_update_ports | bool
- name: (FreeBSD) {{ nginx_setup | capitalize }} NGINX
2020-09-15 21:27:06 +02:00
block:
- name: (FreeBSD) {{ nginx_setup | capitalize }} NGINX package
community.general.pkgng:
2020-09-15 21:27:06 +02:00
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
- name: (FreeBSD) {{ nginx_setup | capitalize }} NGINX port
community.general.portinstall:
2020-09-15 21:27:06 +02:00
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"
- name: (OpenBSD) {{ nginx_setup | capitalize }} NGINX
2020-09-15 21:27:06 +02:00
block:
- name: (OpenBSD) {{ nginx_setup | capitalize }} NGINX package
community.general.openbsd_pkg:
2020-09-15 21:27:06 +02:00
name: "nginx{{ nginx_version | default('') }}"
build: false
2020-09-15 21:27:06 +02:00
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
- name: (OpenBSD) {{ nginx_setup | capitalize }} NGINX port
community.general.openbsd_pkg:
2020-09-15 21:27:06 +02:00
name: "nginx{{ nginx_version | default('') }}"
build: true
2020-09-15 21:27:06 +02:00
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"
- name: (NetBSD) {{ nginx_setup | capitalize }} NGINX
2020-09-15 21:27:06 +02:00
block:
- name: (NetBSD) {{ nginx_setup | capitalize }} NGINX package
ansible.builtin.command: "pkg_add www/nginx{{ nginx_version | default('') }}"
2020-09-15 21:27:06 +02:00
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
- name: (NetBSD) {{ nginx_setup | capitalize }} NGINX port
ansible.builtin.fail:
msg: "{{ ansible_facts['system'] }} {{ nginx_setup | capitalize }} NGINX port not implemented."
2020-09-15 21:27:06 +02:00
when: not nginx_bsd_install_packages | bool
when: ansible_facts['system'] == "NetBSD"
- name: (DragonFlyBSD/HardenedBSD) {{ nginx_setup | capitalize }} NGINX
2020-09-15 21:27:06 +02:00
block:
- name: (DragonFlyBSD/HardenedBSD) {{ nginx_setup | capitalize }} NGINX package
ansible.builtin.command: "pkg install www/nginx{{ nginx_version | default('') }}"
2020-09-15 21:27:06 +02:00
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
- name: (DragonFlyBSD/HardenedBSD) {{ nginx_setup | capitalize }} NGINX port
ansible.builtin.fail:
msg: "{{ ansible_facts['system'] }} {{ nginx_setup | capitalize }} NGINX port not implemented."
2020-09-15 21:27:06 +02:00
when: not nginx_bsd_install_packages | bool
when: ansible_facts['system'] in ['DragonFlyBSD', 'HardenedBSD']