Ansible modules automating various operations and use cases of ManageIQ.
ManageIQ Python API Client package [manageiq-client] (https://github.com/ManageIQ/manageiq-api-client-python/).
$ pip install manageiq-client
$ pip install -r requirements.txt
To try the modules copy and edit the relevant example playbook and execute:
$ ansible-playbook EDITED_PLAYBOOK.yml
The manageiq_provider
module currently supports adding, updating and deleting OpenShift and Amazon EC2 providers to manageiq.
Example playbooks add_openshift_provider.yml and add_amazon_provider.yml are provided.
To update an existing provider pass the changed values together with the required parameters. To delete a provider change state=absent
.
After addition or update, each endpoint authentication is validated, a process which can take up to 50 seconds before timeout.
If all authentications are valid the provider's inventory is refreshed.
The manageiq_user
module supports adding, updating and deleting users in manageiq.
Example playbook create_user.yml is provided.
To update an existing user pass the changed values together with the required parameters. To delete a user change state=absent
.
The manageiq_policy_assignment
module currently supports assigning and unassigning Policies and Policy Profiles on resources in manageiq.
An example playbook assign_policy.yml is provided.
To unassign a policy/policy profile on a resource change state=absent
.
The manageiq_custom_attributes
module supports adding, updating and deleting custom attributes on resources in ManageIQ.
Currently the only resources (entities) that supports custom attributes are vms and providers.
An example playbook add_custom_attributes.yml is provided.
To delete a custom attributes change state=absent
.
It is possible to add a date type custom attributes by specifying field_type: "Date"
and passing it in the following fromat:
yyyy-mm-dd
It is possible to set the following environment variables, and remove them from playbook options.
$ export MIQ_URL=http://localhost:3000
$ export MIQ_USERNAME=admin
$ export MIQ_PASSWORD=******
SSL verification for HTTPS requests is enabled by default.
To use a self-signed certificate pass the certificate file or directory path using the ca_bundle_path option: ca_bundle_path: '/path/to/certfile'
.
To ignore verifying the SSL certificate pass verify_ssl: False