🔥 Drop FreeBSD support
							parent
							
								
									9a52e83315
								
							
						
					
					
						commit
						1aaf0351b4
					
				
								
									
									
										
											14
										
									
									README.md
									
									
									
									
								
								
							
							
										
											14
										
									
									README.md
									
									
									
									
								| 
						 | 
				
			
			@ -1,9 +1,9 @@
 | 
			
		|||
Nginx for Debian/FreeBSD Ansible role
 | 
			
		||||
Nginx for Debian/Ubuntu Ansible role
 | 
			
		||||
=====================================
 | 
			
		||||
 | 
			
		||||
[](https://galaxy.ansible.com/HanXHX/nginx/) 
 | 
			
		||||
 | 
			
		||||
Install and configure Nginx on Debian/FreeBSD.
 | 
			
		||||
Install and configure Nginx on Debian/Ubuntu.
 | 
			
		||||
 | 
			
		||||
Features:
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -27,8 +27,6 @@ Supported OS:
 | 
			
		|||
| Debian Buster (10)   | Yes     | Yes                                                                                                  |
 | 
			
		||||
| Debian Bullseye (11) | Yes     | Yes                                                                                                  |
 | 
			
		||||
| Debian Bookworm (12) | Yes     | Not yet :)                                                                                           |
 | 
			
		||||
| FreeBSD 11           | NA      | No                                                                                                   |
 | 
			
		||||
| FreeBSD 12           | NA      | No                                                                                                   |
 | 
			
		||||
| Ubuntu 20.04         | Yes     | Yes                                                                                                  |
 | 
			
		||||
| Ubuntu 22.04         | Yes     | Yes                                                                                                  |
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -48,10 +46,6 @@ Debian:
 | 
			
		|||
- `nginx_apt_package`: APT nginx package (try: apt-cache search ^nginx)
 | 
			
		||||
- `nginx_backports`: Install nginx from backport repository (bool)
 | 
			
		||||
 | 
			
		||||
FreeBSD:
 | 
			
		||||
 | 
			
		||||
- `nginx_pkgng_package`: PKGNG nginx package (should be "nginx" or "nginx-devel")
 | 
			
		||||
 | 
			
		||||
### Shared
 | 
			
		||||
 | 
			
		||||
- `nginx_root`: root directory where you want to have your files
 | 
			
		||||
| 
						 | 
				
			
			@ -72,7 +66,6 @@ FreeBSD:
 | 
			
		|||
- `nginx_custom_core`: instructions list (for core, will put data in `/etc/nginx/nginx.conf`)
 | 
			
		||||
- `nginx_custom_http`: instructions list (will put data in `/etc/nginx/conf.d/custom.conf`)
 | 
			
		||||
- `nginx_module_packages`: package list module to install (Debian)
 | 
			
		||||
- `nginx_load_modules`: module list to load (full path), should be used only on FreeBSD
 | 
			
		||||
 | 
			
		||||
### Misc
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -96,15 +89,12 @@ Fine configuration
 | 
			
		|||
 | 
			
		||||
[Basic Auth](doc/auth.md)
 | 
			
		||||
 | 
			
		||||
[FreeBSD](doc/freebsd.md)
 | 
			
		||||
 | 
			
		||||
[acme.sh](doc/acme.md)
 | 
			
		||||
 | 
			
		||||
Note
 | 
			
		||||
----
 | 
			
		||||
 | 
			
		||||
- Active support for Debian/Ubuntu.
 | 
			
		||||
- FreeBSD support is experimental. I only test (for the moment) 10.2 (but it can work on other versions).
 | 
			
		||||
 | 
			
		||||
Dependencies
 | 
			
		||||
------------
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,8 +3,6 @@
 | 
			
		|||
# Debian
 | 
			
		||||
nginx_apt_package: nginx-full
 | 
			
		||||
nginx_backports: false
 | 
			
		||||
# FreeBSD
 | 
			
		||||
nginx_pkgng_package: nginx
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Nginx shared variables
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,12 +0,0 @@
 | 
			
		|||
Freebsd
 | 
			
		||||
=======
 | 
			
		||||
 | 
			
		||||
Limitations
 | 
			
		||||
-----------
 | 
			
		||||
 | 
			
		||||
Due to Ansible + FreeBSD limitations (`ansible_processor_vcpus`), You must explicitely set `nginx_worker_processes`.
 | 
			
		||||
 | 
			
		||||
About modules
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
Dynamic modules must be set with full path (see `nginx_load_modules` path).
 | 
			
		||||
| 
						 | 
				
			
			@ -4,7 +4,7 @@ galaxy_info:
 | 
			
		|||
  author: Emilien Mantel
 | 
			
		||||
  namespace: hanxhx
 | 
			
		||||
  role_name: nginx
 | 
			
		||||
  description: Nginx for Debian / FreeBSD
 | 
			
		||||
  description: Nginx for Debian / Ubuntu
 | 
			
		||||
  company: TripleStack
 | 
			
		||||
  license: GPLv2
 | 
			
		||||
  min_ansible_version: '2.11'
 | 
			
		||||
| 
						 | 
				
			
			@ -18,11 +18,6 @@ galaxy_info:
 | 
			
		|||
      versions:
 | 
			
		||||
        - focal
 | 
			
		||||
        - jammy
 | 
			
		||||
    - name: FreeBSD
 | 
			
		||||
      versions:
 | 
			
		||||
        - '11.0'
 | 
			
		||||
        - '11.1'
 | 
			
		||||
        - '12.0'
 | 
			
		||||
  galaxy_tags:
 | 
			
		||||
    - web
 | 
			
		||||
    - debian
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,7 @@
 | 
			
		|||
# Internal vars
 | 
			
		||||
int_ansible_ssl_dir: '/etc/ansible-ssl'
 | 
			
		||||
# Role vars
 | 
			
		||||
nginx_worker_processes: 1    # Ansible+FreeBSD can't detect CPU number
 | 
			
		||||
nginx_worker_processes: 1    # Ansible can't detect CPU count
 | 
			
		||||
nginx_apt_package: 'nginx-extras'
 | 
			
		||||
nginx_module_packages: ['libnginx-mod-http-headers-more-filter']
 | 
			
		||||
nginx_custom_core:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,59 +0,0 @@
 | 
			
		|||
---
 | 
			
		||||
 | 
			
		||||
- name: PKGNG | Install nginx and related tools
 | 
			
		||||
  community.general.pkgng:
 | 
			
		||||
    name: "{{ item }}"
 | 
			
		||||
    state: present
 | 
			
		||||
  loop:
 | 
			
		||||
    - acme.sh
 | 
			
		||||
    - "{{ nginx_pkgng_package }}"
 | 
			
		||||
    - py27-passlib
 | 
			
		||||
    - curl
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Bypass https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224166#c1
 | 
			
		||||
#
 | 
			
		||||
- name: Bypass https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224166#c1
 | 
			
		||||
  when: true
 | 
			
		||||
  block:
 | 
			
		||||
 | 
			
		||||
    - name: COMMAND | Create /usr/local/etc/fdfs/http.conf
 | 
			
		||||
      ansible.builtin.command: touch /usr/local/etc/fdfs/http.conf
 | 
			
		||||
      args:
 | 
			
		||||
        creates: /usr/local/etc/fdfs/http.conf
 | 
			
		||||
      notify: Restart nginx
 | 
			
		||||
 | 
			
		||||
    - name: LINEINFILE | Tune fdfs
 | 
			
		||||
      ansible.builtin.lineinfile:
 | 
			
		||||
        regexp: ^load_fdfs_parameters_from_tracker
 | 
			
		||||
        line: load_fdfs_parameters_from_tracker=false
 | 
			
		||||
        path: /usr/local/etc/fdfs/mod_fastdfs.conf
 | 
			
		||||
      notify: Restart nginx
 | 
			
		||||
 | 
			
		||||
    - name: META | Flush handlers (Restart nginx when fdfs is tuned)
 | 
			
		||||
      ansible.builtin.meta: flush_handlers
 | 
			
		||||
 | 
			
		||||
- name: FILE | Create configuration dir (like Debian)
 | 
			
		||||
  ansible.builtin.file:
 | 
			
		||||
    path: "{{ nginx_etc_dir }}/{{ item }}"
 | 
			
		||||
    state: directory
 | 
			
		||||
    mode: 0755
 | 
			
		||||
    owner: root
 | 
			
		||||
    group: root
 | 
			
		||||
  loop:
 | 
			
		||||
    - conf.d
 | 
			
		||||
    - sites-available
 | 
			
		||||
    - sites-enabled
 | 
			
		||||
 | 
			
		||||
- name: FILE | Create log directory
 | 
			
		||||
  ansible.builtin.file:
 | 
			
		||||
    path: "{{ nginx_log_dir }}"
 | 
			
		||||
    owner: "{{ nginx_user }}"
 | 
			
		||||
    group: wheel
 | 
			
		||||
    mode: 0755
 | 
			
		||||
    state: directory
 | 
			
		||||
 | 
			
		||||
- name: SERVICE | Enable nginx
 | 
			
		||||
  ansible.builtin.service:
 | 
			
		||||
    name: nginx
 | 
			
		||||
    enabled: true
 | 
			
		||||
| 
						 | 
				
			
			@ -1,7 +0,0 @@
 | 
			
		|||
---
 | 
			
		||||
 | 
			
		||||
nginx_events_use: 'kqueue'
 | 
			
		||||
nginx_pid: '/var/run/nginx.pid'
 | 
			
		||||
nginx_etc_dir: '/usr/local/etc/nginx'
 | 
			
		||||
 | 
			
		||||
nginx_acmesh_bin: '/usr/local/sbin/acme.sh'
 | 
			
		||||
		Loading…
	
		Reference in New Issue