Class: Ansible::Ruby::Modules::Docker_service
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::Docker_service
- Defined in:
- lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb
Overview
Consumes docker compose to start, shutdown and scale services. Works with compose versions 1 and 2. Compose can be read from a docker-compose.yml (or .yaml) file or inline using the C(definition) option. See the examples for more details. Supports check mode.
Instance Method Summary collapse
-
#build ⇒ Boolean?
Whether or not to build images before starting containers.,Missing images will always be built.,If an image is present and C(build) is false, the image will not be built.,If an image is present and C(build) is true, the image will be built.
-
#debug ⇒ Boolean?
Include I(actions) in the return values.
-
#definition ⇒ Object?
Provide docker-compose yaml describing one or more services, networks and volumes.,Mutually exclusive with C(project_src) and C(project_files).
-
#dependencies ⇒ Boolean?
When C(state) is I(present) specify whether or not to include linked services.
-
#files ⇒ Object?
List of file names relative to C(project_src).
-
#hostname_check ⇒ Boolean?
Whether or not to check the Docker daemon’s hostname against the name provided in the client certificate.
-
#project_name ⇒ Object?
Provide a project name.
-
#project_src ⇒ Object?
Path to a directory containing a docker-compose.yml or docker-compose.yaml file.,Mutually exclusive with C(definition).,Required when no C(definition) is provided.
-
#recreate ⇒ :always, ...
By default containers will be recreated when their configuration differs from the service definition.,Setting to I(never) ignores configuration differences and leaves existing containers unchanged.,Setting to I(always) forces recreation of all existing containers.
-
#remove_images ⇒ Object?
Use with state I(absent) to remove the all images or only local images.
-
#remove_volumes ⇒ Boolean?
Use with state I(absent) to remove data volumes.
-
#restarted ⇒ Boolean?
Use with state I(present) to restart all containers.
-
#scale ⇒ Object?
When C(sate) is I(present) scale services.
-
#services ⇒ Object?
When C(state) is I(present) run I(docker-compose up) on a subset of services.
-
#state ⇒ :absent, ...
Desired state of the project.,Specifying I(present) is the same as running I(docker-compose up).,Specifying I(absent) is the same as running I(docker-compose down).
-
#stopped ⇒ Boolean?
Use with state I(present) to leave the containers in an exited or non-running state.
Methods inherited from Base
Methods inherited from Ansible::Ruby::Models::Base
attr_option, attr_options, attribute, #initialize, remove_existing_validations, #to_h, validates
Constructor Details
This class inherits a constructor from Ansible::Ruby::Models::Base
Instance Method Details
#build ⇒ Boolean?
Returns Whether or not to build images before starting containers.,Missing images will always be built.,If an image is present and C(build) is false, the image will not be built.,If an image is present and C(build) is true, the image will be built.
49 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 49 attribute :build |
#debug ⇒ Boolean?
Returns Include I(actions) in the return values.
68 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 68 attribute :debug |
#definition ⇒ Object?
Returns Provide docker-compose yaml describing one or more services, networks and volumes.,Mutually exclusive with C(project_src) and C(project_files).
38 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 38 attribute :definition |
#dependencies ⇒ Boolean?
Returns When C(state) is I(present) specify whether or not to include linked services.
34 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 34 attribute :dependencies |
#files ⇒ Object?
Returns List of file names relative to C(project_src). Overrides docker-compose.yml or docker-compose.yaml.,Files are loaded and merged in the order given.
21 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 21 attribute :files |
#hostname_check ⇒ Boolean?
Returns Whether or not to check the Docker daemon’s hostname against the name provided in the client certificate.
41 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 41 attribute :hostname_check |
#project_name ⇒ Object?
Returns Provide a project name. If not provided, the project name is taken from the basename of C(project_src).,Required when no C(definition) is provided.
18 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 18 attribute :project_name |
#project_src ⇒ Object?
Returns Path to a directory containing a docker-compose.yml or docker-compose.yaml file.,Mutually exclusive with C(definition).,Required when no C(definition) is provided.
15 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 15 attribute :project_src |
#recreate ⇒ :always, ...
Returns By default containers will be recreated when their configuration differs from the service definition.,Setting to I(never) ignores configuration differences and leaves existing containers unchanged.,Setting to I(always) forces recreation of all existing containers.
45 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 45 attribute :recreate |
#remove_images ⇒ Object?
Returns Use with state I(absent) to remove the all images or only local images.
53 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 53 attribute :remove_images |
#remove_volumes ⇒ Boolean?
Returns Use with state I(absent) to remove data volumes.
56 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 56 attribute :remove_volumes |
#restarted ⇒ Boolean?
Returns Use with state I(present) to restart all containers.
64 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 64 attribute :restarted |
#scale ⇒ Object?
Returns When C(sate) is I(present) scale services. Provide a dictionary of key/value pairs where the key is the name of the service and the value is an integer count for the number of containers.
31 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 31 attribute :scale |
#services ⇒ Object?
Returns When C(state) is I(present) run I(docker-compose up) on a subset of services.
28 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 28 attribute :services |
#state ⇒ :absent, ...
Returns Desired state of the project.,Specifying I(present) is the same as running I(docker-compose up).,Specifying I(absent) is the same as running I(docker-compose down).
24 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 24 attribute :state |
#stopped ⇒ Boolean?
Returns Use with state I(present) to leave the containers in an exited or non-running state.
60 |
# File 'lib/ansible/ruby/modules/generated/core/cloud/docker/docker_service.rb', line 60 attribute :stopped |