sameersbn / sameersbn/docker-gitlab
SMTP configuration issue when using the Ansible docker module
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 8.1k
- Forks
- 2.1k
- Avg merge
- 17h 47m
- Merged PRs (30d)
- 7
Description
entrypoint.sh copies SMTP configuration from environment variables only if
- the value of
SMTP_ENABLEDis the string"true", or SMTP_ENABLEDis blank or missing andSMTP_USERhas a value.
When using Ansible's docker module, the environment can be passed to the container like this:
- name: gitlab container
docker:
env:
SMTP_ENABLED: true
SMTP_USER: someone
The gotcha here is that Ansible tries to be smart and turns the identifier true into the boolean Python True value. The docker-py API client in turn converts that to the string "True", which isn't recognized as a true value by entrypoint.sh.
The solution is to either
- quote
SMTP_ENABLED: "true"in the Ansible task, or - leave out
SMTP_ENABLEDand make sureSMTP_USERis set.
I'd hate anyone else to waste as many hours as I did debugging this, so would it be reasonable to make the true value detection case insensitive?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with entrypoint.sh and inspect how SMTP_ENABLED is compared before SMTP configuration is copied. Reproduce the environment values described in the issue, including Ansible's boolean conversion, and verify that the accepted true value handling works without changing the blank or missing-variable behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, shell
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100