diff --git a/ansible/fastly.yml b/ansible/fastly.yml index 69d21e38a..9773b624d 100644 --- a/ansible/fastly.yml +++ b/ansible/fastly.yml @@ -8,22 +8,22 @@ tasks: - name: configure fastly service fastly_service: - name: "{{ item }}.theforeman.org" + name: "{{ item.service }}.theforeman.org" fastly_api_key: "{{ fastly_api_key }}" domains: - - name: "{{ item }}.theforeman.org" + - name: "{{ item.service }}.theforeman.org" backends: - - name: web01.osuosl.theforeman.org - address: web01.osuosl.theforeman.org + - name: "{{ item.backend | default('web01.osuosl') }}.theforeman.org" + address: "{{ item.backend | default('web01.osuosl') }}.theforeman.org" port: 443 shield: iad-va-us - ssl_cert_hostname: "{{ item }}.theforeman.org" - ssl_sni_hostname: "{{ item }}.theforeman.org" - override_host: "{{ item }}.theforeman.org" + ssl_cert_hostname: "{{ item.backend | default(item.service) }}.theforeman.org" + ssl_sni_hostname: "{{ item.backend | default(item.service) }}.theforeman.org" + override_host: "{{ item.backend | default(item.service) }}.theforeman.org" healthcheck: HEADER.html healthchecks: - name: HEADER.html - host: "{{ item }}.theforeman.org" + host: "{{ item.backend | default(item.service) }}.theforeman.org" path: "/HEADER.html" threshold: 1 timeout: 5000 @@ -31,9 +31,9 @@ initial: 1 check_interval: 60000 with_items: - - archivedeb - - deb - - downloads - - stagingdeb - - stagingyum - - yum + - service: archivedeb + - service: deb + - service: downloads + - service: stagingdeb + - service: stagingyum + - service: yum