system-config/playbooks/roles/static/tasks/enable_git_site.yaml
Ian Wienand b5266ea20c static: provide git services
This creates the redirect sites

 git.airshipit.org
 git.openstack.org
 git.starlingx.io
 git.zuul-ci.org

The htaccess rules are put into the main configuration file to avoid
having to create a directory and manage another file.  We use a macro
to duplicate the rules and retain the old semantics of the http site
redirecting directly (as opposed to doing a extra 301 to
https://git.openstack.org first).  This required adding "/" to the "^"
matches as it now runs in VirtualHost context; no functional change is
intended over the old sites.

This will require _acme-challenge CNAMEs to acme.opendev.org before
being merged.

testinfra is updated to exercise some redirects matching against the
results of the extant sites.

Change-Id: Iaa9d5dc2af3f5f8abc11c2312e4308b50f5fcd2b
2020-02-26 12:27:13 +11:00

14 lines
358 B
YAML

- name: 'Add git site {{ hostname }}'
template:
src: '50-git.conf.j2'
dest: '/etc/apache2/sites-available/50-{{ hostname }}.conf'
owner: root
group: root
mode: 0644
- name: 'Enable {{ hostname }}'
command: 'a2ensite 50-{{ hostname }}'
args:
creates: '/etc/apache2/sites-enabled/50-{{ hostname }}'
notify:
- Reload apache2