# These well-known files may be served without a `Content-Type: application/json` header,
# so we can't rely on the uri module's automatic parsing of JSON.
- name:Check .well-known on the matrix hostname
- name:Check .well-known on the matrix hostname
uri:
uri:
url:"{{ well_known_url_matrix }}"
url:"{{ well_known_url_matrix }}"
follow_redirects:false
follow_redirects:false
return_content:true
register:result_well_known_matrix
register:result_well_known_matrix
ignore_errors:true
ignore_errors:true
- name:Fail if .well-known not working on the matrix hostname
- name:Fail if .well-known not working on the matrix hostname
fail:
fail:
msg:"Failed checking well-known is configured at `{{ hostname_matrix }}` (checked endpoint: `{{ well_known_url_matrix }}`). Is port 443 open in your firewall? Full error: {{ result_well_known_matrix }}"
msg:"Failed checking that well-known is configured at `{{ hostname_matrix }}` (checked endpoint: `{{ well_known_url_matrix }}`). Is port 443 open in your firewall? Full error: {{ result_well_known_matrix }}"
when:"result_well_known_matrix.failed or 'json' not in result_well_known_matrix"
when:"result_well_known_matrix.failed"
- name:Parse JSON for well-known payload at the matrix hostname
- name:Fail if .well-known not CORS-aware on the matrix hostname
- name:Fail if .well-known not CORS-aware on the matrix hostname
fail:
fail:
@ -26,18 +32,22 @@
debug:
debug:
msg:"well-known is configured correctly for `{{ hostname_matrix }}` (checked endpoint: `{{ well_known_url_matrix }}`)"
msg:"well-known is configured correctly for `{{ hostname_matrix }}` (checked endpoint: `{{ well_known_url_matrix }}`)"
- name:Check .well-known on the identity hostname
- name:Check .well-known on the identity hostname
uri:
uri:
url:"{{ well_known_url_identity }}"
url:"{{ well_known_url_identity }}"
follow_redirects:false
follow_redirects:false
return_content:true
register:result_well_known_identity
register:result_well_known_identity
ignore_errors:true
ignore_errors:true
- name:Fail if .well-known not working on the identity hostname
- name:Fail if .well-known not working on the identity hostname
fail:
fail:
msg:"Failed checking well-known is configured at `{{ hostname_identity }}` (checked endpoint: `{{ well_known_url_identity }}`). Is port 443 open in your firewall? Full error: {{ result_well_known_identity }}"
msg:"Failed checking that well-known is configured at `{{ hostname_identity }}` (checked endpoint: `{{ well_known_url_identity }}`). Is port 443 open in your firewall? Full error: {{ result_well_known_identity }}"
when:"result_well_known_identity.failed or 'json' not in result_well_known_identity"
when:"result_well_known_identity.failed"
- name:Parse JSON for well-known payload at the identity hostname
- name:Fail if .well-known not CORS-aware on the identity hostname
- name:Fail if .well-known not CORS-aware on the identity hostname
fail:
fail:
@ -48,7 +58,7 @@
- name:Fail if well-known is different on matrix hostname and identity hostname
- name:Fail if well-known is different on matrix hostname and identity hostname
fail:
fail:
msg:"The well-known files at `{{ hostname_matrix }}` and `{{ hostname_identity }}` are different. Perhaps you copied the file manually before and now it's outdated?"
msg:"The well-known files at `{{ hostname_matrix }}` and `{{ hostname_identity }}` are different. Perhaps you copied the file manually before and now it's outdated?"