Debugging;Housekeeping;Push source gitops repository
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			This commit is contained in:
		| @@ -201,17 +201,20 @@ | ||||
|  | ||||
|     - name: Retrieve existing gitea configuration | ||||
|       ansible.builtin.uri: | ||||
|         # url: "{{ item }}" | ||||
|         url: https://git.{{ vapp['metacluster.fqdn'] }}/api/v1/repos/search | ||||
|         method: GET | ||||
|       register: gitea_existing_config | ||||
|       # loop: | ||||
|       #   # - https://git.{{ vapp['metacluster.fqdn'] }}/api/v1/orgs | ||||
|       #   - https://git.{{ vapp['metacluster.fqdn'] }}/api/v1/repos/search | ||||
|       #   - https://git.{{ vapp['metacluster.fqdn'] }}/api/v1/user/keys | ||||
|  | ||||
|     - ansible.builtin.uri: | ||||
|         url: "{{ item }}" | ||||
|         method: GET | ||||
|       register: gitea_existing_config_TST | ||||
|       loop: | ||||
|         # - https://git.{{ vapp['metacluster.fqdn'] }}/api/v1/orgs | ||||
|         - https://git.{{ vapp['metacluster.fqdn'] }}/api/v1/repos/search | ||||
|         - https://git.{{ vapp['metacluster.fqdn'] }}/api/v1/user/keys | ||||
|     - debug: | ||||
|         var: gitea_existing_config | ||||
|         var: gitea_existing_config_TST | ||||
|  | ||||
|     - block: | ||||
|  | ||||
| @@ -225,8 +228,6 @@ | ||||
|               key: "{{ gitops_sshkey.public_key }}" | ||||
|               read_only: false | ||||
|               title: GitOps | ||||
| # Initial testing | ||||
|           ignore_errors: yes | ||||
|  | ||||
|         - name: Create organization(s) | ||||
|           ansible.builtin.uri: | ||||
| @@ -261,19 +262,27 @@ | ||||
|           loop: | ||||
|             - organization: mc | ||||
|               body: | ||||
|                 name: ArgoCD.Config | ||||
|                 auto_init: true | ||||
|                 default_branch: main | ||||
|                 name: GitOps.Config | ||||
|                 # auto_init: true | ||||
|                 # default_branch: main | ||||
|                 description: GitOps manifests | ||||
|             - organization: wl | ||||
|               body: | ||||
|                 name: Template.ArgoCD.Config | ||||
|                 auto_init: true | ||||
|                 default_branch: main | ||||
|                 name: Template.GitOps.Config | ||||
|                 # auto_init: true | ||||
|                 # default_branch: main | ||||
|                 description: GitOps manifests | ||||
|           loop_control: | ||||
|             label: "{{ item.organization + '/' + item.body.name }}" | ||||
|  | ||||
|         - name: Rebase/Push source gitops repository | ||||
|           ansible.builtin.shell: | ||||
|             cmd: | | ||||
|               git remote set-url origin https://git.{{ vapp['metacluster.fqdn']}}/mc/GitOps.Config.git | ||||
|               git config --local --http.sslVerify false | ||||
|               git push | ||||
|             chdir: /opt/metacluster/git-repositories/gitops | ||||
|  | ||||
|       when: (gitea_existing_config.json is undefined) or (gitea_existing_config.json.data | length == 0) | ||||
|  | ||||
|   module_defaults: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user