sbaerlocher / ansible.traefik

Installs and configures traefik as a docker container on a Linux docker environment.
MIT License
0 stars 5 forks source link

Ansible traefik handler deletes all configuration of the traefik container #5

Closed traedamatic closed 4 years ago

traedamatic commented 5 years ago

Hello, i noticed a strange behavior. When run role once on the server everything works fine. But if i only alter a configuration the traefik container results in to a none configured state.

All volumes, exported ports and so on are gone.

I forked your repo some days ago made some changes and altered the handler definition like this:

https://github.com/konekto/ansible.traefik/commit/578ce62f8275785aa1d98008ff7d5a196d2b6129

Can your reproduce this behavior? Best wishes, Nicolas

sbaerlocher commented 5 years ago

Hello Nicolas

I can still see this behavior in myself. Why do you define whole containers again in the handlers.yml? Because with that you create a new container, these lines should suffice in handlers.yml.

- name: restart traefik
  docker_container:
    name: webproxy
    restart: true

Greeting Simon

traedamatic commented 5 years ago

Hallo Simon,

i think you misunderstand me.

The implementation with just

- name: restart traefik
  docker_container:
    name: webproxy
    restart: true

did restart the container but all configuration are missing.

I did refactor the handler with all configuration to fix that bug.

Can you reproduce this bug:

  1. Run the playbook once.
  2. Only change the configuration (traefik.toml)
  3. Run the playbook again\

?

Best wishes, Nicolas

sbaerlocher commented 5 years ago

Hello Nicolas

I can't reproduce your problem.

I took a clean install of Ubuntu 18.04 (digitalocean) and the arillso.docker role and your treafik role. this worked. Also changing the configuration and re-deploying mot the role worked. Can you tell me what you changed in the traefik.toml?

Greetings Simon

sbaerlocher commented 5 years ago

@traedamatic Did you find the problem yet?

traedamatic commented 5 years ago

Hello Nicolas

I can't reproduce your problem.

I took a clean install of Ubuntu 18.04 (digitalocean) and the arillso.docker role and your treafik role. this worked. Also changing the configuration and re-deploying mot the role worked. Can you tell me what you changed in the traefik.toml?

Greetings Simon

Hello Simon,

your wrote in your comment that you used mine traefik role. I added all the docker container configuration to the handler. That solved this problem for my installation.

What do you think about to add molecule testing system to test the role?

sbaerlocher commented 5 years ago

Hello Nicolas

I find a good idea to add molecule. Do you want to add a pull request?