diff options
Diffstat (limited to 'roles/lib_openshift/src')
-rw-r--r-- | roles/lib_openshift/src/ansible/oadm_registry.py | 8 | ||||
-rw-r--r-- | roles/lib_openshift/src/class/oadm_registry.py | 16 | ||||
-rw-r--r-- | roles/lib_openshift/src/doc/registry | 44 |
3 files changed, 30 insertions, 38 deletions
diff --git a/roles/lib_openshift/src/ansible/oadm_registry.py b/roles/lib_openshift/src/ansible/oadm_registry.py index 53c1dab5a..5fa9e1028 100644 --- a/roles/lib_openshift/src/ansible/oadm_registry.py +++ b/roles/lib_openshift/src/ansible/oadm_registry.py @@ -15,7 +15,6 @@ def main(): name=dict(default=None, required=True, type='str'), kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'), - credentials=dict(default='/etc/origin/master/openshift-registry.kubeconfig', type='str'), images=dict(default=None, type='str'), latest_images=dict(default=False, type='bool'), labels=dict(default=None, type='list'), @@ -24,15 +23,12 @@ def main(): selector=dict(default=None, type='str'), service_account=dict(default='registry', type='str'), mount_host=dict(default=None, type='str'), - registry_type=dict(default='docker-registry', type='str'), - template=dict(default=None, type='str'), - volume=dict(default='/registry', type='str'), - env_vars=dict(default=None, type='dict'), volume_mounts=dict(default=None, type='list'), + env_vars=dict(default=None, type='dict'), edits=dict(default=None, type='list'), + enforce_quota=dict(default=False, type='bool'), force=dict(default=False, type='bool'), ), - mutually_exclusive=[["registry_type", "images"]], supports_check_mode=True, ) diff --git a/roles/lib_openshift/src/class/oadm_registry.py b/roles/lib_openshift/src/class/oadm_registry.py index b42410926..bcb098663 100644 --- a/roles/lib_openshift/src/class/oadm_registry.py +++ b/roles/lib_openshift/src/class/oadm_registry.py @@ -136,12 +136,6 @@ class Registry(OpenShiftCLI): def prep_registry(self): ''' prepare a registry for instantiation ''' - # In <= 3.4 credentials are used - # In >= 3.5 credentials are removed - versions = self.version.get() - if '3.5' in versions['oc']: - self.config.config_options['credentials']['include'] = False - options = self.config.to_option_list() cmd = ['registry', '-n', self.config.namespace] @@ -319,8 +313,7 @@ class Registry(OpenShiftCLI): rconfig = RegistryConfig(params['name'], params['namespace'], params['kubeconfig'], - {'credentials': {'value': params['credentials'], 'include': True}, - 'default_cert': {'value': None, 'include': True}, + {'default_cert': {'value': None, 'include': True}, 'images': {'value': params['images'], 'include': True}, 'latest_images': {'value': params['latest_images'], 'include': True}, 'labels': {'value': params['labels'], 'include': True}, @@ -330,11 +323,12 @@ class Registry(OpenShiftCLI): 'service_account': {'value': params['service_account'], 'include': True}, 'registry_type': {'value': params['registry_type'], 'include': False}, 'mount_host': {'value': params['mount_host'], 'include': True}, - 'volume': {'value': params['mount_host'], 'include': True}, - 'template': {'value': params['template'], 'include': True}, + 'volume': {'value': '/registry', 'include': True}, 'env_vars': {'value': params['env_vars'], 'include': False}, 'volume_mounts': {'value': params['volume_mounts'], 'include': False}, 'edits': {'value': params['edits'], 'include': False}, + 'enforce_quota': {'value': params['enforce_quota'], 'include': True}, + 'daemonset': {'value': params['daemonset'], 'include': True}, }) @@ -366,7 +360,7 @@ class Registry(OpenShiftCLI): if not ocregistry.exists(): if check_mode: - return {'changed': True, 'msg': 'CHECK_MODE: Would have performed a delete.'} + return {'changed': True, 'msg': 'CHECK_MODE: Would have performed a create.'} api_rval = ocregistry.create() diff --git a/roles/lib_openshift/src/doc/registry b/roles/lib_openshift/src/doc/registry index 953e8d90d..5ae969c73 100644 --- a/roles/lib_openshift/src/doc/registry +++ b/roles/lib_openshift/src/doc/registry @@ -3,11 +3,19 @@ DOCUMENTATION = ''' --- -module: oadm_manage_node -short_description: Module to manage openshift nodes +module: oc_adm_registry +short_description: Module to manage openshift registry description: - - Manage openshift nodes programmatically. + - Manage openshift registry programmatically. options: + state: + description: + - The desired action when managing openshift registry + - present - update or create the registry + - absent - tear down the registry service and deploymentconfig + required: false + default: False + aliases: [] kubeconfig: description: - The path for the kubeconfig file to use for authentication @@ -32,12 +40,6 @@ options: required: false default: None aliases: [] - credentials: - description: - - Path to a .kubeconfig file that will contain the credentials the registry should use to contact the master. - required: false - default: None - aliases: [] images: description: - The image to base this registry on - ${component} will be replaced with --type @@ -104,18 +106,6 @@ options: required: false default: None aliases: [] - registry_type: - description: - - The registry image to use - if you specify --images this flag may be ignored. - required: false - default: 'docker-registry' - aliases: [] - volume: - description: - - The volume path to use for registry storage; defaults to /registry which is the default for origin-docker-registry. - required: false - default: '/registry' - aliases: [] volume_mounts: description: - The volume mounts for the registry. @@ -134,6 +124,18 @@ options: required: false default: None aliases: [] + env_vars: + description: + - A dictionary of modifications to make on the deploymentconfig. e.g. FOO: BAR + required: false + default: None + aliases: [] + force: + description: + - Force a registry update. + required: false + default: False + aliases: [] author: - "Kenny Woodson <kwoodson@redhat.com>" extends_documentation_fragment: [] |