Add playbook and accompanying role for doing maintenance
This commit is contained in:
		
					parent
					
						
							
								de97436706
							
						
					
				
			
			
				commit
				
					
						b295690ad5
					
				
			
		
					 3 changed files with 33 additions and 0 deletions
				
			
		
							
								
								
									
										11
									
								
								playbooks/roles/apt_update_and_upgrade/README.md
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								playbooks/roles/apt_update_and_upgrade/README.md
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,11 @@ | |||
| # Role `apt_update_and_upgrade` | ||||
| 
 | ||||
| This role does an `apt-get update`, `apt-get dist-upgrade` and a potential reboot (if packages got upgraded) on the specified hosts. | ||||
| 
 | ||||
| ## `hosts` | ||||
| 
 | ||||
| The `hosts` for this role need to be the VMs, which should be updated and upgraded. | ||||
| 
 | ||||
| ## Required Variables | ||||
| 
 | ||||
| This role doesn't have any required variables. | ||||
							
								
								
									
										15
									
								
								playbooks/roles/apt_update_and_upgrade/tasks/main.yaml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								playbooks/roles/apt_update_and_upgrade/tasks/main.yaml
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,15 @@ | |||
| - name: update, upgrade and potentially reboot | ||||
|   become: true | ||||
|   block: | ||||
|   - name: apt-get update | ||||
|     ansible.builtin.apt: | ||||
|       update-cache: true | ||||
| 
 | ||||
|   - name: apt-get dist-upgrade | ||||
|     ansible.builtin.apt: | ||||
|       upgrade: dist | ||||
|     register: apt_update_and_upgrade__upgrade_result | ||||
| 
 | ||||
|   - name: reboot, after package upgrade | ||||
|     ansible.builtin.reboot: | ||||
|     when: apt_update_and_upgrade__upgrade_result.changed | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 julian
					julian