diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6211057..46ee53c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,7 @@ jobs: - rockylinux9 - ubuntu2204 - debian12 + - opensuseleap15 steps: - name: Check out the codebase. diff --git a/.gitignore b/.gitignore index 8840c8f..ca75527 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ *.pyc .cache +venv/ +.vscode/ diff --git a/README.md b/README.md index 08dfeef..a15516c 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/defaults/main.yml b/defaults/main.yml index a9a5cfa..88d38f7 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/tasks/main.yml b/tasks/main.yml index 2c0dc2c..b8e309a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 diff --git a/tasks/setup-Suse.yml b/tasks/setup-Suse.yml new file mode 100644 index 0000000..038a3ae --- /dev/null +++ b/tasks/setup-Suse.yml @@ -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 diff --git a/vars/Suse.yml b/vars/Suse.yml new file mode 100644 index 0000000..0138f8d --- /dev/null +++ b/vars/Suse.yml @@ -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"