static: move site setup to a loop
Remove some repeated boilerplate by moving this into a loop. No functional change. Change-Id: Id99e0c8cc6f663e054d69872b3da6eeb543cf3b5
This commit is contained in:
parent
047eae459d
commit
52ef51ca2a
14
playbooks/roles/static/tasks/enable_site.yaml
Normal file
14
playbooks/roles/static/tasks/enable_site.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
- name: Add custom default site
|
||||
copy:
|
||||
src: '{{ item }}.conf'
|
||||
dest: /etc/apache2/sites-available/
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: 'Enable {{ item }}'
|
||||
command: 'a2ensite {{ item }}'
|
||||
args:
|
||||
creates: '/etc/apache2/sites-enabled/{{ item }}'
|
||||
notify:
|
||||
- Reload apache2
|
@ -50,136 +50,19 @@
|
||||
state: present
|
||||
name: headers
|
||||
|
||||
|
||||
# Default site
|
||||
- name: Make sure packaged default site disabled
|
||||
command: a2dissite 000-default.conf
|
||||
args:
|
||||
removes: /etc/apache2/sites-enabled/000-default.conf
|
||||
|
||||
- name: Add custom default site
|
||||
copy:
|
||||
src: 00-static.opendev.org.conf
|
||||
dest: /etc/apache2/sites-available/
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Enable static.opendev.org
|
||||
command: a2ensite 00-static.opendev.org
|
||||
args:
|
||||
creates: /etc/apache2/sites-enabled/00-static.opendev.org
|
||||
notify:
|
||||
- Reload apache2
|
||||
|
||||
# governance.openstack.org
|
||||
- name: Install governance.openstack.org
|
||||
copy:
|
||||
src: 50-governance.openstack.org.conf
|
||||
dest: /etc/apache2/sites-available/
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Enable governance.openstack.org
|
||||
command: a2ensite 50-governance.openstack.org
|
||||
args:
|
||||
creates: /etc/apache2/sites-enabled/50-governance.openstack.org
|
||||
notify:
|
||||
- Reload apache2
|
||||
|
||||
# security.openstack.org
|
||||
- name: Install security.openstack.org
|
||||
copy:
|
||||
src: 50-security.openstack.org.conf
|
||||
dest: /etc/apache2/sites-available/
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Enable security.openstack.org
|
||||
command: a2ensite 50-security.openstack.org
|
||||
args:
|
||||
creates: /etc/apache2/sites-enabled/50-security.openstack.org
|
||||
notify:
|
||||
- Reload apache2
|
||||
|
||||
# tarballs.opendev.org
|
||||
- name: Install tarballs.opendev.org
|
||||
copy:
|
||||
src: 50-tarballs.opendev.org.conf
|
||||
dest: /etc/apache2/sites-available/
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Enable tarballs.opendev.org
|
||||
command: a2ensite 50-tarballs.opendev.org
|
||||
args:
|
||||
creates: /etc/apache2/sites-enabled/50-tarballs.opendev.org
|
||||
notify:
|
||||
- Reload apache2
|
||||
|
||||
# tarballs.openstack.org
|
||||
- name: Install tarballs.openstack.org
|
||||
copy:
|
||||
src: 50-tarballs.openstack.org.conf
|
||||
dest: /etc/apache2/sites-available/
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Enable tarballs.openstack.org
|
||||
command: a2ensite 50-tarballs.openstack.org
|
||||
args:
|
||||
creates: /etc/apache2/sites-enabled/50-tarballs.openstack.org
|
||||
notify:
|
||||
- Reload apache2
|
||||
|
||||
# specs.openstack.org
|
||||
- name: Install specs.openstack.org
|
||||
copy:
|
||||
src: 50-specs.openstack.org.conf
|
||||
dest: /etc/apache2/sites-available/
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Enable specs.openstack.org
|
||||
command: a2ensite 50-specs.openstack.org
|
||||
args:
|
||||
creates: /etc/apache2/sites-enabled/50-specs.openstack.org
|
||||
notify:
|
||||
- Reload apache2
|
||||
|
||||
# service-types.openstack.org
|
||||
- name: Install service-types.openstack.org
|
||||
copy:
|
||||
src: 50-service-types.openstack.org.conf
|
||||
dest: /etc/apache2/sites-available/
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Enable service-types.openstack.org
|
||||
command: a2ensite 50-service-types.openstack.org
|
||||
args:
|
||||
creates: /etc/apache2/sites-enabled/50-service-types.openstack.org
|
||||
notify:
|
||||
- Reload apache2
|
||||
|
||||
# releases.openstack.org
|
||||
- name: Install releases.openstack.org
|
||||
copy:
|
||||
src: 50-releases.openstack.org.conf
|
||||
dest: /etc/apache2/sites-available/
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Enable releases.openstack.org
|
||||
command: a2ensite 50-releases.openstack.org
|
||||
args:
|
||||
creates: /etc/apache2/sites-enabled/50-releases.openstack.org
|
||||
notify:
|
||||
- Reload apache2
|
||||
- name: Enable sites
|
||||
include_tasks: enable_site.yaml
|
||||
loop:
|
||||
- 00-static.opendev.org
|
||||
- 50-governance.openstack.org
|
||||
- 50-security.openstack.org
|
||||
- 50-service-types.openstack.org
|
||||
- 50-specs.openstack.org
|
||||
- 50-releases.openstack.org
|
||||
- 50-tarballs.opendev.org
|
||||
- 50-tarballs.openstack.org
|
||||
|
Loading…
x
Reference in New Issue
Block a user