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/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 ⇒ :yes, ...
Use with state I(present) to always build images prior to starting the application.,Same as running docker-compose build with the pull option.,Images will only be rebuilt if Docker detects a change in the Dockerfile or build directory contents.,Use the C(nocache) option to ignore the image cache when performing the build.,If an existing image is replaced, services using the image will be recreated unless C(recreate) is I(never).
-
#definition ⇒ Object?
Provide docker-compose yaml describing one or more services, networks and volumes.,Mutually exclusive with C(project_src) and C(files).
-
#dependencies ⇒ :yes, ...
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 ⇒ :yes, ...
Whether or not to check the Docker daemon’s hostname against the name provided in the client certificate.
-
#nocache ⇒ :yes, ...
Use with the build option to ignore the cache during the image build process.
-
#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.
-
#pull ⇒ :yes, ...
Use with state I(present) to always pull images prior to starting the application.,Same as running docker-compose pull.,When a new image is pulled, services using the image will be recreated unless C(recreate) is I(never).
-
#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 ⇒ :all, ...
Use with state I(absent) to remove the all images or only local images.
-
#remove_orphans ⇒ Symbol?
Remove containers for services not defined in the compose file.
-
#remove_volumes ⇒ :yes, ...
Use with state I(absent) to remove data volumes.
-
#restarted ⇒ :yes, ...
Use with state I(present) to restart all containers.
-
#scale ⇒ Object?
When C(state) 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 ⇒ :yes, ...
Use with state I(present) to leave the containers in an exited or non-running state.
-
#timeout ⇒ Integer?
Timeout in seconds for container shutdown when attached or when containers are already running.
Methods inherited from Base
Methods inherited from Ansible::Ruby::Models::Base
attr_option, attr_options, attribute, fix_inclusion, #initialize, remove_existing_validations, #to_h, validates
Constructor Details
This class inherits a constructor from Ansible::Ruby::Models::Base
Instance Method Details
#build ⇒ :yes, ...
50 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 50 attribute :build |
#definition ⇒ Object?
39 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 39 attribute :definition |
#dependencies ⇒ :yes, ...
35 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 35 attribute :dependencies |
#files ⇒ Object?
22 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 22 attribute :files |
#hostname_check ⇒ :yes, ...
42 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 42 attribute :hostname_check |
#nocache ⇒ :yes, ...
58 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 58 attribute :nocache |
#project_name ⇒ Object?
19 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 19 attribute :project_name |
#project_src ⇒ Object?
16 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 16 attribute :project_src |
#pull ⇒ :yes, ...
54 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 54 attribute :pull |
#recreate ⇒ :always, ...
46 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 46 attribute :recreate |
#remove_images ⇒ :all, ...
62 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 62 attribute :remove_images |
#remove_orphans ⇒ Symbol?
78 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 78 attribute :remove_orphans |
#remove_volumes ⇒ :yes, ...
66 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 66 attribute :remove_volumes |
#restarted ⇒ :yes, ...
74 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 74 attribute :restarted |
#scale ⇒ Object?
32 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 32 attribute :scale |
#services ⇒ Object?
29 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 29 attribute :services |
#state ⇒ :absent, ...
25 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 25 attribute :state |
#stopped ⇒ :yes, ...
70 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 70 attribute :stopped |
#timeout ⇒ Integer?
82 |
# File 'lib/ansible/ruby/modules/generated/cloud/docker/docker_service.rb', line 82 attribute :timeout |