Skip to content

Commit 4e13b96

Browse files
authored
Merge pull request #43 from andygrunwald/make-docker-pull-force-configurable
Make `docker_image.force_source` configurable
2 parents 6e515d8 + 7e9d3a8 commit 4e13b96

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ This will create:
4747
* `container_links` (default: _[]_) - List of `--link` arguments
4848
* `container_labels` (default: _[]_) - List of `-l` arguments
4949
* `container_docker_pull` (default: _yes_) - whether the docker image should be pulled
50+
* `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))
5051
* `container_cap_add` (default _[]_) - List of capabilities to add
5152
* `container_cap_drop` (default _{}_) - List of capabilities to drop
5253
* `container_network` (default _""_) - [Network settings](https://docs.docker.com/engine/reference/run/#network-settings)

defaults/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
container_name: "{{ name }}"
33
container_docker_pull: true
4+
container_docker_pull_force_source: true
45
container_labels: []
56
container_cmd: []
67
container_host_network: false
@@ -21,4 +22,4 @@ service_masked: false
2122
service_state: started
2223
service_restart: true
2324
template_env_path: "env.j2"
24-
template_unit_path: "unit.j2"
25+
template_unit_path: "unit.j2"

tasks/install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- name: Pull image {{ container_image }}
1313
docker_image:
1414
name: '{{ container_image }}'
15-
force_source: true
15+
force_source: '{{ container_docker_pull_force_source | bool }}'
1616
source: pull
1717
when: container_docker_pull
1818
notify: restart container {{ container_name }}

0 commit comments

Comments
 (0)