First try at the redirectmatch role, ported from puppet.
This commit is contained in:
parent
7d59bbd0fd
commit
9e33435096
4 changed files with 29 additions and 0 deletions
|
@ -161,6 +161,12 @@
|
|||
website: fedoraproject.org
|
||||
target: https://fedoraproject.org/en/get-fedora#clouds
|
||||
|
||||
- role: httpd/redirectmatch
|
||||
name: redirect-cloudstart
|
||||
website: redirect.fedoraproject.org
|
||||
regex: /(console\.aws\.amazon\.com/ec2/v2/home.*)$
|
||||
target: https://$1
|
||||
|
||||
## Cloud image redirects
|
||||
# Redirects/pointers for fedora 20 cloud images
|
||||
- role: httpd/redirect
|
||||
|
|
21
roles/httpd/redirectmatch/tasks/main.yml
Normal file
21
roles/httpd/redirectmatch/tasks/main.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
# This is a generic role for specifying redirects. When I ported this over from
|
||||
# puppet, I looked first at trying to combine all of our redirects into one
|
||||
# perhaps easier to manage master redirects file. The trouble I hit was that
|
||||
# certain redirects need to apply in the context of certain VirtualHost entries
|
||||
# while not in others. Consequently, we use this template to stuff the redirect
|
||||
# role only into the {{website}}/ folder for each site.
|
||||
|
||||
# This is the only real work we do.
|
||||
- name: Copy over httpd redirectmatch file for {{name}}
|
||||
template: >
|
||||
src=redirectmatch.conf
|
||||
dest=/etc/httpd/conf.d/{{website}}/{{name}}-redirectmatch.conf
|
||||
mode=0644
|
||||
owner=root
|
||||
group=root
|
||||
notify:
|
||||
- restart httpd
|
||||
tags:
|
||||
- httpd
|
||||
- httpd/redirect
|
||||
- httpd/redirectmatch
|
1
roles/httpd/redirectmatch/templates/redirectmatch.conf
Normal file
1
roles/httpd/redirectmatch/templates/redirectmatch.conf
Normal file
|
@ -0,0 +1 @@
|
|||
RedirectMatch {{ status }} {{ regex }} {{ target }}
|
1
roles/httpd/redirectmatch/vars/main.yml
Normal file
1
roles/httpd/redirectmatch/vars/main.yml
Normal file
|
@ -0,0 +1 @@
|
|||
status: 301
|
Loading…
Add table
Add a link
Reference in a new issue