Skip to content

Commit

Permalink
Merge pull request #43 from andygrunwald/make-docker-pull-force-confi…
Browse files Browse the repository at this point in the history
…gurable

Make `docker_image.force_source` configurable
  • Loading branch information
mhutter authored Mar 29, 2022
2 parents 6e515d8 + 7e9d3a8 commit 4e13b96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ This will create:
* `container_links` (default: _[]_) - List of `--link` arguments
* `container_labels` (default: _[]_) - List of `-l` arguments
* `container_docker_pull` (default: _yes_) - whether the docker image should be pulled
* `container_docker_pull_force_source` (default: _yes_) - whether the docker image pull should be executed at every time (see [`docker_image.force_source`](https://docs.ansible.com/ansible/latest/collections/community/docker/docker_image_module.html#parameter-force_source))
* `container_cap_add` (default _[]_) - List of capabilities to add
* `container_cap_drop` (default _{}_) - List of capabilities to drop
* `container_network` (default _""_) - [Network settings](https://docs.docker.com/engine/reference/run/#network-settings)
Expand Down
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
container_name: "{{ name }}"
container_docker_pull: true
container_docker_pull_force_source: true
container_labels: []
container_cmd: []
container_host_network: false
Expand All @@ -21,4 +22,4 @@ service_masked: false
service_state: started
service_restart: true
template_env_path: "env.j2"
template_unit_path: "unit.j2"
template_unit_path: "unit.j2"
2 changes: 1 addition & 1 deletion tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- name: Pull image {{ container_image }}
docker_image:
name: '{{ container_image }}'
force_source: true
force_source: '{{ container_docker_pull_force_source | bool }}'
source: pull
when: container_docker_pull
notify: restart container {{ container_name }}
Expand Down

0 comments on commit 4e13b96

Please sign in to comment.