Reputation: 309
I'd like to configure an email notification for a job done in rundeck with docker.
I've this docker-compose.yaml and but it doesn't work.
version: '3'
services:
rundeck:
image: ${RUNDECK_IMAGE:-rundeck/rundeck:SNAPSHOT}
links:
- postgres
environment:
RUNDECK_DATABASE_DRIVER: org.postgresql.Driver
RUNDECK_DATABASE_USERNAME: rundeck
RUNDECK_DATABASE_PASSWORD: rundeck
RUNDECK_DATABASE_URL: jdbc:postgresql://postgres/rundeck?autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
RUNDECK_GRAILS_MAIL_HOST: smtp.gmail.com
RUNDECK_GRAILS_MAIL_USERNAME: [email protected]
RUNDECK_GRAILS_MAIL_PORT: 587
RUNDECK_GRAILS_MAIL_PASSWORD: qwqw
volumes:
- ${RUNDECK_LICENSE_FILE:-/dev/null}:/home/rundeck/etc/rundeckpro-license.key
ports:
- 4440:4440
postgres:
image: postgres
expose:
- 5432
environment:
- POSTGRES_DB=rundeck
- POSTGRES_USER=rundeck
- POSTGRES_PASSWORD=rundeck
volumes:
- dbdata:/var/lib/postgresql/data
volumes:
dbdata:
Upvotes: 0
Views: 1085
Reputation: 181
I came across this topic, but it wasn't clear to me, so I would like to add some additional information.
I use Rundeck 4.12 inside a container. My error from the E-mail client logs was:
Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. - gsmtp"
Research:
As I understand it rundeck-config.properties file doesn't support RUNDECK_MAIL_PROPS.
From environment variable RUNDECK_MAIL_PROPS from docker-compose goes to '/home/rundeck/server/config/rundeck-config.properties': grails.mail.props=["mail.smtp.auth":"true", "mail.smtp.starttls.enable":"true", "mail.smtp.starttls.required":"true", "mail.smtp.socketFactory.port":"587","mail.smtp.socketFactory.fallback":"false"], but it doesn't help.
When docker-container starts it runs '/home/rundeck/docker-lib/entry.sh' that using remco takes parts of the config from ENV and files from '/tmp/remco-partials/rundeck-config/' and puts them in '/home/rundeck/server/config/rundeck-config.properties'
Solution:
As mentioned previously, I created a separate file named rundeck-config.groovy on a host and bound it using docker-compose to '/home/rundeck/server/config/rundeck-config.groovy' inside a Docker container. For more information about this file, please see the link in that section of the official Rundeck documentation.
Upvotes: 0
Reputation: 4325
Gmail configuration needs the extended parameters, in the past, an extra file named rundeck-config.groovy
was needed with these extended params in the mail config (props
section):
grails {
mail {
host = "smtp.gmail.com"
username = "[email protected]"
port = 587
password = "example"
props = ["mail.smtp.starttls.enable":"true","mail.smtp.auth":"true","mail.smtp.socketFactory.port":"587","mail.smtp.socketFactory.fallback":"false"]
}
}
grails.mail.default.from = "[email protected]"
Now, these params are available in the email docker configuration using an env var, take a look at the RUNDECK_MAIL_PROPS
docker env var:
RUNDECK_MAIL_PROPS=["mail.smtp.starttls.enable":"true","mail.smtp.auth":"true","mail.smtp.socketFactory.port":"587","mail.smtp.socketFactory.fallback":"false"
Both ways (groovy
file and env var) work well.
Upvotes: 2