openc3-cosmos-init/plugins/packages/openc3-cosmos-mqtt-test/plugin.txt
VARIABLE mqtt_target_name MQTT
VARIABLE mqtt_host test.mosquitto.org
VARIABLE mqtt_port 1883
VARIABLE mqtt_ssl false
VARIABLE mqtt_cmd_topic test
VARIABLE mqtt_tlm_topic test
VARIABLE mqtt_username_secret ""
VARIABLE mqtt_password_secret ""
VARIABLE mqtt_cert_secret ""
VARIABLE mqtt_key_secret ""
VARIABLE mqtt_ca_file_secret ""
<% include_mqtt_username_secret = (mqtt_username_secret.to_s.strip.length > 0) %>
<% include_mqtt_password_secret = (mqtt_password_secret.to_s.strip.length > 0) %>
<% include_mqtt_cert_secret = (mqtt_cert_secret.to_s.strip.length > 0) %>
<% include_mqtt_key_secret = (mqtt_key_secret.to_s.strip.length > 0) %>
<% include_mqtt_ca_file_secret = (mqtt_ca_file_secret.to_s.strip.length > 0) %>
TARGET MQTT <%= mqtt_target_name %>
INTERFACE MQTT_INT mqtt_interface.rb <%= mqtt_host %> <%= mqtt_port %> <%= mqtt_ssl %>
MAP_TARGET <%= mqtt_target_name %>
<% if include_mqtt_username_secret %>
SECRET ENV <%= mqtt_username_secret %> "<%= mqtt_target_name %>_MQTT_USERNAME" USERNAME
<% end %>
<% if include_mqtt_password_secret %>
SECRET ENV <%= mqtt_password_secret %> "<%= mqtt_target_name %>_MQTT_PASSWORD" PASSWORD
<% end %>
<% if include_mqtt_cert_secret %>
SECRET FILE <%= mqtt_cert_secret %> "/tmp/<%= mqtt_target_name %>/MQTT_CERT" CERT
<% end %>
<% if include_mqtt_key_secret %>
SECRET FILE <%= mqtt_key_secret %> "/tmp/<%= mqtt_target_name %>/MQTT_KEY" KEY
<% end %>
<% if include_mqtt_ca_file_secret %>
SECRET FILE <%= mqtt_ca_file_secret %> "/tmp/<%= mqtt_target_name %>/MQTT_CA_FILE" CA_FILE
<% end %>