First try at the redirectmatch role, ported from puppet.

This commit is contained in:
Ralph Bean 2014-12-07 20:01:50 +00:00
parent 7d59bbd0fd
commit 9e33435096
4 changed files with 29 additions and 0 deletions

View file

@ -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

View 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

View file

@ -0,0 +1 @@
RedirectMatch {{ status }} {{ regex }} {{ target }}

View file

@ -0,0 +1 @@
status: 301