This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PLAY RECAP ************************************************************************************************************ | |
| broker : ok=9 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 | |
| publisher : ok=12 changed=5 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 | |
| subscriber : ok=12 changed=5 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| # tasks file for create_syntropy_network | |
| - name: Create Syntropy Network | |
| syntropynet.syntropy.syntropy_network: | |
| name: "{{network_name}}" | |
| state: present | |
| topology: p2m | |
| connections: | |
| mqt_2_broker: | |
| state: present |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PLAY RECAP *********************************************************************************************************** | |
| broker : ok=8 changed=4 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 | |
| publisher : ok=8 changed=4 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 | |
| subscriber : ok=8 changed=4 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - name: Configure Hosts | |
| hosts: all | |
| roles: | |
| - update_cache | |
| - install_wireguard | |
| - install_docker | |
| - install_python_deps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [all:vars] | |
| ansible_ssh_private_key_file=<pem_file_location> | |
| [broker] | |
| broker ansible_host=<broker_vm_ip> ansible_connection=ssh ansible_user=<broker_user> | |
| [publisher] | |
| publisher ansible_host=<publisher_vm_ip> ansible_connection=ssh ansible_user=<publisher_user> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| # tasks file for launch_mosquitto | |
| - debug: | |
| msg: "Launching Mosquito" | |
| # copy the mosquito config | |
| - name: Copy Mosquitto conf file | |
| copy: | |
| src: mosquitto.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| # tasks file for launch_syntropy_agent | |
| - include_vars: ../../../secrets.yaml | |
| - debug: | |
| msg: creating "{{agent_name}}" | |
| - name: Launch Syntropy Agent | |
| docker_container: | |
| image: syntropynet/agent:stable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| # tasks file for create_docker_network | |
| - debug: | |
| msg: Create docker network on subnet - {{subnet}}" | |
| - name: Create Docker network | |
| docker_network: | |
| name: syntropynet | |
| driver: bridge | |
| ipam_config: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - name: Deploy Broker | |
| hosts: broker | |
| vars: | |
| subnet: 172.20.0.0/24 | |
| agent_name: "mqt_2_broker" | |
| agent_tags: "mqtt" | |
| agent_provider: "6" | |
| roles: | |
| - create_docker_network |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const mqtt = require("mqtt"); | |
| const moment = require("moment"); | |
| const client = mqtt.connect("mqtt://172.20.0.2:1883"); | |
| const CronJob = require("cron").CronJob; | |
| // publish a message at 5minute intervals | |
| const job = new CronJob( | |
| "5 * * * * *", | |
| function () { |