Defined Type: nexus::resource::repository::docker::proxy

Defined in:
manifests/resource/repository/docker/proxy.pp

Summary

Resource to manage docker proxy repository

Overview

Examples:

nexus::repository::docker::proxy { 'docker-docker.io':
   proxy_remote_url => 'https://registry-1.docker.io',
}

Parameters:

  • proxy_remote_url (Stdlib::HTTPSUrl)

    Docker repository url like registry-1.docker.io.

  • ensure (Enum['present', 'absent']) (defaults to: 'present')

    Define if the resource should be created/present or deleted/absent.

  • http_client_auto_block (Boolean) (defaults to: true)

    Auto-block outbound connections on the repository if remote peer is detected as unreachable/unresponsive.

  • http_client_blocked (Boolean) (defaults to: false)

    Block outbound connections on the repository.

  • negative_cache_enabled (Boolean) (defaults to: true)

    Cache responses for content not present in the proxied repository.

  • negative_cache_time_to_live (Integer) (defaults to: 1440)

    How long to cache the fact that a file was not found in the repository (in minutes).

  • online (Boolean) (defaults to: true)

    Enable this repository in nexus repository manager that it can be used.

  • proxy_content_max_age (Integer) (defaults to: 1440)

    Max age of content (packages).

  • proxy_metadata_max_age (Integer) (defaults to: 1440)

    Max age of the repository metadata.

  • storage_blob_store_name (String[1]) (defaults to: $title)

    The name of the blobstore inside of nexus repository manager to be used. We suggest to use a own blobstore for each defined repository.

  • storage_strict_content_type_validation (Boolean) (defaults to: true)

    Validate that all content uploaded to this repository is of a MIME type appropriate for the repository format.

  • storage_write_policy (Enum['ALLOW','ALLOW_ONCE','DENY']) (defaults to: 'ALLOW')

    Controls if deployments of and updates to artifacts are allowed.

  • docker_v1_enabled (Boolean) (defaults to: false)

    Allow clients to use the V1 API to interact with this repository.

  • docker_force_basic_auth (Boolean) (defaults to: true)

    Allow anonymous docker pull ( Docker Bearer Token Realm required ).

  • docker_http_port (Optional[Stdlib::Port]) (defaults to: undef)

    Create an HTTP connector at specified port. Normally used if the server is behind a secure proxy.

  • docker_https_port (Optional[Stdlib::Port]) (defaults to: undef)

    Create an HTTPS connector at specified port. Normally used if the server is configured for https.

  • docker_proxy_index_type (Enum['REGISTRY','HUB','CUSTOM']) (defaults to: 'HUB')
  • docker_proxy_index_url (Optional[Stdlib::HTTPSUrl]) (defaults to: undef)

    If docker_proxy_index_type is CUSTOM you have to set the uri of the index api.

  • npm_remove_non_cataloged (Boolean) (defaults to: false)
  • npm_remove_quarantined (Boolean) (defaults to: false)


46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'manifests/resource/repository/docker/proxy.pp', line 46

define nexus::resource::repository::docker::proxy (
  Stdlib::HTTPSUrl $proxy_remote_url,
  Enum['present', 'absent'] $ensure = 'present',
  Boolean $npm_remove_non_cataloged = false,
  Boolean $npm_remove_quarantined = false,
  Boolean $http_client_blocked = false,
  Boolean $http_client_auto_block = true,
  Boolean $negative_cache_enabled = true,
  Integer $negative_cache_time_to_live = 1440,
  Boolean $online = true,
  Integer $proxy_content_max_age = 1440,
  Integer $proxy_metadata_max_age = 1440,
  String[1] $storage_blob_store_name = $title,
  Boolean $storage_strict_content_type_validation = true,
  Enum['ALLOW','ALLOW_ONCE','DENY'] $storage_write_policy = 'ALLOW',
  Boolean $docker_v1_enabled = false,
  Boolean $docker_force_basic_auth = true,
  Optional[Stdlib::Port] $docker_http_port = undef,
  Optional[Stdlib::Port] $docker_https_port = undef,
  Enum['REGISTRY','HUB','CUSTOM'] $docker_proxy_index_type = 'HUB',
  Optional[Stdlib::HTTPSUrl] $docker_proxy_index_url = undef,
) {
  nexus_repository { $title:
    ensure     => $ensure,
    format     => 'docker',
    type       => 'proxy',
    attributes => {
      'online'          => $online,
      'storage'         => {
        'blobStoreName'               => $storage_blob_store_name,
        'strictContentTypeValidation' => $storage_strict_content_type_validation,
        'writePolicy'                 => $storage_write_policy
      },
      'cleanup'         => undef,
      'proxy'           => {
        'remoteUrl'      => $proxy_remote_url,
        'contentMaxAge'  => $proxy_content_max_age,
        'metadataMaxAge' => $proxy_metadata_max_age,
      },
      'negativeCache'   => {
        'enabled'    => $negative_cache_enabled,
        'timeToLive' => $negative_cache_time_to_live
      },
      'httpClient'      => {
        'blocked'        => $http_client_blocked,
        'autoBlock'      => $http_client_auto_block,
        'connection'     => {
          'retries'                 => undef,
          'userAgentSuffix'         => undef,
          'timeout'                 => undef,
          'enableCircularRedirects' => false,
          'enableCookies'           => false,
          'useTrustStore'           => false
        },
        'authentication' => undef
      },
      'routingRuleName' => undef,
      'docker'          => {
        'v1Enabled'      => $docker_v1_enabled,
        'forceBasicAuth' => $docker_force_basic_auth,
        'httpPort'       => $docker_http_port,
        'httpsPort'      => $docker_https_port,
      },
      'dockerProxy'     => {
        'indexType' => $docker_proxy_index_type,
        'indexUrl'  => $docker_proxy_index_url,
      },
    }
  }
}