Revive the role

This commit revives the role after a long slumber. I've updated the Leap
and Debian versions and fixes some minor issues that occured while
testing.
This commit is contained in:
Felix Niederwanger 2022-06-27 09:57:17 +02:00
parent e8c580e72e
commit e9045aa96d
Signed by: phoenix
GPG key ID: 31860289A704FB3C
10 changed files with 30 additions and 37 deletions

View file

@ -1,6 +1,8 @@
---
galaxy_info:
author: Felix Niederwanger
role_name: nginx
namespace: geekoops
description: Configurable nginx setup role
company: SUSE
issue_tracker_url: https://github.com/GeekOops/geekoops-nginx/issues
@ -9,16 +11,14 @@ galaxy_info:
min_ansible_version: 2.9
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
platforms:
- name: opensuse
versions:
- 15.2
- 15.3
- 15.4
- name: debian
versions:
- buster
- bullseye
galaxy_tags:
- nginx

View file

@ -12,8 +12,8 @@
content: |
<html>Success! The test page is displayed correctly</html>
dest: "{{www_dir}}/index.html"
group: "{{nginxuser}}"
owner: "{{nginxgroup}}"
group: "{{ nginx_user }}"
owner: "{{ nginx_group }}"
mode: 0754
register: deployed
- name: Deploy nginx configuration

View file

@ -4,9 +4,11 @@ dependency:
driver:
name: docker
platforms:
- name: leap15_2
image: grisu48/leap-ansible
- name: leap
image: registry.opensuse.org/home/ph03nix/containers/containers/leap:ansible-leap
pre_build_image: true
command: ${MOLECULE_DOCKER_COMMAND:-"/usr/sbin/init"}
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
capabilities:
@ -14,14 +16,15 @@ platforms:
tmpfs:
- /run
- /tmp
- name: buster
image: grisu48/buster-ansible
- name: bullseye
image: grisu48/bullseye-ansible
pre_build_image: true
command: ${MOLECULE_DOCKER_COMMAND:-"/usr/sbin/init"}
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
capabilities:
- SYS_ADMIN
privileged: true
tmpfs:
- /run
- /tmp
@ -29,15 +32,11 @@ provisioner:
name: ansible
inventory:
host_vars:
leap15_2:
leap:
vhosts_dir: "/etc/nginx/vhosts.d"
nginxuser: nginx
nginxgroup: nginx
deploy_nginx_config: true
buster:
bullseye:
vhosts_dir: "/etc/nginx/sites-enabled"
nginxuser: www-data
nginxgroup: www-data
deploy_nginx_config: false
verifier:
name: testinfra

View file

@ -11,7 +11,7 @@
tags: ['nginx']
- name: Ensure default page exists
template:
src: index.html.j2
src: index.j2
dest: "{{www_dir}}/default/index.html"
owner: "{{nginx_user}}"
group: "{{nginx_group}}"

View file

@ -6,8 +6,8 @@
include_vars: "{{ansible_distribution}}_{{ansible_distribution_version}}.yml"
tags: ['nginx', 'firewall', 'systemd']
- include: software.yml
- include: firewall.yml
- include_tasks: software.yml
- include_tasks: firewall.yml
when: config_firewall == true
- include: default-page.yml
- include_tasks: default-page.yml
when: setup_default_page == true

View file

@ -1,4 +1,4 @@
## Default page handling for nginx
## Default page for nginx
server {
listen 80;
@ -12,11 +12,5 @@ server {
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
fastcgi_pass unix:{{php_socket}};
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

View file

@ -11,5 +11,5 @@ nginx_service: "nginx"
www_dir: "/var/www/html"
vhosts_dir: "/etc/nginx/sites-enabled"
nginx_user: "nginx"
nginx_group: "nginx"
nginx_user: "www-data"
nginx_group: "www-data"

View file

@ -1,5 +1,5 @@
---
# openSUSE Leap 15.2 specific variables
# openSUSE Leap 15.3 specific variables
## Software packages
@ -8,7 +8,7 @@ nginx_service: "nginx"
## OS-Specific directories
www_dir: "/srv/www/htdocs"
www_dir: "/srv/www/"
vhosts_dir: "/etc/nginx/vhosts.d"
nginx_user: "nginx"
nginx_group: "nginx"

View file

@ -1,14 +1,14 @@
---
# openSUSE Leap 15.2 specific variables
# openSUSE Leap 15.4 specific variables
## Software packages
packages: ['nginx', 'nginx-module-brotli']
packages: ['nginx']
nginx_service: "nginx"
## OS-Specific directories
www_dir: "/srv/www/htdocs"
www_dir: "/srv/www/"
vhosts_dir: "/etc/nginx/vhosts.d"
nginx_user: "nginx"
nginx_group: "nginx"