Compare commits

...

4 Commits

Author SHA1 Message Date
Nicolas de Ferrières b7e8446a47
Merge ba3b82dcd7 into dbd7d57194 2024-03-25 12:05:31 +01:00
Jeff Geerling dbd7d57194
Merge pull request #248 from jon4hz/master
feat: support suse
2024-03-23 23:03:16 -05:00
jon4hz 016415bdaf
feat: support suse 2024-03-23 23:30:35 +01:00
Nicolas de Ferrières ba3b82dcd7
enh: Allow default vhost path override 2023-11-23 19:30:00 +01:00
14 changed files with 44 additions and 8 deletions

View File

@ -44,6 +44,7 @@ jobs:
- rockylinux9
- ubuntu2204
- debian12
- opensuseleap15
steps:
- name: Check out the codebase.

2
.gitignore vendored
View File

@ -3,3 +3,5 @@
*.pyc
.cache
venv/
.vscode/

View File

@ -65,7 +65,7 @@ An example of a secondary vhost which will redirect to the one shown above.
nginx_remove_default_vhost: false
Whether to remove the 'default' virtualhost configuration supplied by Nginx. Useful if you want the base `/` URL to be directed at one of your own virtual hosts configured in a separate .conf file.
Whether to remove the 'default' virtualhost configuration supplied by Nginx. Useful if you want the base `/` URL to be directed at one of your own virtual hosts configured in a separate .conf file. You can optionnaly set `nginx_override_default_vhost_path` if the default vhost file determined by distribution name is not the correct one (for example: since nginx 1.24 Debian package from nginx repository, vhost default file supplied is '/etc/nginx/conf.d/default.conf' instead of '/etc/nginx/sites-enabled/default' previously).
nginx_upstreams: []
@ -155,6 +155,10 @@ Configures Nginx's [`log_format`](http://nginx.org/en/docs/http/ngx_http_log_mod
(For RedHat/CentOS only) Set this to `false` to disable the installation of the `nginx` yum repository. This could be necessary if you want the default OS stable packages, or if you use Satellite.
nginx_zypper_repo_enabled: true
(For Suse only) Set this to `false` to disable the installation of the `nginx` zypper repository. This could be necessary if you want the default OS stable packages, or if you use Suse Manager.
nginx_service_state: started
nginx_service_enabled: yes

View File

@ -5,6 +5,9 @@ nginx_default_release: ""
# Used only for Redhat installation, enables source Nginx repo.
nginx_yum_repo_enabled: true
# Used only for Suse installation, enables source Nginx repo.
nginx_zypper_repo_enabled: true
# Use the official Nginx PPA for Ubuntu, and the version to use if so.
nginx_ppa_use: false
nginx_ppa_version: stable

View File

@ -27,6 +27,9 @@
- include_tasks: setup-Archlinux.yml
when: ansible_os_family == 'Archlinux'
- include_tasks: setup-Suse.yml
when: ansible_os_family == 'Suse'
# Vhost configuration.
- import_tasks: vhosts.yml

14
tasks/setup-Suse.yml Normal file
View File

@ -0,0 +1,14 @@
---
- name: Enable nginx repo.
zypper_repository:
name: nginx
repo: http://nginx.org/packages/sles/{{ ansible_distribution_major_version }}
state: present
disable_gpg_check: true
autorefresh: true
when: nginx_zypper_repo_enabled | bool
- name: Ensure nginx is installed.
package:
name: "{{ nginx_package_name }}"
state: present

View File

@ -5,5 +5,5 @@ nginx_conf_file_path: /etc/nginx/nginx.conf
nginx_mime_file_path: /etc/nginx/mime.types
nginx_pidfile: /var/run/nginx.pid
nginx_vhost_path: /etc/nginx/conf.d
nginx_default_vhost_path: /etc/nginx/conf.d/default.conf
nginx_default_vhost_path: "{{ nginx_override_default_vhost_path | default('/etc/nginx/conf.d/default.conf') }}"
__nginx_user: "nginx"

View File

@ -5,5 +5,5 @@ nginx_conf_file_path: /etc/nginx/nginx.conf
nginx_mime_file_path: /etc/nginx/mime.types
nginx_pidfile: /run/nginx.pid
nginx_vhost_path: /etc/nginx/sites-enabled
nginx_default_vhost_path: /etc/nginx/sites-enabled/default
nginx_default_vhost_path: "{{ nginx_override_default_vhost_path | default('/etc/nginx/sites-enabled/default') }}"
__nginx_user: "http"

View File

@ -5,5 +5,5 @@ nginx_conf_file_path: /etc/nginx/nginx.conf
nginx_mime_file_path: /etc/nginx/mime.types
nginx_pidfile: /run/nginx.pid
nginx_vhost_path: /etc/nginx/sites-enabled
nginx_default_vhost_path: /etc/nginx/sites-enabled/default
nginx_default_vhost_path: "{{ nginx_override_default_vhost_path | default('/etc/nginx/sites-enabled/default') }}"
__nginx_user: "www-data"

View File

@ -5,5 +5,5 @@ 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_default_vhost_path: "{{ nginx_override_default_vhost_path | default('/usr/local/etc/nginx/sites-enabled/default') }}"
__nginx_user: "www"

View File

@ -5,6 +5,6 @@ nginx_conf_file_path: /etc/nginx/nginx.conf
nginx_mime_file_path: /etc/nginx/mime.types
nginx_pidfile: /var/run/nginx.pid
nginx_vhost_path: /etc/nginx/sites-enabled
nginx_default_vhost_path: /etc/nginx/sites-enabled/default
nginx_default_vhost_path: "{{ nginx_override_default_vhost_path | default('/etc/nginx/sites-enabled/default') }}"
nginx_package_name: "nginx--"
__nginx_user: "www"

View File

@ -5,5 +5,5 @@ nginx_conf_file_path: /etc/nginx/nginx.conf
nginx_mime_file_path: /etc/nginx/mime.types
nginx_pidfile: /var/run/nginx.pid
nginx_vhost_path: /etc/nginx/conf.d
nginx_default_vhost_path: /etc/nginx/conf.d/default.conf
nginx_default_vhost_path: "{{ nginx_override_default_vhost_path | default('/etc/nginx/conf.d/default.conf') }}"
__nginx_user: "nginx"

View File

@ -5,5 +5,5 @@ nginx_conf_file_path: /etc/nginx/nginx.conf
nginx_mime_file_path: /etc/nginx/mime.types
nginx_pidfile: /var/run/nginx.pid
nginx_vhost_path: /etc/nginx/conf.d
nginx_default_vhost_path: /etc/nginx/conf.d/default.conf
nginx_default_vhost_path: "{{ nginx_override_default_vhost_path | default('/etc/nginx/conf.d/default.conf') }}"
__nginx_user: "nginx"

9
vars/Suse.yml Normal file
View File

@ -0,0 +1,9 @@
---
root_group: root
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_vhost_path: /etc/nginx/conf.d
nginx_default_vhost_path: /etc/nginx/conf.d/default.conf
__nginx_user: "nginx"