Skip to content

Commit

Permalink
Mention container_default_behavior value
Browse files Browse the repository at this point in the history
Avoids runtime deprecation warnings with ansible 2.10+ caused by
missing container_default_behavior option.
  • Loading branch information
ssbarnea committed Feb 10, 2020
1 parent 10cc6f8 commit 9616fb5
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions molecule/provisioner/ansible/playbooks/docker/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
restart_retries: "{{ item.restart_retries | default(omit) }}"
tty: "{{ item.tty | default(omit) }}"
labels: "{{ item.labels | default(omit) }}"
container_default_behavior: "{{ item.container_default_behavior | default('compatibility' if ansible_version.full is version_compare('2.10', '>=') else omit) }}"
register: server
with_items: "{{ molecule_yml.platforms }}"
loop_control:
Expand Down
1 change: 1 addition & 0 deletions molecule/provisioner/ansible/playbooks/docker/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
state: absent
force_kill: "{{ item.force_kill | default(true) }}"
keep_volumes: "{{ item.keep_volumes | default(true) }}"
container_default_behavior: "{{ item.container_default_behavior | default('compatibility' if ansible_version.full is version_compare('2.10', '>=') else omit) }}"
register: server
with_items: "{{ molecule_yml.platforms }}"
loop_control:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
networks: "{{ item.networks | default(omit) }}"
dns_servers: "{{ item.dns_servers | default(omit) }}"
networks_cli_compatible: "{{ item.networks_cli_compatible | default(true) }}"
container_default_behavior: "{{ item.container_default_behavior | default('compatibility' if ansible_version.full is version_compare('2.10', '>=') else omit) }}"
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
docker_container:
name: delegated-instance-docker
state: absent
container_default_behavior: "{{ item.container_default_behavior | default('compatibility' if ansible_version.full is version_compare('2.10', '>=') else omit) }}"
1 change: 1 addition & 0 deletions molecule/test/resources/playbooks/docker/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
env: "{{ item.env | default(omit) }}"
restart_policy: "{{ item.restart_policy | default(omit) }}"
restart_retries: "{{ item.restart_retries | default(omit) }}"
container_default_behavior: "{{ item.container_default_behavior | default('compatibility' if ansible_version.full is version_compare('2.10', '>=') else omit) }}"
register: server
with_items: "{{ molecule_yml.platforms }}"
async: 7200
Expand Down
1 change: 1 addition & 0 deletions molecule/test/resources/playbooks/docker/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
state: absent
force_kill: "{{ item.force_kill | default(true) }}"
keep_volumes: "{{ item.keep_volumes | default(true) }}"
container_default_behavior: "{{ item.container_default_behavior | default('compatibility' if ansible_version.full is version_compare('2.10', '>=') else omit) }}"
register: server
with_items: "{{ molecule_yml.platforms }}"
async: 7200
Expand Down

0 comments on commit 9616fb5

Please sign in to comment.