Sha256: d3103c0549dcae244763a1ba858c2df4583c3ab9e36ad2018b88060e5a768d26

Contents?: true

Size: 970 Bytes

Versions: 48

Compression:

Stored size: 970 Bytes

Contents

# frozen_string_literal: true

# tau ship container list
module ShipContainerList
  # List takelship containers.
  def ship_container_list
    log.debug 'List takelship containers'

    _ship_container_list_get_inventory.to_yaml
  end

  private

  # Get the current inventory
  def _ship_container_list_get_inventory
    ship_name = config.active['ship_name']
    destination = '/home/podman/takelship'
    ship_docker = config.active['cmd_ship_docker']
    inventory = _ship_container_list_new_inventory ship_name
    _ship_container_lib_get_containers.each do |container|
      name = (_docker_container_lib_get_container_name_by_id container).strip
      dir = _docker_container_lib_get_mounted_dir name, destination, ship_docker
      inventory[ship_name]['hosts'] << { name => dir }
    end
    inventory
  end

  # Create a new inventory
  def _ship_container_list_new_inventory(ship_name)
    {
      ship_name => {
        'hosts' => []
      }
    }
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
takeltau-0.46.9 lib/takeltau/ship/container/list.rb
takeltau-0.46.8 lib/takeltau/ship/container/list.rb
takeltau-0.46.5 lib/takeltau/ship/container/list.rb
takeltau-0.46.1 lib/takeltau/ship/container/list.rb
takeltau-0.46.0 lib/takeltau/ship/container/list.rb
takeltau-0.45.27 lib/takeltau/ship/container/list.rb
takeltau-0.45.26 lib/takeltau/ship/container/list.rb
takeltau-0.45.24 lib/takeltau/ship/container/list.rb
takeltau-0.45.23 lib/takeltau/ship/container/list.rb
takeltau-0.45.22 lib/takeltau/ship/container/list.rb
takeltau-0.45.21 lib/takeltau/ship/container/list.rb
takeltau-0.45.19 lib/takeltau/ship/container/list.rb
takeltau-0.45.17 lib/takeltau/ship/container/list.rb
takeltau-0.45.16 lib/takeltau/ship/container/list.rb
takeltau-0.45.14 lib/takeltau/ship/container/list.rb
takeltau-0.45.13 lib/takeltau/ship/container/list.rb
takeltau-0.45.12 lib/takeltau/ship/container/list.rb
takeltau-0.45.11 lib/takeltau/ship/container/list.rb
takeltau-0.45.10 lib/takeltau/ship/container/list.rb
takeltau-0.45.9 lib/takeltau/ship/container/list.rb