Problem:
I will reach the goal that foreman/puppet deploy a docker container on every Node in a class. I use docker puppet module for that. I declare the docker containers over the docker::run_instance method of type hash. My problem is now, that i have to set an individual part of the docker instantiation. Example of my smart class parameter:
mysqld_exporter:
image: mysqld-exporter:latest
env:
- DATA_SOURCE_NAME=mysqlexporter:Password@(<%= @fqdn %>:3306)/
ports: 9104:9104
restart_service: true
extra_parameters: - “–restart=unless-stopped”
i have seen the topic: Use facts in smart variables
but this wont go because of error message: “no implicit conversion of String into Hash”
I’m not good in foreman puppet and so on, but i think it is a problem that the erb output is a string and the smart class parameter should be a hash.
Expected outcome:
I hope that it is possible to use a fact variable in the smart class parameter to reach my goal. example:
mysqld_exporter:
image: mysqld-exporter:latest
env:
- DATA_SOURCE_NAME=mysqlexporter:Password@(host.example.com:3306)/
ports: 9104:9104
restart_service: true
extra_parameters: - “–restart=unless-stopped”
Foreman and Proxy versions:
Foreman: 3.4.0
foreman-tasks 7.0.0
foreman_discovery 21.0.1
foreman_puppet 4.0.1
foreman_remote_execution 8.0.0
foreman_templates 9.3.0
katello 4.6.0
Distribution and version:
Rocky Linux release 8.6 (Green Obsidian)