diff --git a/playbooks/groups/proxies-redirects.yml b/playbooks/groups/proxies-redirects.yml index ada915f86a..c5d3f12338 100644 --- a/playbooks/groups/proxies-redirects.yml +++ b/playbooks/groups/proxies-redirects.yml @@ -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 diff --git a/roles/httpd/redirectmatch/tasks/main.yml b/roles/httpd/redirectmatch/tasks/main.yml new file mode 100644 index 0000000000..defbb79e2b --- /dev/null +++ b/roles/httpd/redirectmatch/tasks/main.yml @@ -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 diff --git a/roles/httpd/redirectmatch/templates/redirectmatch.conf b/roles/httpd/redirectmatch/templates/redirectmatch.conf new file mode 100644 index 0000000000..4de6cf7879 --- /dev/null +++ b/roles/httpd/redirectmatch/templates/redirectmatch.conf @@ -0,0 +1 @@ +RedirectMatch {{ status }} {{ regex }} {{ target }} diff --git a/roles/httpd/redirectmatch/vars/main.yml b/roles/httpd/redirectmatch/vars/main.yml new file mode 100644 index 0000000000..82ade1a935 --- /dev/null +++ b/roles/httpd/redirectmatch/vars/main.yml @@ -0,0 +1 @@ +status: 301