DAJEEEEEE, STA ANDANDO (anche se con nginx e non con xmpp) E GODO UN CASINOOOO. ALLA FINE I PROBLEMI DI SSH ERANO SOLO DOVUTI ALLA FRETTA. E LASCIA UN PO' DI TEMPO A STI POVERI CONTAINER DI AVVIARSI
This commit is contained in:
		
							parent
							
								
									54eeb79ac9
								
							
						
					
					
						commit
						2d5fb2e77b
					
				
					 3 changed files with 24 additions and 45 deletions
				
			
		|  | @ -4,6 +4,7 @@ | |||
|   vars: | ||||
|     root_password: "{{ lookup('env', 'XMPP_PASSWORD') }}" | ||||
|     ssh_public_key: "{{ lookup('file', '~/.ssh/ansible.pub') }}" | ||||
|     vmid: 121 | ||||
|      | ||||
| 
 | ||||
|   tasks:  | ||||
|  | @ -14,7 +15,7 @@ | |||
|         api_host: "{{ proxmox_url }}" | ||||
|         api_user: "{{ proxmox_user }}" | ||||
|         api_password: "{{ proxmox_password }}" | ||||
|         vmid: 121 | ||||
|         vmid: "{{ vmid }}" | ||||
|         node: milan | ||||
|         hostname: xmpp | ||||
|         ostemplate: "local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst" | ||||
|  | @ -25,6 +26,7 @@ | |||
|           net0: "name=eth0,bridge=vmbr1,ip=10.10.0.21/16,gw=10.10.0.1" | ||||
|         pubkey: "{{ ssh_public_key }}" | ||||
|         password: "{{ root_password }}" | ||||
|         features: "nesting=1" | ||||
|         state: present | ||||
|       delegate_to: localhost | ||||
|       register: lxc_creation_result   #booooh, capiremo questo che vuol dire. Intanto registriamolo... immagino...  | ||||
|  | @ -35,30 +37,13 @@ | |||
|         api_host: "{{ proxmox_url }}" | ||||
|         api_user: "{{ proxmox_user }}" | ||||
|         api_password: "{{ proxmox_password }}" | ||||
|         vmid: 121 | ||||
|         vmid: "{{ vmid }}" | ||||
|         node: milan | ||||
|         state: started              # Tutto questo blocco è riassumibile in questa riga | ||||
|       delegate_to: localhost | ||||
|       when: lxc_creation_result.changed | ||||
| 
 | ||||
| 
 | ||||
| #    - name: Wait for container SSH to be available | ||||
| #      wait_for: | ||||
| #        host: 10.10.0.21 | ||||
| #        port: 22 | ||||
| #        timeout: 90 | ||||
| #        delay: 10 | ||||
| #      delegate_to: localhost | ||||
| #      when: lxc_creation_result.changed | ||||
| 
 | ||||
| 
 | ||||
|     - name: Wait until SSH is fully ready | ||||
|       ansible.builtin.wait_for_connection: | ||||
|         timeout: 180 | ||||
|       delegate_to: xmpp01 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     - name: Aggiungi container all'inventory dinamico | ||||
|       add_host: | ||||
|         name: xmpp01 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Freek Kettone
						Freek Kettone