If you for some reason running Ansible Tower in a Parallels Desktop vm and wants a custom inventory script for Parallels Desktop, this is the place for you!
Since Parallels Desktop not has an API that you can query from a remote node, I'm using the Ansible python API in the inventory script to execute parallels cli commands on the virtualization host(my Mac).
You must:
- Add parallels_desktop_inventory.py as a custom inventory script in Tower
- Since I'm using custom credentials in Tower to inject the authentication information to the inventory script you need to add a custom credential
- Add authentication information to the custom credential
- Add an inventory and set the custom inventory script as a source
2. click the button located in the upper right corner of the Inventory Scripts screen.
3. Enter the name for the script, plus an optional description. Then select the Organization that this script belongs to and then paste the content from parallels_desktop_inventory.pl script.
- click the Credential Types icon from the left navigation bar.
- Click the button located in the upper right corner of the Credential Types screen.
- Enter the name for the credential, plus an optional description. Input Configuration:
fields:
- type: string
id: username
label: Username
- secret: true
type: string
id: password
label: Password
- type: string
id: hostname
label: Hostname
required:
- username
- password
- hostname
Injector Configuration:
env:
PARALLELS_HOSTNAME: '{{hostname}}'
PARALLELS_PASSWORD: '{{password}}'
PARALLELS_USERNAME: '{{username}}'
- click the Credentials icon from the left navigation bar.
- click the button located in the upper right corner of the Credentials screen.
- Enter required information
Happy Inventory / Peter