
Currently we require a slew of deps on each destination node, this includes a gcc compiler and installing things via pip. We can remove these dependencies by containerizing them and running and Ansible inside the container itself. The container would then report back facts about idempotency. DocImpact Closes-Bug: #1481495 Implements: blueprint containerize-dependencies Change-Id: I3dfccbf9fafc06ffc36e78f3006fe5d3367891df
58 lines
2.4 KiB
YAML
58 lines
2.4 KiB
YAML
---
|
|
# Using "state: reloaded" will restart the container if a new image is
|
|
# pulled or the paramaters are modified.
|
|
#
|
|
# "pull: always" will _always_ pull the latest image. It registers a
|
|
# change when the image has changed, regardless of "state"
|
|
#
|
|
# Due to a bug in the ansible docker module it doesnt properly supply the
|
|
# docker_api_version from docker-py, so we specify it here. This will be
|
|
# removed when the bugfix makes it downstream
|
|
|
|
- name: Starting container(s)
|
|
docker:
|
|
command: "{{ container_command | default(None) }}"
|
|
detach: "{{ container_detach | default('True') }}"
|
|
env: "{{ container_environment | default({}) }}"
|
|
docker_api_version: "{{ docker_api_version }}"
|
|
image: "{{ container_image }}"
|
|
insecure_registry: "{{ docker_insecure_registry }}"
|
|
name: "{{ container_name }}"
|
|
net: "host"
|
|
password: "{{ docker_registry_password }}"
|
|
privileged: "{{ container_privileged | default('False') }}"
|
|
pull: "{{ docker_pull_policy }}"
|
|
registry: "{{ docker_registry }}"
|
|
restart_policy: "{{ container_restart_policy | default(docker_restart_policy) }}"
|
|
restart_policy_retry: "{{ docker_restart_policy_retry }}"
|
|
state: "reloaded"
|
|
username: "{{ docker_registry_username }}"
|
|
volumes: "{{ container_volumes | default([]) }}"
|
|
volumes_from: "{{ container_volumes_from | default([]) }}"
|
|
run_once: "{{ run_once | default('False') }}"
|
|
when: not container_pid|default(False)
|
|
|
|
- name: Starting container(s)
|
|
docker:
|
|
command: "{{ container_command | default(None) }}"
|
|
detach: "{{ container_detach | default('True') }}"
|
|
env: "{{ container_environment | default({}) }}"
|
|
docker_api_version: "{{ docker_api_version }}"
|
|
image: "{{ container_image }}"
|
|
insecure_registry: "{{ docker_insecure_registry }}"
|
|
name: "{{ container_name }}"
|
|
net: "host"
|
|
pid: "host"
|
|
password: "{{ docker_registry_password }}"
|
|
privileged: "{{ container_privileged | default('False') }}"
|
|
pull: "{{ docker_pull_policy }}"
|
|
registry: "{{ docker_registry }}"
|
|
restart_policy: "{{ container_restart_policy | default(docker_restart_policy) }}"
|
|
restart_policy_retry: "{{ docker_restart_policy_retry }}"
|
|
state: "reloaded"
|
|
username: "{{ docker_registry_username }}"
|
|
volumes: "{{ container_volumes | default([]) }}"
|
|
volumes_from: "{{ container_volumes_from | default([]) }}"
|
|
run_once: "{{ run_once | default('False') }}"
|
|
when: container_pid|default(False)
|