extract the inventory number properly
This commit is contained in:
		
							
								
								
									
										21
									
								
								liebchen.yml
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								liebchen.yml
									
									
									
									
									
								
							| @@ -184,10 +184,21 @@ | |||||||
|   - name: Update default dock confuguration |   - name: Update default dock confuguration | ||||||
|     command: dconf update |     command: dconf update | ||||||
|  |  | ||||||
|   - name: Extract inventory number |   - name: Search for string in file | ||||||
|     command: grep -oP inventory_number=\K\d+ /etc/inventory_number.cmdline > /ect/inventory_number |     command: | ||||||
|  |       cmd: grep -oP inventory_number=\\K\\d+ /etc/inventory_number.cmdline | ||||||
|  |     register: result | ||||||
|  |     # Since it is a reporting task | ||||||
|  |     # which needs to deliver a result in any case | ||||||
|  |     failed_when: result.rc != 0 and result.rc != 1 | ||||||
|  |     check_mode: false | ||||||
|  |     changed_when: false | ||||||
|  |   - name: Show result, if any | ||||||
|  |     copy: | ||||||
|  |       dest: /etc/inventory_number | ||||||
|  |       content: | | ||||||
|  |         {{ result.stdout_lines[0] }} | ||||||
|  |     when: result.rc == 0 | ||||||
|  |  | ||||||
|   - name: Enable login screen after install |   - name: Enable login screen after install | ||||||
|     command: systemctl start systemd-logind.service |     command: systemctl start systemd-logind.service | ||||||
|   - name: Reboot |  | ||||||
|     ansible.builtin.reboot: |  | ||||||
|       reboot_timeout: 60 |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user