Class: Ansible::Ruby::Modules::Docker
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::Docker
- Defined in:
- lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb
Instance Method Summary collapse
-
#cap_add ⇒ Boolean?
Add capabilities for the container.
-
#cap_drop ⇒ Boolean?
Drop capabilities for the container.
-
#command ⇒ String?
Command used to match and launch containers.
-
#count ⇒ Integer?
Number of matching containers that should be in the desired state.
-
#cpu_set ⇒ Object?
CPUs in which to allow execution.
-
#cpu_shares ⇒ Integer?
CPU shares (relative weight).
-
#detach ⇒ Boolean?
Enable detached mode to leave the container running in background.
-
#devices ⇒ Array<String>, ...
List of host devices to expose to container.
-
#dns ⇒ Object?
List of custom DNS servers for the container.
-
#docker_api_version ⇒ String?
Remote API version to use.
-
#docker_url ⇒ String?
URL of the host running the docker daemon.
-
#docker_user ⇒ Object?
Username or UID to use within the container.
-
#domainname ⇒ Object?
Container domain name.
-
#email ⇒ Object?
Remote API email.
-
#entrypoint ⇒ Object?
Corresponds to “–entrypoint“ option of “docker run“ command and “ENTRYPOINT“ directive of Dockerfile.
-
#env ⇒ Hash?
Pass a dict of environment variables to the container.
-
#env_file ⇒ Object?
Pass in a path to a file with environment variable (FOO=BAR).
-
#expose ⇒ Array<Integer>, ...
List of additional container ports to expose for port mappings or links.
-
#extra_hosts ⇒ Hash?
Dict of custom host-to-IP mappings to be defined in the container.
-
#hostname ⇒ Object?
Container hostname.
-
#image ⇒ String
Container image used to match and launch containers.
-
#insecure_registry ⇒ Boolean?
Use insecure private registry by HTTP instead of HTTPS.
-
#labels ⇒ Object?
Set container labels.
-
#links ⇒ Array<String>, ...
List of other containers to link within this container with an optional,alias.
-
#log_driver ⇒ :"json-file", ...
You can specify a different logging driver for the container than for the daemon.
-
#log_opt ⇒ Hash?
Additional options to pass to the logging driver selected above.
-
#lxc_conf ⇒ Object?
LXC configuration parameters, such as C(lxc.aa_profile:unconfined).
-
#memory_limit ⇒ Integer?
RAM allocated to the container as a number of bytes or as a human-readable string like “512MB”.
-
#name ⇒ String?
Name used to match and uniquely name launched containers.
-
#net ⇒ Boolean?
Network mode for the launched container: bridge, none, container:<name|id>,or host.
-
#password ⇒ Object?
Remote API password.
-
#pid ⇒ Object?
Set the PID namespace mode for the container (currently only supports ‘host’).
-
#ports ⇒ Array<String>, ...
List containing private to public port mapping specification.
-
#privileged ⇒ Boolean?
Whether the container should run in privileged mode or not.
-
#publish_all_ports ⇒ Boolean?
Publish all exposed ports to the host interfaces.
-
#pull ⇒ :missing, ...
Control when container images are updated from the C(docker_url) registry.
-
#read_only ⇒ Object?
Mount the container’s root filesystem as read only.
-
#registry ⇒ String?
Remote registry URL to pull images from.
-
#restart_policy ⇒ :no, ...
Container restart policy.,The ‘unless-stopped’ choice is only available starting in Ansible 2.1 and for Docker 1.9 and above.
-
#restart_policy_retry ⇒ Integer?
Maximum number of times to restart a container.
-
#signal ⇒ String?
With the state “killed”, you can alter the signal sent to the container.
-
#state ⇒ :present, ...
Assert the container’s desired state.
-
#stdin_open ⇒ Boolean?
Keep stdin open after a container is launched.
-
#stop_timeout ⇒ Integer?
How many seconds to wait for the container to stop before killing it.
-
#timeout ⇒ Integer?
Docker daemon response timeout in seconds.
-
#tls_ca_cert ⇒ String?
Path to a PEM-encoded certificate authority to secure the Docker connection.
-
#tls_client_cert ⇒ String?
Path to the PEM-encoded certificate used to authenticate docker client.
-
#tls_client_key ⇒ String?
Path to the PEM-encoded key used to authenticate docker client.
-
#tls_hostname ⇒ String?
A hostname to check matches what’s supplied in the docker server’s certificate.
-
#tty ⇒ Boolean?
Allocate a pseudo-tty within the container.
-
#ulimits ⇒ Object?
Ulimits, list ulimits with name, soft and optionally hard limit separated by colons.
-
#use_tls ⇒ :no, ...
Whether to use tls to connect to the docker server.
-
#username ⇒ Object?
Remote API username.
-
#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).
-
#volumes_from ⇒ Array<String>, ...
List of names of containers to mount volumes from.
Methods inherited from Base
Methods inherited from Ansible::Ruby::Models::Base
attr_option, attr_options, attribute, #initialize, #to_h, validates
Constructor Details
This class inherits a constructor from Ansible::Ruby::Models::Base
Instance Method Details
#cap_add ⇒ Boolean?
Returns Add capabilities for the container. Requires docker-py >= 0.5.0.
189 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 189 attribute :cap_add |
#cap_drop ⇒ Boolean?
Returns Drop capabilities for the container. Requires docker-py >= 0.5.0.
193 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 193 attribute :cap_drop |
#command ⇒ String?
Returns Command used to match and launch containers.
25 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 25 attribute :command |
#count ⇒ Integer?
Returns Number of matching containers that should be in the desired state.
10 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 10 attribute :count |
#cpu_set ⇒ Object?
Returns CPUs in which to allow execution. Requires docker-py >= 0.6.0.
186 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 186 attribute :cpu_set |
#cpu_shares ⇒ Integer?
Returns CPU shares (relative weight). Requires docker-py >= 0.6.0.
208 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 208 attribute :cpu_shares |
#detach ⇒ Boolean?
Returns Enable detached mode to leave the container running in background. If disabled, fail unless the process exits cleanly.
129 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 129 attribute :detach |
#devices ⇒ Array<String>, ...
Returns List of host devices to expose to container.
57 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 57 attribute :devices |
#dns ⇒ Object?
Returns List of custom DNS servers for the container.
126 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 126 attribute :dns |
#docker_api_version ⇒ String?
Returns Remote API version to use. This defaults to the current default as specified by docker-py.
97 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 97 attribute :docker_api_version |
#docker_url ⇒ String?
Returns URL of the host running the docker daemon. This will default to the env var DOCKER_HOST if unspecified.
73 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 73 attribute :docker_url |
#docker_user ⇒ Object?
Returns Username or UID to use within the container.
101 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 101 attribute :docker_user |
#domainname ⇒ Object?
Returns Container domain name.
116 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 116 attribute :domainname |
#email ⇒ Object?
Returns Remote API email.
110 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 110 attribute :email |
#entrypoint ⇒ Object?
Returns Corresponds to “–entrypoint“ option of “docker run“ command and “ENTRYPOINT“ directive of Dockerfile. Used to match and launch containers.
22 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 22 attribute :entrypoint |
#env ⇒ Hash?
Returns Pass a dict of environment variables to the container.
119 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 119 attribute :env |
#env_file ⇒ Object?
Returns Pass in a path to a file with environment variable (FOO=BAR). If a key value is present in both explicitly presented (i.e. as ‘env’) and in the environment file, the explicit value will override. Requires docker-py >= 1.4.0.
123 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 123 attribute :env_file |
#expose ⇒ Array<Integer>, ...
Returns List of additional container ports to expose for port mappings or links. If the port is already exposed using EXPOSE in a Dockerfile, you don’t need to expose it again.
37 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 37 attribute :expose |
#extra_hosts ⇒ Hash?
Returns Dict of custom host-to-IP mappings to be defined in the container.
178 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 178 attribute :extra_hosts |
#hostname ⇒ Object?
Returns Container hostname.
113 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 113 attribute :hostname |
#image ⇒ String
Returns Container image used to match and launch containers.
14 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 14 attribute :image |
#insecure_registry ⇒ Boolean?
Returns Use insecure private registry by HTTP instead of HTTPS. Needed for docker-py >= 0.5.0.
182 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 182 attribute :insecure_registry |
#labels ⇒ Object?
Returns Set container labels. Requires docker >= 1.6 and docker-py >= 1.2.0.
197 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 197 attribute :labels |
#links ⇒ Array<String>, ...
Returns List of other containers to link within this container with an optional,alias. Use docker CLI-style syntax: C(redis:myredis).
53 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 53 attribute :links |
#log_driver ⇒ :"json-file", ...
Returns You can specify a different logging driver for the container than for the daemon. “json-file” Default logging driver for Docker. Writes JSON messages to file. docker logs command is available only for this logging driver. “none” disables any logging for the container. “syslog” Syslog logging driver for Docker. Writes log messages to syslog. docker logs command is not available for this logging driver. “journald” Journald logging driver for Docker. Writes log messages to “journald”. “gelf” Graylog Extended Log Format (GELF) logging driver for Docker. Writes log messages to a GELF endpoint likeGraylog or Logstash. “fluentd” Fluentd logging driver for Docker. Writes log messages to “fluentd” (forward input). “awslogs” (added in 2.1) Awslogs logging driver for Docker. Writes log messages to AWS Cloudwatch Logs. If not defined explicitly, the Docker daemon’s default (“json-file”) will apply. Requires docker >= 1.6.0.
61 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 61 attribute :log_driver |
#log_opt ⇒ Hash?
Returns Additional options to pass to the logging driver selected above. See Docker ‘log-driver <docs.docker.com/reference/logging/overview/>` documentation for more information. Requires docker >=1.7.0.
65 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 65 attribute :log_opt |
#lxc_conf ⇒ Object?
Returns LXC configuration parameters, such as C(lxc.aa_profile:unconfined).
145 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 145 attribute :lxc_conf |
#memory_limit ⇒ Integer?
Returns RAM allocated to the container as a number of bytes or as a human-readable string like “512MB”. Leave as “0” to specify no limit.
69 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 69 attribute :memory_limit |
#name ⇒ String?
Returns Name used to match and uniquely name launched containers. Explicit names are used to uniquely identify a single container or to link among containers. Mutually exclusive with a “count” other than “1”.
29 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 29 attribute :name |
#net ⇒ Boolean?
Returns Network mode for the launched container: bridge, none, container:<name|id>,or host. Requires docker >= 0.11.
156 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 156 attribute :net |
#password ⇒ Object?
Returns Remote API password.
107 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 107 attribute :password |
#pid ⇒ Object?
Returns Set the PID namespace mode for the container (currently only supports ‘host’). Requires docker-py >= 1.0.0 and docker >= 1.5.0.
160 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 160 attribute :pid |
#ports ⇒ Array<String>, ...
Returns List containing private to public port mapping specification. Use docker ‘CLI-style 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. The container ports need to be exposed either in the Dockerfile or via the C(expose) option.
33 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 33 attribute :ports |
#privileged ⇒ Boolean?
Returns Whether the container should run in privileged mode or not.
141 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 141 attribute :privileged |
#publish_all_ports ⇒ Boolean?
Returns Publish all exposed ports to the host interfaces.
41 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 41 attribute :publish_all_ports |
#pull ⇒ :missing, ...
Returns Control when container images are updated from the C(docker_url) registry. If “missing,” images will be pulled only when missing from the host; if ‘“always,” the registry will be checked for a newer version of the image’ each time the task executes.
18 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 18 attribute :pull |
#read_only ⇒ Object?
Returns Mount the container’s root filesystem as read only.
167 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 167 attribute :read_only |
#registry ⇒ String?
Returns Remote registry URL to pull images from.
163 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 163 attribute :registry |
#restart_policy ⇒ :no, ...
Returns Container restart policy.,The ‘unless-stopped’ choice is only available starting in Ansible 2.1 and for Docker 1.9 and above.
170 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 170 attribute :restart_policy |
#restart_policy_retry ⇒ Integer?
Returns Maximum number of times to restart a container. Leave as “0” for unlimited retries.
174 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 174 attribute :restart_policy_retry |
#signal ⇒ String?
Returns With the state “killed”, you can alter the signal sent to the container.
133 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 133 attribute :signal |
#state ⇒ :present, ...
Returns Assert the container’s desired state. “present” only asserts that the matching containers exist. “started” asserts that the matching containers both exist and are running, but takes no action if any configuration has changed. “reloaded” (added in Ansible 1.9) asserts that all matching containers are running and restarts any that have any images or configuration out of date. “restarted” unconditionally restarts (or starts) the matching containers. “stopped” and ‘“killed” stop and kill all matching containers. “absent” stops and then’ removes any matching containers.
137 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 137 attribute :state |
#stdin_open ⇒ Boolean?
Returns Keep stdin open after a container is launched.
148 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 148 attribute :stdin_open |
#stop_timeout ⇒ Integer?
Returns How many seconds to wait for the container to stop before killing it.
200 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 200 attribute :stop_timeout |
#timeout ⇒ Integer?
Returns Docker daemon response timeout in seconds.
204 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 204 attribute :timeout |
#tls_ca_cert ⇒ String?
Returns Path to a PEM-encoded certificate authority to secure the Docker connection. This has no effect if use_tls is encrypt.
89 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 89 attribute :tls_ca_cert |
#tls_client_cert ⇒ String?
Returns Path to the PEM-encoded certificate used to authenticate docker client. If specified tls_client_key must be valid.
81 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 81 attribute :tls_client_cert |
#tls_client_key ⇒ String?
Returns Path to the PEM-encoded key used to authenticate docker client. If specified tls_client_cert must be valid.
85 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 85 attribute :tls_client_key |
#tls_hostname ⇒ String?
Returns A hostname to check matches what’s supplied in the docker server’s certificate. If unspecified, the hostname is taken from the docker_url.
93 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 93 attribute :tls_hostname |
#tty ⇒ Boolean?
Returns Allocate a pseudo-tty within the container.
152 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 152 attribute :tty |
#ulimits ⇒ Object?
Returns ulimits, list ulimits with name, soft and optionally hard limit separated by colons. e.g. nofile:1024:2048 Requires docker-py >= 1.2.0 and docker >= 1.6.0.
212 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 212 attribute :ulimits |
#use_tls ⇒ :no, ...
Returns Whether to use tls to connect to the docker server. “no” means not to use tls (and ignore any other tls related parameters). “encrypt” means to use tls to encrypt the connection to the server. “verify” means to also verify that the server’s certificate is valid for the server (this both verifies the certificate against the CA and that the certificate was issued for that host. If this is unspecified, tls will only be used if one of the other tls options require it.
77 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 77 attribute :use_tls |
#username ⇒ Object?
Returns Remote API username.
104 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 104 attribute :username |
#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). Starting at version 2.1, SELinux hosts can additionally use C(z) or C(Z) mount options to use a shared or private label for the volume.
45 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 45 attribute :volumes |
#volumes_from ⇒ Array<String>, ...
Returns List of names of containers to mount volumes from.
49 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker.rb', line 49 attribute :volumes_from |