mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-10-31 18:29:21 +00:00 
			
		
		
		
	- Aligned schema/main.yml credential definitions with consistent spacing - Changed PostgreSQL secret to use random_hex_32 instead of bcrypt - Improved administrator creation logic in tasks/02_administrator.yml: * First try with primary password * Retry with starred password if OIDC is enabled * Fallback to user:set_admin_role if both fail See: https://chatgpt.com/share/68d6aa34-19cc-800f-828a-a5121fda589f
		
			
				
	
	
		
			49 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| ---
 | |
| - name: "Wait until Greenlight is reachable via Nginx"
 | |
|   uri:
 | |
|     url: "{{ domains | get_url(application_id, WEB_PROTOCOL) }}"
 | |
|     validate_certs: true
 | |
|     status_code: 200
 | |
|     return_content: true
 | |
|   register: greenlight_http
 | |
|   until:
 | |
|     - greenlight_http.status == 200
 | |
|     - "'Greenlight' in greenlight_http.content or 'Sign in' in greenlight_http.content"
 | |
|   retries: 30
 | |
|   delay: 5
 | |
|   changed_when: false
 | |
| 
 | |
| - block:
 | |
|     - name: "Create admin with primary password"
 | |
|       command:
 | |
|         cmd: >
 | |
|           {{ docker_compose_command_exec }}
 | |
|           greenlight
 | |
|           bundle exec rake
 | |
|           admin:create['{{ users.administrator.username | upper }}','{{ users.administrator.email }}','{{ users.administrator.password }}']
 | |
|         chdir: "{{ docker_compose.directories.instance }}"
 | |
|       register: admin_create_primary
 | |
|       when: not BBB_OIDC_ENABLED | bool
 | |
| 
 | |
|     - name: "Retry with starred password when invalid and OIDC enabled"
 | |
|       when: BBB_OIDC_ENABLED | bool
 | |
|       command:
 | |
|         cmd: >
 | |
|           {{ docker_compose_command_exec }}
 | |
|           greenlight
 | |
|           bundle exec rake
 | |
|           admin:create['{{ users.administrator.username | upper }}','{{ users.administrator.email }}','{{ users.administrator.password ~ '*' }}']
 | |
|         chdir: "{{ docker_compose.directories.instance }}"
 | |
|       register: admin_create_retry
 | |
|       failed_when: admin_create_retry.rc not in [0, 2]
 | |
| 
 | |
|   rescue:
 | |
|     - name: "Make existing user administrator (fallback)"
 | |
|       command:
 | |
|         cmd: >
 | |
|           {{ docker_compose_command_exec }}
 | |
|           greenlight
 | |
|           bundle exec rake
 | |
|           user:set_admin_role['{{ users.administrator.email }}']
 | |
|         chdir: "{{ docker_compose.directories.instance }}"
 |