mirror of
				https://github.com/spantaleev/matrix-docker-ansible-deploy.git
				synced 2025-10-30 23:07:57 +01:00 
			
		
		
		
	Merge pull request #1101 from GoMatrixHosting/master
GoMatrixHosting v0.4.8
This commit is contained in:
		| @@ -61,18 +61,6 @@ | ||||
|       "new_question": true, | ||||
|       "variable": "matrix_client_element_registration_enabled", | ||||
|       "type": "multiplechoice" | ||||
|     }, | ||||
|     { | ||||
|       "question_name": "Set Element Subdomain", | ||||
|       "question_description": "Sets the subdomain of the Element web-client, you should only specify the subdomain, not the base domain you've already set. (Eg: 'element' for element.example.org) Note that if you change this value you'll need to reconfigure your DNS.", | ||||
|       "required": false, | ||||
|       "min": 0, | ||||
|       "max": 2048, | ||||
|       "default": "{{ element_subdomain }}", | ||||
|       "choices": "", | ||||
|       "new_question": true, | ||||
|       "variable": "element_subdomain", | ||||
|       "type": "text" | ||||
|     } | ||||
|   ] | ||||
| } | ||||
|   | ||||
							
								
								
									
										18
									
								
								roles/matrix-awx/surveys/configure_element_subdomain.json.j2
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								roles/matrix-awx/surveys/configure_element_subdomain.json.j2
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| { | ||||
|   "name": "Configure Element Subdomain", | ||||
|   "description": "Configure Element clients subdomain location. (Eg: 'element' for element.example.org)", | ||||
|   "spec": [ | ||||
|     { | ||||
|       "question_name": "Set Element Subdomain", | ||||
|       "question_description": "Sets the subdomain of the Element web-client, you should only specify the subdomain, not the base domain you've already set. (Eg: 'element' for element.example.org) Note that if you change this value you'll need to reconfigure your DNS.", | ||||
|       "required": false, | ||||
|       "min": 0, | ||||
|       "max": 2048, | ||||
|       "default": "{{ element_subdomain }}", | ||||
|       "choices": "", | ||||
|       "new_question": true, | ||||
|       "variable": "element_subdomain", | ||||
|       "type": "text" | ||||
|     } | ||||
|   ] | ||||
| } | ||||
| @@ -107,7 +107,7 @@ | ||||
|       "default": "", | ||||
|       "choices": "", | ||||
|       "new_question": true, | ||||
|       "variable": "matrix_synapse_registration_shared_secret", | ||||
|       "variable": "ext_matrix_synapse_registration_shared_secret", | ||||
|       "type": "password" | ||||
|     }, | ||||
|     { | ||||
|   | ||||
| @@ -98,6 +98,15 @@ | ||||
|   tags: | ||||
|     - setup-client-element | ||||
|  | ||||
| # Additional playbook to set the variable file during Element configuration | ||||
| - include_tasks:  | ||||
|     file: "set_variables_element_subdomain.yml" | ||||
|     apply: | ||||
|       tags: setup-client-element-subdomain | ||||
|   when: run_setup|bool and matrix_awx_enabled|bool | ||||
|   tags: | ||||
|     - setup-client-element-subdomain | ||||
|  | ||||
| # Additional playbook to set the variable file during Synapse configuration | ||||
| - include_tasks:  | ||||
|     file: "set_variables_synapse.yml" | ||||
|   | ||||
| @@ -12,7 +12,6 @@ | ||||
|     'matrix_client_element_brand': '{{ matrix_client_element_brand }}' | ||||
|     'matrix_client_element_default_theme': '{{ matrix_client_element_default_theme }}' | ||||
|     'matrix_client_element_registration_enabled': '{{ matrix_client_element_registration_enabled }}' | ||||
|     'matrix_server_fqn_element': "{{ element_subdomain }}.{{ matrix_domain }}" | ||||
|  | ||||
| - name: Set fact for 'https' string | ||||
|   set_fact: | ||||
|   | ||||
							
								
								
									
										49
									
								
								roles/matrix-awx/tasks/set_variables_element_subdomain.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								roles/matrix-awx/tasks/set_variables_element_subdomain.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | ||||
|  | ||||
| - name: Record Element-Web variables locally on AWX | ||||
|   delegate_to: 127.0.0.1 | ||||
|   lineinfile: | ||||
|     path: '{{ awx_cached_matrix_vars }}' | ||||
|     regexp: "^#? *{{ item.key | regex_escape() }}:" | ||||
|     line: "{{ item.key }}: {{ item.value }}" | ||||
|     insertafter: '# Element Settings Start' | ||||
|   with_dict: | ||||
|     'matrix_server_fqn_element': "{{ element_subdomain }}.{{ matrix_domain }}" | ||||
|      | ||||
| - name: Save new 'Configure Element Subdomain' survey.json to the AWX tower, template | ||||
|   delegate_to: 127.0.0.1 | ||||
|   template: | ||||
|     src: 'roles/matrix-awx/surveys/configure_element_subdomain.json.j2' | ||||
|     dest: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_element_subdomain.json' | ||||
|  | ||||
| - name: Copy new 'Configure Element Subdomain' survey.json to target machine | ||||
|   copy: | ||||
|     src: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_element_subdomain.json' | ||||
|     dest: '/matrix/awx/configure_element_subdomain.json' | ||||
|     mode: '0660' | ||||
|  | ||||
| - name: Collect AWX admin token the hard way! | ||||
|   delegate_to: 127.0.0.1 | ||||
|   shell: | | ||||
|       curl -sku {{ tower_username }}:{{ tower_password }} -H "Content-Type: application/json" -X POST -d '{"description":"Tower CLI", "application":null, "scope":"write"}' https://{{ tower_host }}/api/v2/users/1/personal_tokens/ | jq '.token' | sed -r 's/\"//g' | ||||
|   register: tower_token | ||||
|   no_log: True | ||||
|  | ||||
| - name: Recreate 'Configure Element Subdomain' job template | ||||
|   delegate_to: 127.0.0.1 | ||||
|   awx.awx.tower_job_template: | ||||
|     name: "{{ matrix_domain }} - 1 - Configure Element Subdomain" | ||||
|     description: "Configure Element clients subdomain location. (Eg: 'element' for element.example.org)" | ||||
|     extra_vars: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/extra_vars.json') }}" | ||||
|     job_type: run | ||||
|     job_tags: "start,setup-all,setup-client-element-subdomain" | ||||
|     inventory: "{{ member_id }}" | ||||
|     project: "{{ member_id }} - Matrix Docker Ansible Deploy" | ||||
|     playbook: setup.yml | ||||
|     credential: "{{ member_id }} - AWX SSH Key" | ||||
|     survey_enabled: true | ||||
|     survey_spec: "{{ lookup('file', '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/configure_element_subdomain.json') }}" | ||||
|     state: present | ||||
|     verbosity: 1 | ||||
|     tower_host: "https://{{ tower_host }}" | ||||
|     tower_oauthtoken: "{{ tower_token.stdout }}" | ||||
|     validate_certs: yes | ||||
| @@ -59,8 +59,8 @@ | ||||
|     line: "{{ item.key }}: {{ item.value }}" | ||||
|     insertafter: '# Synapse Settings Start' | ||||
|   with_dict: | ||||
|     'matrix_synapse_registration_shared_secret': '{{ matrix_synapse_registration_shared_secret }}' | ||||
|   when: matrix_synapse_registration_shared_secret|length > 0 | ||||
|     'matrix_synapse_registration_shared_secret': '{{ ext_matrix_synapse_registration_shared_secret }}' | ||||
|   when: ext_matrix_synapse_registration_shared_secret|length > 0 | ||||
|  | ||||
| - name: Record registations_require_3pid extra variable if true | ||||
|   delegate_to: 127.0.0.1 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user