community / community.general / 0.1.1 / module / cs_image_store Manages CloudStack Image Stores. Authors: Patryk Cichy (@PatTheSilent) preview | supported by communitycommunity.general.cs_image_store (0.1.1) — module
Install with ansible-galaxy collection install community.general:==0.1.1
collections: - name: community.general version: 0.1.1
Deploy, remove, recreate CloudStack Image Stores.
- name: Add a Image Store (NFS) cs_image_store: zone: zone-01 name: nfs-01 provider: NFS url: nfs://192.168.21.16/exports/secondary delegate_to: localhost
# Change the NFS share URL and force a Image Store recreation - name: Change the NFS url cs_image_store: zone: zone-01 name: nfs-01 provider: NFS force_recreate: yes url: nfs://192.168.21.10/shares/secondary delegate_to: localhost
- name: delete the image store cs_image_store: name: nfs-01 zone: zone-01 state: absent delegate_to: localhost
url: description: - The URL for the Image Store. - Required when I(state=present). type: str name: description: - The ID of the Image Store. Required when deleting a Image Store. required: true type: str zone: description: - The Zone name for the Image Store. required: true type: str state: choices: - present - absent default: present description: - Stage of the Image Store type: str api_key: description: - API key of the CloudStack API. - If not given, the C(CLOUDSTACK_KEY) env variable is considered. - As the last option, the value is taken from the ini config file, also see the notes. type: str api_url: description: - URL of the CloudStack API e.g. https://cloud.example.com/client/api. - If not given, the C(CLOUDSTACK_ENDPOINT) env variable is considered. - As the last option, the value is taken from the ini config file, also see the notes. type: str provider: description: - The image store provider name. Required when creating a new Image Store type: str api_region: default: cloudstack description: - Name of the ini section in the C(cloustack.ini) file. - If not given, the C(CLOUDSTACK_REGION) env variable is considered. type: str api_secret: description: - Secret key of the CloudStack API. - If not set, the C(CLOUDSTACK_SECRET) env variable is considered. - As the last option, the value is taken from the ini config file, also see the notes. type: str api_timeout: description: - HTTP timeout in seconds. - If not given, the C(CLOUDSTACK_TIMEOUT) env variable is considered. - As the last option, the value is taken from the ini config file, also see the notes. - Fallback value is 10 seconds if not specified. type: int force_recreate: default: false description: - Set to C(yes) if you're changing an existing Image Store. - This will force the recreation of the Image Store. - Recreation might fail if there are snapshots present on the Image Store. Delete them before running the recreation. type: bool api_http_method: choices: - get - post description: - HTTP method used to query the API endpoint. - If not given, the C(CLOUDSTACK_METHOD) env variable is considered. - As the last option, the value is taken from the ini config file, also see the notes. - Fallback value is C(get) if not specified. type: str
id: description: the ID of the image store returned: success sample: feb11a84-a093-45eb-b84d-7f680313c40b type: str name: description: the name of the image store returned: success sample: nfs-01 type: str protocol: description: the protocol of the image store returned: success sample: nfs type: str provider_name: description: the provider name of the image store returned: success sample: NFS type: str scope: description: the scope of the image store returned: success sample: ZONE type: str url: description: the url of the image store returned: success sample: nfs://192.168.21.16/exports/secondary type: str zone: description: the Zone name of the image store returned: success sample: zone-01 type: str