Add FreeBSD support.

pull/54/head
Bartek Rutkowski 8 years ago
parent e818255465
commit 3d71531209
  1. 9
      meta/main.yml
  2. 7
      tasks/main.yml
  3. 13
      tasks/setup-FreeBSD.yml
  4. 2
      templates/nginx.conf.j2
  5. 3
      vars/Debian.yml
  6. 9
      vars/FreeBSD.yml
  7. 3
      vars/RedHat.yml

@ -3,7 +3,7 @@ dependencies: []
galaxy_info: galaxy_info:
author: geerlingguy author: geerlingguy
description: Nginx installation for Linux/UNIX. description: Nginx installation for Linux and FreeBSD.
company: "Midwestern Mac, LLC" company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)" license: "license (BSD, MIT)"
min_ansible_version: 1.8 min_ansible_version: 1.8
@ -18,6 +18,13 @@ galaxy_info:
- name: Ubuntu - name: Ubuntu
versions: versions:
- all - all
- name: FreeBSD
versions:
- 10.3
- 10.2
- 10.1
- 10.0
- 9.3
galaxy_tags: galaxy_tags:
- development - development
- web - web

@ -18,6 +18,9 @@
- include: setup-Debian.yml - include: setup-Debian.yml
when: ansible_os_family == 'Debian' when: ansible_os_family == 'Debian'
- include: setup-FreeBSD.yml
when: ansible_os_family == 'FreeBSD'
# Vhost configuration. # Vhost configuration.
- include: vhosts.yml - include: vhosts.yml
@ -25,9 +28,9 @@
- name: Copy nginx configuration in place. - name: Copy nginx configuration in place.
template: template:
src: nginx.conf.j2 src: nginx.conf.j2
dest: /etc/nginx/nginx.conf dest: "{{ nginx_conf_file_path }}"
owner: root owner: root
group: root group: "{{ root_group }}"
mode: 0644 mode: 0644
notify: notify:
- reload nginx - reload nginx

@ -0,0 +1,13 @@
---
- name: Update pkg cache.
shell: pkg update -f
- name: Ensure nginx is installed.
pkgng:
name: "{{ nginx_package_name }}"
state: present
- name: Create logs directory.
file:
path: /var/log/nginx
state: directory

@ -15,7 +15,7 @@ events {
{% endif %} {% endif %}
http { http {
include /etc/nginx/mime.types; include {{ nginx_mime_file_path }};
default_type application/octet-stream; default_type application/octet-stream;
server_names_hash_bucket_size 64; server_names_hash_bucket_size 64;

@ -1,5 +1,8 @@
--- ---
root_group: root
nginx_conf_path: /etc/nginx/conf.d nginx_conf_path: /etc/nginx/conf.d
nginx_conf_file_path: /etc/nginx/nginx.conf
nginx_mime_file_path: /etc/nginx/mime.types
nginx_pidfile: /run/nginx.pid nginx_pidfile: /run/nginx.pid
nginx_vhost_path: /etc/nginx/sites-enabled nginx_vhost_path: /etc/nginx/sites-enabled
nginx_default_vhost_path: /etc/nginx/sites-enabled/default nginx_default_vhost_path: /etc/nginx/sites-enabled/default

@ -0,0 +1,9 @@
---
root_group: wheel
nginx_conf_path: /usr/local/etc/nginx/conf.d
nginx_conf_file_path: /usr/local/etc/nginx/nginx.conf
nginx_mime_file_path: /usr/local/etc/nginx/mime.types
nginx_pidfile: /var/run/nginx.pid
nginx_vhost_path: /usr/local/etc/nginx/sites-enabled
nginx_default_vhost_path: /usr/local/etc/nginx/sites-enabled/default
__nginx_user: "www"

@ -1,5 +1,8 @@
--- ---
root_group: root
nginx_conf_path: /etc/nginx/conf.d nginx_conf_path: /etc/nginx/conf.d
nginx_conf_file_path: /etc/nginx/nginx.conf
nginx_mime_file_path: /etc/nginx/mime.types
nginx_pidfile: /var/run/nginx.pid nginx_pidfile: /var/run/nginx.pid
nginx_vhost_path: /etc/nginx/conf.d nginx_vhost_path: /etc/nginx/conf.d
nginx_default_vhost_path: /etc/nginx/conf.d/default.conf nginx_default_vhost_path: /etc/nginx/conf.d/default.conf