Add default weight

This commit is contained in:
Antonio J. Delgado 2022-12-07 14:15:01 +02:00
parent 71373ccf00
commit 18f00c5e5f

View file

@ -82,7 +82,7 @@
- name: Ensure vhosts are configured - name: Ensure vhosts are configured
template: template:
src: templates/vhost.conf.j2 src: templates/vhost.conf.j2
dest: "/etc/apache2/sites-available/{{ item.weight }}-{{ item.vhostname }}.conf" dest: "/etc/apache2/sites-available/{{ item.weight | default('25' }}-{{ item.vhostname }}.conf"
owner: root owner: root
group: root group: root
mode: '0644' mode: '0644'
@ -93,8 +93,8 @@
- name: Ensure vhost is enabled - name: Ensure vhost is enabled
file: file:
src: "/etc/apache2/sites-available/{{ item.weight }}-{{ item.vhostname }}.conf" src: "/etc/apache2/sites-available/{{ item.weight | default('25') }}-{{ item.vhostname }}.conf"
dest: "/etc/apache2/sites-enabled/{{ item.weight }}-{{ item.vhostname }}.conf" dest: "/etc/apache2/sites-enabled/{{ item.weight | default('25') }}-{{ item.vhostname }}.conf"
state: link state: link
with_items: "{{ vhosts }}" with_items: "{{ vhosts }}"
notify: notify: