Merge pull request 'Move mosquitto from pottwal to radon' (!36) from mosquitto-move into master
Reviewed-on: https://gitea.n39.eu/Netz39_Admin/netz39-infra-ansible/pulls/36
This commit is contained in:
commit
4d69229f90
3 changed files with 41 additions and 43 deletions
41
pottwal.yml
41
pottwal.yml
|
@ -5,9 +5,6 @@
|
||||||
vars:
|
vars:
|
||||||
ansible_python_interpreter: /usr/bin/python3
|
ansible_python_interpreter: /usr/bin/python3
|
||||||
|
|
||||||
mosquitto_image: eclipse-mosquitto:1.6
|
|
||||||
mosquitto_data: /srv/data/mosquitto
|
|
||||||
|
|
||||||
openhab_image: openhab/openhab:2.5.11
|
openhab_image: openhab/openhab:2.5.11
|
||||||
openhab_data: /srv/data/openhab
|
openhab_data: /srv/data/openhab
|
||||||
openhab_host_port: 8081
|
openhab_host_port: 8081
|
||||||
|
@ -82,39 +79,6 @@
|
||||||
ports:
|
ports:
|
||||||
- 3142:3142
|
- 3142:3142
|
||||||
|
|
||||||
|
|
||||||
- name: Ensure the mosquitto directories exist
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
with_items:
|
|
||||||
- "{{ mosquitto_data }}/config"
|
|
||||||
- "{{ mosquitto_data }}/data"
|
|
||||||
- "{{ mosquitto_data }}/log"
|
|
||||||
|
|
||||||
- name: Make sure mosquitto config is there
|
|
||||||
template:
|
|
||||||
src: "templates/mosquitto.conf.j2"
|
|
||||||
dest: "{{ mosquitto_data }}/config/mosquitto.conf"
|
|
||||||
notify: restart_mosquitto
|
|
||||||
|
|
||||||
- name: Ensure mosquitto is running
|
|
||||||
docker_container:
|
|
||||||
name: mosquitto
|
|
||||||
image: "{{ mosquitto_image }}"
|
|
||||||
pull: true
|
|
||||||
state: started
|
|
||||||
ports:
|
|
||||||
- 1883:1883
|
|
||||||
- 9001:9001
|
|
||||||
volumes:
|
|
||||||
- "{{ mosquitto_data }}/config:/mosquitto/config"
|
|
||||||
- "{{ mosquitto_data }}/data:/mosquitto/data"
|
|
||||||
- "{{ mosquitto_data }}/log:/mosquitto/log"
|
|
||||||
detach: yes
|
|
||||||
keep_volumes: yes
|
|
||||||
restart_policy: unless-stopped
|
|
||||||
|
|
||||||
- name: Ensure the openhab directories exist
|
- name: Ensure the openhab directories exist
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
|
@ -219,8 +183,3 @@
|
||||||
proxy_port: "{{ shlink_host_port }}"
|
proxy_port: "{{ shlink_host_port }}"
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- name: restart mosquitto
|
|
||||||
docker_container:
|
|
||||||
name: mosquitto
|
|
||||||
state: started
|
|
||||||
restart: yes
|
|
||||||
|
|
39
radon.yml
39
radon.yml
|
@ -5,11 +5,50 @@
|
||||||
vars:
|
vars:
|
||||||
ansible_python_interpreter: /usr/bin/python3
|
ansible_python_interpreter: /usr/bin/python3
|
||||||
|
|
||||||
|
mosquitto_image: eclipse-mosquitto:2.0.14
|
||||||
|
mosquitto_data: /srv/data/mosquitto
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: docker_setup
|
- role: docker_setup
|
||||||
vars:
|
vars:
|
||||||
docker_data_root: "/srv/docker"
|
docker_data_root: "/srv/docker"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Ensure the mosquitto directories exist
|
||||||
|
file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- "{{ mosquitto_data }}/config"
|
||||||
|
- "{{ mosquitto_data }}/data"
|
||||||
|
- "{{ mosquitto_data }}/log"
|
||||||
|
|
||||||
|
- name: Make sure mosquitto config is there
|
||||||
|
template:
|
||||||
|
src: "templates/mosquitto.conf.j2"
|
||||||
|
dest: "{{ mosquitto_data }}/config/mosquitto.conf"
|
||||||
|
notify: restart mosquitto
|
||||||
|
|
||||||
|
- name: Ensure mosquitto is running
|
||||||
|
docker_container:
|
||||||
|
name: mosquitto
|
||||||
|
image: "{{ mosquitto_image }}"
|
||||||
|
pull: true
|
||||||
|
state: started
|
||||||
|
ports:
|
||||||
|
- 1883:1883
|
||||||
|
- 9001:9001
|
||||||
|
volumes:
|
||||||
|
- "{{ mosquitto_data }}/config:/mosquitto/config"
|
||||||
|
- "{{ mosquitto_data }}/data:/mosquitto/data"
|
||||||
|
- "{{ mosquitto_data }}/log:/mosquitto/log"
|
||||||
|
detach: yes
|
||||||
|
keep_volumes: yes
|
||||||
|
restart_policy: unless-stopped
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
|
- name: restart mosquitto
|
||||||
|
docker_container:
|
||||||
|
name: mosquitto
|
||||||
|
state: started
|
||||||
|
restart: yes
|
||||||
|
|
|
@ -5,10 +5,10 @@ persistence_location /mosquitto/data/
|
||||||
log_dest file /mosquitto/log/mosquitto.log
|
log_dest file /mosquitto/log/mosquitto.log
|
||||||
|
|
||||||
# Bridge to platon
|
# Bridge to platon
|
||||||
connection br-pottwal-to-platon
|
connection br-radon-to-platon
|
||||||
address platon:1883
|
address platon:1883
|
||||||
cleansession false
|
cleansession false
|
||||||
clientid br-pottwal-platon
|
clientid br-radon-platon
|
||||||
start_type automatic
|
start_type automatic
|
||||||
notifications false
|
notifications false
|
||||||
try_private true
|
try_private true
|
||||||
|
|
Loading…
Reference in a new issue