Class: Ansible::Ruby::Modules::Docker_container
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::Docker_container
- Defined in:
- lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb,
lib/ansible/ruby/modules/custom/cloud/core/docker/docker_container.rb
Overview
Manage the life cycle of docker containers. Supports check mode. Run with –check and –diff to view config difference and list of actions to be taken.
Instance Method Summary collapse
-
#auto_remove ⇒ :yes, ...
Enable auto-removal of the container on daemon side when the container’s process exits.
-
#blkio_weight ⇒ Object?
Block IO (relative weight), between 10 and 1000.
-
#cap_drop ⇒ Array<String>, ...
List of capabilities to drop from the container.
-
#capabilities ⇒ Array<String>, ...
List of capabilities to add to the container.
-
#cleanup ⇒ :yes, ...
Use with I(detach=false) to remove the container after successful execution.
-
#command ⇒ Array<String>, ...
Command to execute when the container starts.
-
#cpu_period ⇒ Integer?
Limit CPU CFS (Completely Fair Scheduler) period.
-
#cpu_quota ⇒ Integer?
Limit CPU CFS (Completely Fair Scheduler) quota.
-
#cpu_shares ⇒ Object?
CPU shares (relative weight).
-
#cpuset_cpus ⇒ Object?
CPUs in which to allow execution C(1,3) or C(1-3).
-
#cpuset_mems ⇒ Object?
Memory nodes (MEMs) in which to allow execution C(0-3) or C(0,1).
-
#detach ⇒ Boolean?
Enable detached mode to leave the container running in background.
-
#devices ⇒ Array<String>, ...
List of host device bindings to add to the container.
-
#dns_opts ⇒ Object?
List of DNS options.
-
#dns_search_domains ⇒ Object?
List of custom DNS search domains.
-
#dns_servers ⇒ Object?
List of custom DNS servers.
-
#domainname ⇒ Object?
Container domainname.
-
#entrypoint ⇒ Object?
Command that overwrites the default ENTRYPOINT of the image.
-
#env ⇒ Hash?
Dictionary of key,value pairs.
-
#env_file ⇒ String?
Path to a file, present on the target, containing environment variables I(FOO=BAR).,If variable also present in C(env), then C(env) value will override.
-
#etc_hosts ⇒ Object?
Dict of host-to-IP mappings, where each host name is a key in the dictionary.
-
#exposed_ports ⇒ Array<Integer>, ...
List of additional container ports which informs Docker that the container listens on the specified network ports at runtime.
-
#force_kill ⇒ :yes, ...
Use the kill command when stopping a running container.
-
#groups ⇒ Object?
List of additional group names and/or IDs that the container process will run as.
-
#hostname ⇒ Object?
Container hostname.
-
#ignore_image ⇒ :yes, ...
When C(state) is I(present) or I(started) the module compares the configuration of an existing container to requested configuration.
-
#image ⇒ String?
Repository path and tag used to create the container.
-
#init ⇒ :yes, ...
Run an init inside the container that forwards signals and reaps processes.
-
#interactive ⇒ :yes, ...
Keep stdin open after a container is launched, even if not attached.
-
#ipc_mode ⇒ Object?
Set the IPC mode for the container.
-
#keep_volumes ⇒ :yes, ...
Retain volumes associated with a removed container.
-
#kernel_memory ⇒ Integer?
Kernel memory limit (format: C(<number>)).
-
#kill_signal ⇒ Object?
Override default signal used to kill a running container.
-
#labels ⇒ Object?
Dictionary of key value pairs.
-
#links ⇒ Array<String>, ...
List of name aliases for linked containers in the format C(container_name:alias).,Setting this will force container to be restarted.
-
#log_driver ⇒ String?
Specify the logging driver.
-
#log_options ⇒ Hash?
Dictionary of options specific to the chosen log_driver.
-
#mac_address ⇒ Object?
Container MAC address (e.g. 92:d0:c6:0a:29:33).
-
#memory ⇒ String?
Memory limit (format: C(<number>)).
-
#memory_reservation ⇒ Integer?
Memory soft limit (format: C(<number>)).
-
#memory_swap ⇒ Integer?
Total memory limit (memory + swap, format: C(<number>)).
-
#memory_swappiness ⇒ Object?
Tune a container’s memory swappiness behavior.
-
#name ⇒ String
Assign a name to a new container or match an existing container.,When identifying an existing container name may be a name or a long or short container ID.
-
#network_mode ⇒ Object?
Connect the container to a network.
-
#networks ⇒ Array<Hash>, ...
List of networks the container belongs to.,Each network is a dict with keys C(name), C(ipv4_address), C(ipv6_address), C(links), C(aliases).,For each network C(name) is required, all other keys are optional.,If included, C(links) or C(aliases) are lists.,For examples of the data structure and usage see EXAMPLES below.,To remove a container from one or more networks, use the C(purge_networks) option.,Note that as opposed to C(docker run …), M(docker_container) does not remove the default network if C(networks) is specified.
-
#oom_killer ⇒ :yes, ...
Whether or not to disable OOM Killer for the container.
-
#oom_score_adj ⇒ Integer?
An integer value containing the score given to the container in order to tune OOM killer preferences.
-
#output_logs ⇒ :yes, ...
If set to true, output of the container command will be printed (only effective when log_driver is set to json-file or journald..
-
#paused ⇒ :yes, ...
Use with the started state to pause running processes inside the container.
-
#pid_mode ⇒ Object?
Set the PID namespace mode for the container.
-
#privileged ⇒ :yes, ...
Give extended privileges to the container.
-
#published_ports ⇒ Object?
List of ports to publish from the container to the host.,Use docker CLI syntax: C(8000), C(9000:8000), or C(0.0.0.0:9000:8000), where 8000 is a container port, 9000 is a host port, and 0.0.0.0 is a host interface.,Container ports must be exposed either in the Dockerfile or via the C(expose) option.,A value of C(all) will publish all exposed container ports to random host ports, ignoring any other mappings.,If C(networks) parameter is provided, will inspect each network to see if there exists a bridge network with optional parameter com.docker.network.bridge.host_binding_ipv4.
-
#pull ⇒ :yes, ...
If true, always pull the latest version of an image.
-
#purge_networks ⇒ :yes, ...
Remove the container from ALL networks not included in C(networks) parameter.,Any default networks such as I(bridge), if not found in C(networks), will be removed as well.
-
#read_only ⇒ :yes, ...
Mount the container’s root file system as read-only.
-
#recreate ⇒ :yes, ...
Use with present and started states to force the re-creation of an existing container.
-
#restart ⇒ :yes, ...
Use with started state to force a matching container to be stopped and restarted.
-
#restart_policy ⇒ :no, ...
Container restart policy.
-
#restart_retries ⇒ Integer?
Use with restart policy to control maximum number of restart attempts.
-
#security_opts ⇒ Object?
List of security options in the form of C(“label:user:User”).
-
#shm_size ⇒ Object?
Size of C(/dev/shm) (format: C(<number>)).
-
#state ⇒ :absent, ...
I(absent) - A container matching the specified name will be stopped and removed.
-
#stop_signal ⇒ Object?
Override default signal used to stop the container.
-
#stop_timeout ⇒ Object?
Number of seconds to wait for the container to stop before sending SIGKILL.
-
#sysctls ⇒ Object?
Dictionary of key,value pairs.
-
#tmpfs ⇒ Object?
Mount a tmpfs directory.
- #to_h ⇒ Object
-
#trust_image_content ⇒ :yes, ...
If C(yes), skip image verification.
-
#tty ⇒ :yes, ...
Allocate a pseudo-TTY.
-
#ulimits ⇒ Object?
List of ulimit options.
-
#user ⇒ Object?
Sets the username or UID used and optionally the groupname or GID for the specified command.,Can be [ user | user:group | uid | uid:gid | user:gid | uid:group ].
-
#userns_mode ⇒ Object?
User namespace to use.
-
#uts ⇒ Object?
Set the UTS namespace mode for the container.
-
#volume_driver ⇒ Object?
The container volume driver.
-
#volumes ⇒ Array<String>, ...
List of volumes to mount within the container.,Use docker CLI-style syntax: C(/host:/container),You can specify a read mode for the mount with either C(ro) or C(rw).,SELinux hosts can additionally use C(z) or C(Z) to use a shared or private label for the volume.
-
#volumes_from ⇒ Array<String>, ...
List of container names or Ids to get volumes from.
-
#working_dir ⇒ Object?
Path to the working directory.
Methods inherited from Base
Methods inherited from Ansible::Ruby::Models::Base
attr_option, attr_options, attribute, #initialize, remove_existing_validations, validates
Constructor Details
This class inherits a constructor from Ansible::Ruby::Models::Base
Instance Method Details
#auto_remove ⇒ :yes, ...
Returns enable auto-removal of the container on daemon side when the container’s process exits.
13 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 13 attribute :auto_remove |
#blkio_weight ⇒ Object?
Returns Block IO (relative weight), between 10 and 1000.
17 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 17 attribute :blkio_weight |
#cap_drop ⇒ Array<String>, ...
Returns List of capabilities to drop from the container.
24 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 24 attribute :cap_drop |
#capabilities ⇒ Array<String>, ...
Returns List of capabilities to add to the container.
20 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 20 attribute :capabilities |
#cleanup ⇒ :yes, ...
Returns Use with I(detach=false) to remove the container after successful execution.
28 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 28 attribute :cleanup |
#command ⇒ Array<String>, ...
Returns Command to execute when the container starts. A command may be either a string or a list. Prior to version 2.4, strings were split on commas.
32 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 32 attribute :command |
#cpu_period ⇒ Integer?
Returns Limit CPU CFS (Completely Fair Scheduler) period.
36 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 36 attribute :cpu_period |
#cpu_quota ⇒ Integer?
Returns Limit CPU CFS (Completely Fair Scheduler) quota.
40 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 40 attribute :cpu_quota |
#cpu_shares ⇒ Object?
Returns CPU shares (relative weight).
50 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 50 attribute :cpu_shares |
#cpuset_cpus ⇒ Object?
Returns CPUs in which to allow execution C(1,3) or C(1-3).
44 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 44 attribute :cpuset_cpus |
#cpuset_mems ⇒ Object?
Returns Memory nodes (MEMs) in which to allow execution C(0-3) or C(0,1).
47 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 47 attribute :cpuset_mems |
#detach ⇒ Boolean?
Returns Enable detached mode to leave the container running in background. If disabled, the task will reflect the status of the container run (failed if the command failed).
53 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 53 attribute :detach |
#devices ⇒ Array<String>, ...
Returns List of host device bindings to add to the container. Each binding is a mapping expressed in the format: <path_on_host>:<path_in_container>:<cgroup_permissions>.
57 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 57 attribute :devices |
#dns_opts ⇒ Object?
Returns list of DNS options.
61 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 61 attribute :dns_opts |
#dns_search_domains ⇒ Object?
Returns List of custom DNS search domains.
67 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 67 attribute :dns_search_domains |
#dns_servers ⇒ Object?
Returns List of custom DNS servers.
64 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 64 attribute :dns_servers |
#domainname ⇒ Object?
Returns Container domainname.
70 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 70 attribute :domainname |
#entrypoint ⇒ Object?
Returns Command that overwrites the default ENTRYPOINT of the image.
81 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 81 attribute :entrypoint |
#env ⇒ Hash?
Returns Dictionary of key,value pairs.
73 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 73 attribute :env |
#env_file ⇒ String?
Returns Path to a file, present on the target, containing environment variables I(FOO=BAR).,If variable also present in C(env), then C(env) value will override.
77 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 77 attribute :env_file |
#etc_hosts ⇒ Object?
Returns Dict of host-to-IP mappings, where each host name is a key in the dictionary. Each host name will be added to the container’s /etc/hosts file.
84 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 84 attribute :etc_hosts |
#exposed_ports ⇒ Array<Integer>, ...
Returns List of additional container ports which informs Docker that the container listens on the specified network ports at runtime. If the port is already exposed using EXPOSE in a Dockerfile, it does not need to be exposed again.
87 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 87 attribute :exposed_ports |
#force_kill ⇒ :yes, ...
Returns Use the kill command when stopping a running container.
91 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 91 attribute :force_kill |
#groups ⇒ Object?
Returns List of additional group names and/or IDs that the container process will run as.
95 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 95 attribute :groups |
#hostname ⇒ Object?
Returns Container hostname.
98 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 98 attribute :hostname |
#ignore_image ⇒ :yes, ...
Returns When C(state) is I(present) or I(started) the module compares the configuration of an existing container to requested configuration. The evaluation includes the image version. If the image version in the registry does not match the container, the container will be recreated. Stop this behavior by setting C(ignore_image) to I(True).
101 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 101 attribute :ignore_image |
#image ⇒ String?
Returns Repository path and tag used to create the container. If an image is not found or pull is true, the image will be pulled from the registry. If no tag is included, ‘latest’ will be used.
105 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 105 attribute :image |
#init ⇒ :yes, ...
Returns Run an init inside the container that forwards signals and reaps processes. This option requires Docker API 1.25+.
109 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 109 attribute :init |
#interactive ⇒ :yes, ...
Returns Keep stdin open after a container is launched, even if not attached.
113 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 113 attribute :interactive |
#ipc_mode ⇒ Object?
Returns Set the IPC mode for the container. Can be one of ‘container:<name|id>’ to reuse another container’s IPC namespace or ‘host’ to use the host’s IPC namespace within the container.
117 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 117 attribute :ipc_mode |
#keep_volumes ⇒ :yes, ...
Returns Retain volumes associated with a removed container.
120 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 120 attribute :keep_volumes |
#kernel_memory ⇒ Integer?
Returns Kernel memory limit (format: C(<number>)). Number is a positive integer. Unit can be C(B) (byte), C(K) (kibibyte, 1024B), C(M) (mebibyte), C(G) (gibibyte), C(T) (tebibyte), or C(P) (pebibyte). Minimum is C(4M).,Omitting the unit defaults to bytes.
127 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 127 attribute :kernel_memory |
#kill_signal ⇒ Object?
Returns Override default signal used to kill a running container.
124 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 124 attribute :kill_signal |
#labels ⇒ Object?
Returns Dictionary of key value pairs.
131 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 131 attribute :labels |
#links ⇒ Array<String>, ...
Returns List of name aliases for linked containers in the format C(container_name:alias).,Setting this will force container to be restarted.
134 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 134 attribute :links |
#log_driver ⇒ String?
Returns Specify the logging driver. Docker uses I(json-file) by default.,See L(here,docs.docker.com/config/containers/logging/configure/) for possible choices.
138 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 138 attribute :log_driver |
#log_options ⇒ Hash?
Returns Dictionary of options specific to the chosen log_driver. See docs.docker.com/engine/admin/logging/overview/ for details.
142 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 142 attribute :log_options |
#mac_address ⇒ Object?
Returns Container MAC address (e.g. 92:d0:c6:0a:29:33).
146 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 146 attribute :mac_address |
#memory ⇒ String?
Returns Memory limit (format: C(<number>)). Number is a positive integer. Unit can be C(B) (byte), C(K) (kibibyte, 1024B), C(M) (mebibyte), C(G) (gibibyte), C(T) (tebibyte), or C(P) (pebibyte).,Omitting the unit defaults to bytes.
149 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 149 attribute :memory |
#memory_reservation ⇒ Integer?
Returns Memory soft limit (format: C(<number>)). Number is a positive integer. Unit can be C(B) (byte), C(K) (kibibyte, 1024B), C(M) (mebibyte), C(G) (gibibyte), C(T) (tebibyte), or C(P) (pebibyte).,Omitting the unit defaults to bytes.
153 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 153 attribute :memory_reservation |
#memory_swap ⇒ Integer?
Returns Total memory limit (memory + swap, format: C(<number>)). Number is a positive integer. Unit can be C(B) (byte), C(K) (kibibyte, 1024B), C(M) (mebibyte), C(G) (gibibyte), C(T) (tebibyte), or C(P) (pebibyte).,Omitting the unit defaults to bytes.
157 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 157 attribute :memory_swap |
#memory_swappiness ⇒ Object?
Returns Tune a container’s memory swappiness behavior. Accepts an integer between 0 and 100.,If not set, the value will be remain the same if container exists and will be inherited from the host machine if it is (re-)created.
161 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 161 attribute :memory_swappiness |
#name ⇒ String
Returns Assign a name to a new container or match an existing container.,When identifying an existing container name may be a name or a long or short container ID.
164 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 164 attribute :name |
#network_mode ⇒ Object?
Returns Connect the container to a network. Choices are “bridge”, “host”, “none” or “container:<name|id>”.
168 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 168 attribute :network_mode |
#networks ⇒ Array<Hash>, ...
Returns List of networks the container belongs to.,Each network is a dict with keys C(name), C(ipv4_address), C(ipv6_address), C(links), C(aliases).,For each network C(name) is required, all other keys are optional.,If included, C(links) or C(aliases) are lists.,For examples of the data structure and usage see EXAMPLES below.,To remove a container from one or more networks, use the C(purge_networks) option.,Note that as opposed to C(docker run …), M(docker_container) does not remove the default network if C(networks) is specified. You need to explicity use C(purge_networks) to enforce the removal of the default network (and all other networks not explicitly mentioned in C(networks)).
174 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 174 attribute :networks |
#oom_killer ⇒ :yes, ...
Returns Whether or not to disable OOM Killer for the container.
178 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 178 attribute :oom_killer |
#oom_score_adj ⇒ Integer?
Returns An integer value containing the score given to the container in order to tune OOM killer preferences.
182 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 182 attribute :oom_score_adj |
#output_logs ⇒ :yes, ...
Returns If set to true, output of the container command will be printed (only effective when log_driver is set to json-file or journald.
186 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 186 attribute :output_logs |
#paused ⇒ :yes, ...
Returns Use with the started state to pause running processes inside the container.
190 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 190 attribute :paused |
#pid_mode ⇒ Object?
Returns Set the PID namespace mode for the container. Currently only supports ‘host’.
194 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 194 attribute :pid_mode |
#privileged ⇒ :yes, ...
Returns Give extended privileges to the container.
197 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 197 attribute :privileged |
#published_ports ⇒ Object?
Returns List of ports to publish from the container to the host.,Use docker CLI syntax: C(8000), C(9000:8000), or C(0.0.0.0:9000:8000), where 8000 is a container port, 9000 is a host port, and 0.0.0.0 is a host interface.,Container ports must be exposed either in the Dockerfile or via the C(expose) option.,A value of C(all) will publish all exposed container ports to random host ports, ignoring any other mappings.,If C(networks) parameter is provided, will inspect each network to see if there exists a bridge network with optional parameter com.docker.network.bridge.host_binding_ipv4. If such a network is found, then published ports where no host IP address is specified will be bound to the host IP pointed to by com.docker.network.bridge.host_binding_ipv4. Note that the first bridge network with a com.docker.network.bridge.host_binding_ipv4 value encountered in the list of C(networks) is the one that will be used.
201 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 201 attribute :published_ports |
#pull ⇒ :yes, ...
Returns If true, always pull the latest version of an image. Otherwise, will only pull an image when missing.
204 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 204 attribute :pull |
#purge_networks ⇒ :yes, ...
Returns Remove the container from ALL networks not included in C(networks) parameter.,Any default networks such as I(bridge), if not found in C(networks), will be removed as well.
208 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 208 attribute :purge_networks |
#read_only ⇒ :yes, ...
Returns Mount the container’s root file system as read-only.
212 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 212 attribute :read_only |
#recreate ⇒ :yes, ...
Returns Use with present and started states to force the re-creation of an existing container.
216 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 216 attribute :recreate |
#restart ⇒ :yes, ...
Returns Use with started state to force a matching container to be stopped and restarted.
220 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 220 attribute :restart |
#restart_policy ⇒ :no, ...
Returns Container restart policy. Place quotes around I(no) option.
224 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 224 attribute :restart_policy |
#restart_retries ⇒ Integer?
Returns Use with restart policy to control maximum number of restart attempts.
228 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 228 attribute :restart_retries |
#security_opts ⇒ Object?
Returns List of security options in the form of C(“label:user:User”).
235 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 235 attribute :security_opts |
#shm_size ⇒ Object?
Returns Size of C(/dev/shm) (format: C(<number>)). Number is positive integer. Unit can be C(B) (byte), C(K) (kibibyte, 1024B), C(M) (mebibyte), C(G) (gibibyte), C(T) (tebibyte), or C(P) (pebibyte).,Omitting the unit defaults to bytes. If you omit the size entirely, the system uses C(64M).
232 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 232 attribute :shm_size |
#state ⇒ :absent, ...
Returns I(absent) - A container matching the specified name will be stopped and removed. Use force_kill to kill the container rather than stopping it. Use keep_volumes to retain volumes associated with the removed container.,I(present) - Asserts the existence of a container matching the name and any provided configuration parameters. If no container matches the name, a container will be created. If a container matches the name but the provided configuration does not match, the container will be updated, if it can be. If it cannot be updated, it will be removed and re-created with the requested config. Image version will be taken into account when comparing configuration. To ignore image version use the ignore_image option. Use the recreate option to force the re-creation of the matching container. Use force_kill to kill the container rather than stopping it. Use keep_volumes to retain volumes associated with a removed container.,I(started) - Asserts there is a running container matching the name and any provided configuration. If no container matches the name, a container will be created and started. If a container matching the name is found but the configuration does not match, the container will be updated, if it can be. If it cannot be updated, it will be removed and a new container will be created with the requested configuration and started. Image version will be taken into account when comparing configuration. To ignore image version use the ignore_image option. Use recreate to always re-create a matching container, even if it is running. Use restart to force a matching container to be stopped and restarted. Use force_kill to kill a container rather than stopping it. Use keep_volumes to retain volumes associated with a removed container.,I(stopped) - Asserts that the container is first I(present), and then if the container is running moves it to a stopped state. Use force_kill to kill a container rather than stopping it.
238 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 238 attribute :state |
#stop_signal ⇒ Object?
Returns Override default signal used to stop the container.
242 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 242 attribute :stop_signal |
#stop_timeout ⇒ Object?
Returns Number of seconds to wait for the container to stop before sending SIGKILL.
245 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 245 attribute :stop_timeout |
#sysctls ⇒ Object?
Returns Dictionary of key,value pairs.
262 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 262 attribute :sysctls |
#tmpfs ⇒ Object?
Returns Mount a tmpfs directory.
252 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 252 attribute :tmpfs |
#to_h ⇒ Object
18 19 20 21 22 23 |
# File 'lib/ansible/ruby/modules/custom/cloud/core/docker/docker_container.rb', line 18 def to_h result = super data = result[:docker_container] data[:volumes] = transform_volumes data[:volumes] if data.include? :volumes result end |
#trust_image_content ⇒ :yes, ...
Returns If C(yes), skip image verification.
248 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 248 attribute :trust_image_content |
#tty ⇒ :yes, ...
Returns Allocate a pseudo-TTY.
255 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 255 attribute :tty |
#ulimits ⇒ Object?
Returns List of ulimit options. A ulimit is specified as C(nofile:262144:262144).
259 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 259 attribute :ulimits |
#user ⇒ Object?
Returns Sets the username or UID used and optionally the groupname or GID for the specified command.,Can be [ user | user:group | uid | uid:gid | user:gid | uid:group ].
265 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 265 attribute :user |
#userns_mode ⇒ Object?
Returns User namespace to use.
171 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 171 attribute :userns_mode |
#uts ⇒ Object?
Returns Set the UTS namespace mode for the container.
268 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 268 attribute :uts |
#volume_driver ⇒ Object?
Returns The container volume driver.
275 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 275 attribute :volume_driver |
#volumes ⇒ Array<String>, ...
Returns List of volumes to mount within the container.,Use docker CLI-style syntax: C(/host:/container),You can specify a read mode for the mount with either C(ro) or C(rw).,SELinux hosts can additionally use C(z) or C(Z) to use a shared or private label for the volume.
271 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 271 attribute :volumes |
#volumes_from ⇒ Array<String>, ...
Returns List of container names or Ids to get volumes from.
278 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 278 attribute :volumes_from |
#working_dir ⇒ Object?
Returns Path to the working directory.
282 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_container.rb', line 282 attribute :working_dir |