Skip to content

Instantly share code, notes, and snippets.

@PC-Admin
Created November 30, 2020 11:40
Show Gist options
  • Save PC-Admin/58a8158c05bf4e6ad66b9fb46dcd935a to your computer and use it in GitHub Desktop.
Save PC-Admin/58a8158c05bf4e6ad66b9fb46dcd935a to your computer and use it in GitHub Desktop.
# AWX 'setup-synapse' Templating Bug
AWX versions:
- Python 3.6.8
- ansible 2.9.14
- AWX 15.0.1
Here is the vars settings i am using that are related:
```
# Synapse Settings
matrix_synapse_auto_join_rooms: ['#announcements:cheesedomain.xyz', '#main:cheesedomain.xyz']
# Synapse Extension
matrix_synapse_configuration_extension_yaml: |
autocreate_auto_join_rooms: true
```
When i run the playbook with 'setup-all,start' tags it completes without error. (But also doesn't apply these settings!)
But when i try running it with 'setup-synapse,start' i get this error:
```
TASK [matrix-synapse : Ensure Synapse homeserver config installed] *************
{
"msg": "An unhandled exception occurred while templating '{{ matrix_synapse_configuration_yaml|from_yaml|combine(matrix_synapse_configuration_extension, recursive=True) }}'. Error was a <class 'yaml.scanner.ScannerError'>, original message: while scanning a simple key\n in \"<unicode string>\", line 1221, column 1:\n '#announcements:cheesedomain.xyz ... \n ^\ncould not find expected ':'\n in \"<unicode string>\", line 1238, column 1:\n autocreate_auto_join_rooms: true\n ^",
"_ansible_no_log": false
}
```
Strangely I cannot replicate the bug outside of AWX, I tried running it locally using these versions:
- ansible 2.9.14
- Python 3.7.3
The guilty playbook task:
```
- name: Ensure Synapse homeserver config installed
copy:
content: "{{ matrix_synapse_configuration|to_nice_yaml }}"
dest: "{{ matrix_synapse_config_dir_path }}/homeserver.yaml"
mode: 0644
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}"
```
What to try?
- Different version of python3 on the AWX side?
- Double quotes instead of single? No quotes?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment