ngine_io / ngine_io.cloudstack / 2.3.0 / module / cs_instance_password_reset Allows resetting VM the default passwords on Apache CloudStack based clouds. | "added in version" 0.1.0 of ngine_io.cloudstack" Authors: Gregor Riepl (@onitake)ngine_io.cloudstack.cs_instance_password_reset (2.3.0) — module
Install with ansible-galaxy collection install ngine_io.cloudstack:==2.3.0
collections: - name: ngine_io.cloudstack version: 2.3.0
Resets the default user account's password on an instance.
Requires cloud-init to be installed in the virtual machine.
The passwordenabled flag must be set on the template associated with the VM.
- name: stop the virtual machine before resetting the password ngine_io.cloudstack.cs_instance: name: myvirtualmachine zone: zone01 state: stopped
- name: reset and get new default password ngine_io.cloudstack.cs_instance_password_reset: vm: myvirtualmachine zone: zone01 register: root
- debug: msg: "new default password is {{ root.password }}"
- name: boot the virtual machine to activate the new password ngine_io.cloudstack.cs_instance: name: myvirtualmachine zone: zone01 state: started when: root is changed
vm: description: - Name of the virtual machine to reset the password on. required: true type: str zone: description: - Name of the zone in which the instance is deployed. required: true type: str domain: description: - Name of the domain the virtual machine belongs to. type: str account: description: - Account the virtual machine belongs to. type: str api_key: description: - API key of the CloudStack API. - If not given, the C(CLOUDSTACK_KEY) env variable is considered. required: true 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. required: true type: str project: description: - Name of the project the virtual machine belongs to. type: str api_secret: description: - Secret key of the CloudStack API. - If not set, the C(CLOUDSTACK_SECRET) env variable is considered. required: true type: str poll_async: default: true description: - Poll async jobs until job has finished. type: bool api_timeout: default: 10 description: - HTTP timeout in seconds. - If not given, the C(CLOUDSTACK_TIMEOUT) env variable is considered. type: int api_http_method: choices: - get - post default: get description: - HTTP method used to query the API endpoint. - If not given, the C(CLOUDSTACK_METHOD) env variable is considered. type: str api_verify_ssl_cert: description: - Verify CA authority cert file. - If not given, the C(CLOUDSTACK_VERIFY) env variable is considered. type: str
id: description: ID of the virtual machine. returned: success sample: a6f7a5fc-43f8-11e5-a151-feff819cdc9f type: str password: description: The new default password. returned: success sample: ahQu5nuNge3keesh type: str