saltstack-formulas / docker-formula

Install and set up Docker
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
136 stars 330 forks source link

If 'environ' is defined on *nix, make a dropin systemd config to set … #322

Closed benfiedler closed 1 year ago

benfiedler commented 1 year ago

…it as EnvironmentFile

PR progress checklist (to be filled in by reviewers)


What type of PR is this?

Primary type

Secondary type

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

https://github.com/saltstack-formulas/docker-formula/issues/317

Describe the changes you're proposing

Create+manage a systemd dropin file if 'environ' pillar is configured to ensure the environ file (/etc/default/docker) is being used by the docker service. A systemd daemon-reload will be run if salt detects changes in the override file, and the docker service will be restarted if salt detects changes in the environ file.

Pillar / config required to test the proposed changes

docker:
  pkg: 
    docker:
      daemon_config:
        insecure-registries:
          - my.repo.local:5000
      environ:
        - HTTP_PROXY=http://my.proxy.local:3128/
        - HTTPS_PROXY=http://my.proxy.local:3128/
        - NO_PROXY="localhost,127.0.0.1,.local"
      use_upstream:
        repo
  wanted:
    - docker

docker/defaults.yaml docker/software/config/clean.sls docker/software/config/dropin.sls docker/software/config/init.sls docker/software/service/running.sls

Debug log showing how the proposed changes work

Documentation checklist

Testing checklist

Additional context

voileux commented 1 year ago

@benfiedler you must respect the commit message format for you pull request you can find the documentation here : https://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst#commit-message-formatting