vmware.vmware.local_content_library module – Manage a local content library.
Note
This module is part of the vmware.vmware collection (version 1.10.1).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install vmware.vmware
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: vmware.vmware.local_content_library
.
Synopsis
Create, update, or destroy a local content library.
Requirements
The below requirements are needed on the host that executes this module.
vSphere Automation SDK
Parameters
Parameter |
Comments |
---|---|
The current password for the library when the library is using BASIC authentication. If not supplied, the value of You must supply a password when the library is already configured with BASIC auth and If you want to update the password, set this to the old password and If BASIC auth is not enabled, this option is ignored. |
|
The method of authentication to use if this is published local library. The only options are NONE for no authentication or BASIC for username and password authentication. The username for BASIC authentication cannot be changed and is vcsp. Choices:
|
|
The password to use when If authentication is already enabled on the library, you must supply the password to update the library. If If BASIC auth is not enabled, this option is ignored. |
|
The name of the datastore that should be a storage backing for the library. This parameter is required when This parameter only takes effect when the library is first created. You cannot change the storage backing for an existing library, and the module will not check this value in that case. |
|
The description for the content library. Default: |
|
The hostname or IP address of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable |
|
The name of the local content library to manage. |
|
The password of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable |
|
If true, a JSON file describing the library metadata will be kept in the library. This file allows you to sync a remote library by copying the library contents instead of relying on HTTP. Choices:
|
|
The port number of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable Default: |
|
The address of a proxy that will receive all HTTPS requests and relay them. The format is a hostname or a IP. If the value is not specified in the task, the value of environment variable |
|
The port of the HTTP proxy that will receive all HTTPS requests and relay them. If the value is not specified in the task, the value of environment variable |
|
The proxy connection protocol to use. This option is used if the correct proxy protocol cannot be automatically determined. Choices:
|
|
If true, this library will be published so other libraries can subscribe to it. Choices:
|
|
Whether the content library should be present or absent. Choices:
|
|
The username of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable |
|
Allows connection when SSL certificates are not valid. Set to If the value is not specified in the task, the value of environment variable Choices:
|
Notes
Note
All modules require API write access and hence are not supported on a free ESXi license.
All variables and VMware object names are case sensitive.
Modules may rely on the ‘requests’ python library, which does not use the system certificate store by default. You can specify the certificate store by setting the REQUESTS_CA_BUNDLE environment variable. Example: ‘export REQUESTS_CA_BUNDLE=/path/to/your/ca_bundle.pem’
Examples
- name: Create Local Content Library
vmware.vmware.local_content_library:
validate_certs: false
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datastore_name: "{{ shared_storage }}"
name: my-library
state: present
- name: Publish Library Without Authentication
vmware.vmware.local_content_library:
validate_certs: false
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datastore_name: "{{ shared_storage }}"
name: my-library
publish: true
persist_json_enabled: true
state: present
- name: Publish Library With Authentication
vmware.vmware.local_content_library:
validate_certs: false
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datastore_name: "{{ shared_storage }}"
name: my-library
authentication_method: BASIC
authentication_password: Mypassword!
publish: true
persist_json_enabled: true
state: present
- name: Update Library Password
vmware.vmware.local_content_library:
validate_certs: false
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datastore_name: "{{ shared_storage }}"
name: my-library
authentication_method: BASIC
authentication_password: MyNewPassword1234!
authentication_current_password: Mypassword!
publish: true
persist_json_enabled: true
state: present
- name: Remove Library Password
vmware.vmware.local_content_library:
validate_certs: false
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datastore_name: "{{ shared_storage }}"
name: my-library
authentication_password: MyNewPassword1234!
publish: true
persist_json_enabled: true
state: present
- name: Unpublish Library Password
vmware.vmware.local_content_library:
validate_certs: false
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datastore_name: "{{ shared_storage }}"
name: my-library
publish: false
state: present
- name: Destroy Library
vmware.vmware.local_content_library:
validate_certs: false
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
name: my-library
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Identifying information about the library If the library was removed, only the name is returned If the library was published, the publish_url is returned Returned: On success Sample: |