sameersbn / sameersbn/docker-gitlab

SMTP configuration issue when using the Ansible docker module

Open
#361 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

wontfix
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_ENABLED is the string "true", or
  • SMTP_ENABLED is blank or missing and SMTP_USER has 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_ENABLED and make sure SMTP_USER is 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.