Add mosquitto role and add playbook to deploy MQTT broker on automation.z9
This commit is contained in:
		
					parent
					
						
							
								59dc7a1d7d
							
						
					
				
			
			
				commit
				
					
						7a93546616
					
				
			
		
					 8 changed files with 101 additions and 0 deletions
				
			
		
							
								
								
									
										26
									
								
								playbooks/roles/mosquitto/tasks/main.yml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								playbooks/roles/mosquitto/tasks/main.yml
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,26 @@ | |||
| --- | ||||
| - name: Ensure mosquitto is installed | ||||
|   ansible.builtin.apt: | ||||
|     name: mosquitto | ||||
| - name: Ensure main configuraton file is deployed | ||||
|   ansible.builtin.copy: | ||||
|     content: "{{ mosquitto__mosquitto_conf_content }}" | ||||
|     dest: /etc/mosquitto/mosquitto.conf | ||||
|     mode: 0644 | ||||
|     owner: root | ||||
|     group: root | ||||
|   notify: Restart mosquitto | ||||
| - name: Ensure all additional configuraton files are deployed | ||||
|   ansible.builtin.copy: | ||||
|     content: "{{ item.content }}" | ||||
|     dest: /etc/mosquitto/conf.d/{{ item.name }}.conf | ||||
|     mode: 0644 | ||||
|     owner: root | ||||
|     group: root | ||||
|   loop: "{{ mosquitto__configs }}" | ||||
|   notify: Restart mosquitto | ||||
| - name: Ensure mosquitto service is enabled and started | ||||
|   ansible.builtin.systemd: | ||||
|     service: mosquitto.service | ||||
|     enabled: true | ||||
|     state: started | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue