Sha256: ce7ca00eead083acd9fed49a9db4f325c1da72073d7b7f1333dfcc1dd9b61039
Contents?: true
Size: 1.04 KB
Versions: 40
Compression:
Stored size: 1.04 KB
Contents
# frozen_string_literal: true # tau docker container list module DockerContainerList # List docker containers. def docker_container_list log.debug 'List docker containers' _docker_container_list_get_inventory.to_yaml end private # Get the current inventory def _docker_container_list_get_inventory destination = '/project' docker = config.active['cmd_docker'] inventory = _docker_container_list_new_inventory _docker_container_lib_get_containers.each do |container| name = _docker_container_lib_get_container_name_by_id container dir = (_docker_container_lib_get_mounted_dir name, destination, docker).strip if docker_container_check_orphaned container inventory['orphaned']['hosts'] << { name => dir } else inventory['login']['hosts'] << { name => dir } end end inventory end # Create a new inventory def _docker_container_list_new_inventory { 'login' => { 'hosts' => [] }, 'orphaned' => { 'hosts' => [] } } end end
Version data entries
40 entries across 40 versions & 1 rubygems