Vultr Guide

    This set of module forms a framework that allows one to easily manage and orchestrate one’s infratructure on Vultr cloud platform.

    There is actually no technical requirement; simply an already created Vultr account.

    Vultr modules offer a rather flexible way with regard to configuration.

    Configuration is read in that order:

    • Environment Variables (eg. , VULTR_API_TIMEOUT)
    • File specified by environment variable VULTR_API_CONFIG
    • file located in current working directory
    • $HOME/.vultr.ini

    Ini file are structured this way:

    Before using the Ansible modules to interact with Vultr, ones need an API key.If one doesn’t own one yet, log in to go to Account, then API, enable API then the API key should show up.

    Ensure you allow the usage of the API key from the proper IP addresses.

    Refer to the Configuration section to find out where to put this information.

    To check that everything is working properly run the following command:

    1. #> VULTR_API_KEY=XXX ansible -m vultr_account_facts localhost
    2. localhost | SUCCESS => {
    3. "vultr_account_facts": {
    4. "balance": -8.9,
    5. "last_payment_amount": -10.0,
    6. "last_payment_date": "2018-07-21 11:34:46",
    7. "pending_charges": 6.0
    8. }
    9. },
    10. "changed": false,
    11. "vultr_account_facts": {
    12. "balance": -8.9,
    13. "last_payment_amount": -10.0,
    14. "pending_charges": 6.0
    15. },
    16. "vultr_api": {
    17. "api_account": "default",
    18. "api_endpoint": "https://api.vultr.com",
    19. "api_retries": 5,
    20. "api_timeout": 60
    21. }
    22. }

    If a similar output displays then everything is setup properly, else please ensure the proper VULTR_API_KEY has been specified and that Access Control on Vultr > Account > API page are accurate.

    From that point on, only you creativity is the limit. Make sure to read the documentation of the available modules.

    Ansible provides a dynamic inventory plugin for .The configuration process is exactly the same as the one for the modules.

    To be able to use it one needs to enable it first by specifying the following in the ansible.cfg file:

    1. [inventory]
    2. enable_plugins=vultr

    And provide a configuration file to be used with the plugin, the minimal configuration file looks like this:

    To list the available hosts one can simply run: