jjethwa / rundeck

GNU General Public License v3.0
123 stars 137 forks source link

Email notifications with groovy file. #104

Closed rsmartins78 closed 6 years ago

rsmartins78 commented 6 years ago

First of all, I apologize for my English, I'm Brazilian.

I have been trying for some time to enable the sending of emails through the environment variables available for use, but it is not possible to use an email server that uses SSL or TLS. Through Rundeck's documentation, I've found that for advanced email settings, you need to create a groovy file.

I've tested the groovy file in the container, changing the profile file, and worked.

Is it possible to implement the function to create a .groovy in your image?

Rundeck Documentation: http://rundeck.org/docs/administration/email-settings.html#advanced-smtp-settings

jjethwa commented 6 years ago

Hi @rsmartins78

No need to apologize, you made perfect sense! 😄

We have a similar requirement and needed to use the groovy config for the mail settings and custom email templates. We use a volume for /etc/rundeck to maintain persistence of the config files. Have you tried that? If your server url and other settings don't change from one container launch to another, it should be a good solution. Let me know if that works for you.

I haven't implemented something to create the groovy file (or modify it if it exists) as it's for more advanced users and I'd be worried about messing with their configs 😛 I can work on it though, if using a volume does not work for you..

rsmartins78 commented 6 years ago

I have a copy of your image in the private registry and gitlab of my company , with some modifications, as well the Ansible implementation. When I try to mount the volume for /etc/rundeck, the container don't start, and I look the folder mapped, and it's empty. I've modified the opt/run to add some configurations, but I'm starting in the DevOps and Linux world, and I don't have experience with shell script a lot.

Please look my repository: https://github.com/rsmartins78/rundeck-ansible, any suggest, I'll apreciate

jjethwa commented 6 years ago

Hmm, these lines were added to handle the case where an empty /etc/rundeck volume was used:

https://github.com/rsmartins78/rundeck-ansible/blob/master/content/opt/run#L90-L94

Can you verify that the volume directory is empty?

Also, I think it's better etiquette to fork the repo instead of copying over 😛

rsmartins78 commented 6 years ago

I'm a new user of GitHub too haha. The error that occurs is in some sed in rundeck-config.properties accusing that file doesn't exists. Monday I'll reproduce the error and post here.

sexta-feira, 19 de janeiro de 2018 23:20 -0200 de notifications@github.com notifications@github.com:

Hmm, these lines were added to handle the case where an empty /etc/rundeck volume was used:

https://github.com/rsmartins78/rundeck-ansible/blob/master/content/opt/run#L90-L94

Can you verify that the volume directory is empty?

Also, I think it's better etiquette to fork the repo instead of copying over 😛

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/jjethwa/rundeck/issues/104#issuecomment-359132718, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AgGSrlL_6oNZCmVfgClfMqTpatZCVPEVks5tMT9EgaJpZM4RlNyL.

jjethwa commented 6 years ago

Hi @rsmartins78

NP at all! Forking the repo will make it easier for you to submit pull requests if you ever need to 😄

It does sound like there is at least one file (maybe a hidden one?) in the /etc/rundeck volume so the default set of config files do not get copied over.

I took a look at your repo and I think I have an idea of what you want to accomplish. You could use my image as a base image in your Dockerfile, then all you would need to focus on is the Ansible side.

rsmartins78 commented 6 years ago

I noticed that the only thing that changes whenever the container is recreated is the datasource.password. If I do not use database in rundeck, this password does not matter to me right?

If so, can I make a script change to create the groovy file as per my needs.

rsmartins78 commented 6 years ago

As combined, I tested the volume mapping in the "/etc/rundeck" folder, with an empty folder on the host machine, and it worked.

Probably when I tested it, I left some file inside thinking it would replace.

Thanks for listening.

jjethwa commented 6 years ago

Glad to hear you got it working, @rsmartins78

Check into the base image idea I mentioned before. I think it would make your life a lot easier 😄