Commit 7d4de77 1 parent 53fbdd5 commit 7d4de77 Copy full SHA for 7d4de77
File tree 4 files changed +57
-3
lines changed
4 files changed +57
-3
lines changed Original file line number Diff line number Diff line change
1
+ listener 1883 0.0.0.0
2
+ allow_anonymous false
3
+ password_file /mosquitto/config/passwd
Original file line number Diff line number Diff line change 1
1
webservers :
2
2
hosts :
3
3
srv501663.hstgr.cloud :
4
- ansible_user : root
4
+ ansible_user : root
5
+
6
+ mosquitto :
7
+ children :
8
+ webservers:
Original file line number Diff line number Diff line change 2
2
- name : Docker
3
3
hosts :
4
4
- webservers
5
+ - mosquitto
5
6
roles :
6
7
# - geerlingguy.docker
7
8
8
- - name : Setup
9
+ - name : Webserver- Setup
9
10
hosts :
10
11
- webservers
11
12
tasks :
78
79
SECRET_KEY_FILE : " /etc/SECRET_KEY"
79
80
STATIC_ROOT : " /data/static"
80
81
MEDIA_ROOT : " /data/media"
81
- MEDIA_URL : " /media/"
82
+ MEDIA_URL : " /media/"
83
+
84
+ - name : Mosquitto
85
+ hosts :
86
+ - mosquitto
87
+ tasks :
88
+ - name : Mosquitto Directory
89
+ ansible.builtin.file :
90
+ path : " {{ item }}"
91
+ state : directory
92
+ mode : 0700
93
+ with_items :
94
+ - /etc/mosquitto
95
+
96
+ - name : Mosquitto Config
97
+ ansible.builtin.copy :
98
+ src : mosquitto/mosquitto.conf
99
+ dest : /etc/mosquitto/mosquitto.conf
100
+
101
+ - name : Mosquitto Passwords
102
+ community.docker.docker_container :
103
+ name : mqtt-passwd
104
+ image : eclipse-mosquitto:latest
105
+ detach : false
106
+ command : " mosquitto_passwd -b /mosquitto/config/passwd {{ item.key }} {{ item.value }}"
107
+ volumes :
108
+ - " /etc/mosquitto/passwd:/mosquitto/config/passwd"
109
+ no_log : true
110
+ loop : " {{ mosquitto_users|dict2items }}"
111
+ vars :
112
+ mosquitto_users :
113
+ gymkhana : !vault |
114
+ $ANSIBLE_VAULT;1.1;AES256
115
+ 64343437653430373430303264633266303333656437636330346538333039363332313639356266
116
+ 6165393664646332303062343464653238616634353733340a363832633936383639396234303366
117
+ 63636362393437653834383564396136386337366362383066633864396131323564346436346365
118
+ 3130313466383865390a656231626331633835616530663234353739613731343935363062393164
119
+ 37623366643835333531393434666432623365666536393164363363646533386666
120
+
121
+ - name : Run Mosquitto
122
+ community.docker.docker_container :
123
+ name : mqtt
124
+ image : eclipse-mosquitto:latest
125
+ volumes :
126
+ - " /etc/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.config"
127
+ - " /etc/mosquitto/passwd:/mosquitto/config/passwd"
128
+
You can’t perform that action at this time.
0 commit comments