mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-24 21:51:03 +01:00
renamed nginx roles
This commit is contained in:
parent
7fa215a414
commit
37db95dfe7
@ -46,7 +46,7 @@
|
|||||||
hosts: redirect
|
hosts: redirect
|
||||||
become: true
|
become: true
|
||||||
roles:
|
roles:
|
||||||
- role: https-redirect
|
- role: nginx-redirect
|
||||||
vars:
|
vars:
|
||||||
domain_mappings: "{{redirect_domain_mappings}}"
|
domain_mappings: "{{redirect_domain_mappings}}"
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- docker
|
- docker
|
||||||
- https-server
|
- nginx-https
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
dependencies:
|
|
||||||
- https-server
|
|
@ -1,5 +0,0 @@
|
|||||||
# native https-redirect
|
|
||||||
|
|
||||||
## see
|
|
||||||
- https://stackoverflow.com/questions/6045020/how-to-redirect-to-a-different-domain-using-nginx
|
|
||||||
- https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html
|
|
@ -7,7 +7,7 @@ This Ansible role configures an Nginx server to serve a static homepage. It hand
|
|||||||
- Ansible 2.9 or higher
|
- Ansible 2.9 or higher
|
||||||
- Nginx installed on the target machine
|
- Nginx installed on the target machine
|
||||||
- Git installed on the target machine (if cloning a repo)
|
- Git installed on the target machine (if cloning a repo)
|
||||||
- `https-server` and `git` roles available or configured if they are used as dependencies
|
- `nginx-https` and `git` roles available or configured if they are used as dependencies
|
||||||
|
|
||||||
## Role Variables
|
## Role Variables
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ This Ansible role configures an Nginx server to serve a static homepage. It hand
|
|||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
- `https-server`: A role for setting up an HTTPS server
|
- `nginx-https`: A role for setting up an HTTPS server
|
||||||
- `git`: A role for installing Git
|
- `git`: A role for installing Git
|
||||||
|
|
||||||
## Example Playbook
|
## Example Playbook
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- https-server
|
- nginx-https
|
||||||
- git
|
- git
|
||||||
|
2
roles/nginx-redirect/meta/main.yml
Normal file
2
roles/nginx-redirect/meta/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
dependencies:
|
||||||
|
- nginx-https
|
29
roles/nginx-redirect/readme.md
Normal file
29
roles/nginx-redirect/readme.md
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Nginx Redirect Role
|
||||||
|
|
||||||
|
This Ansible role configures Nginx to perform 301 redirects from one domain to another. It handles SSL certificate retrieval for the source domains and sets up the Nginx configuration to redirect to the specified target domains.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- Ansible 2.9 or higher
|
||||||
|
- Nginx installed on the target machine
|
||||||
|
- Let's Encrypt for SSL certificate management
|
||||||
|
|
||||||
|
## Role Variables
|
||||||
|
|
||||||
|
- `domain_mappings`: A list of objects with `source` and `target` properties specifying the domains to redirect from and to.
|
||||||
|
- `administrator_email`: The email used for SSL certificate registration with Let's Encrypt.
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
- `nginx-https`: A role for setting up HTTPS for Nginx
|
||||||
|
- `letsencrypt`: A role for managing SSL certificates with Let's Encrypt
|
||||||
|
|
||||||
|
## Example Playbook
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- hosts: servers
|
||||||
|
roles:
|
||||||
|
- { role: nginx-redirect, domain_mappings: [ {source: 'example.com', target: 'newdomain.com'} ] }
|
||||||
|
|
||||||
|
## Author Information
|
||||||
|
This role was created in 2023 by Kevin Veen Birkenbach.
|
Loading…
Reference in New Issue
Block a user