ansible / ansible.builtin / v2.5.11 / module / vr_server Manages virtual servers on Vultr. | "added in version" 2.5 of ansible.builtin" Authors: René Moser (@resmo) preview | supported by communityansible.builtin.vr_server (v2.5.11) — module
pip
Install with pip install ansible==2.5.11
Deploy, start, stop, update, restart, reinstall servers.
- name: create server local_action: module: vr_server name: "{{ vr_server_name }}" os: CentOS 7 x64 plan: 1024 MB RAM,25 GB SSD,1.00 TB BW region: Amsterdam state: present
- name: ensure a server is present and started local_action: module: vr_server name: "{{ vr_server_name }}" os: CentOS 7 x64 plan: 1024 MB RAM,25 GB SSD,1.00 TB BW region: Amsterdam state: started
- name: ensure a server is present and stopped local_action: module: vr_server name: "{{ vr_server_name }}" os: CentOS 7 x64 plan: 1024 MB RAM,25 GB SSD,1.00 TB BW region: Amsterdam state: stopped
- name: ensure an existing server is stopped local_action: module: vr_server name: "{{ vr_server_name }}" state: stopped
- name: ensure an existing server is started local_action: module: vr_server name: "{{ vr_server_name }}" state: started
- name: ensure a server is absent local_action: module: vr_server name: "{{ vr_server_name }}" state: absent
os: description: - The operating system. - Required if the server does not yet exist. tag: description: - Tag for the server. name: aliases: - label description: - Name of the server. required: true plan: description: - Plan to use for the server. - Required if the server does not yet exist. force: description: - Force stop/start the server if required to apply changes - Otherwise a running server will not be changed. state: choices: - present - absent - restarted - reinstalled - started - stopped default: present description: - State of the server. region: description: - Region the server is deployed into. - Required if the server does not yet exist. api_key: description: - API key of the Vultr API. - The ENV variable C(VULTR_API_KEY) is used as default, when defined. type: str hostname: description: - Hostname to assign to this server. ssh_keys: aliases: - ssh_key description: - List of SSH keys passed to the server on creation. user_data: description: - User data to be passed to the server. api_account: default: default description: - Name of the ini section in the C(vultr.ini) file. - The ENV variable C(VULTR_API_ACCOUNT) is used as default, when defined. type: str api_retries: description: - Amount of retries in case of the Vultr API retuns an HTTP 503 code. - The ENV variable C(VULTR_API_RETRIES) is used as default, when defined. - Fallback value is 5 retries if not specified. type: int api_timeout: description: - HTTP timeout to Vultr API. - The ENV variable C(VULTR_API_TIMEOUT) is used as default, when defined. - Fallback value is 60 seconds if not specified. type: int api_endpoint: description: - URL to API endpint (without trailing slash). - The ENV variable C(VULTR_API_ENDPOINT) is used as default, when defined. - Fallback value is U(https://api.vultr.com) if not specified. type: str ipv6_enabled: description: - Whether to enable IPv6 or not. type: bool firewall_group: description: - The firewall group to assign this server to. reserved_ip_v4: description: - IP address of the floating IP to use as the main IP of this server. - Only considered on creation. startup_script: description: - Name of the startup script to execute on boot. - Only considered while creating the server. validate_certs: default: true description: - Validate SSL certs of the Vultr API. type: bool notify_activate: description: - Whether to send an activation email when the server is ready or not. - Only considered on creation. type: bool api_retry_max_delay: description: - Retry backoff delay in seconds is exponential up to this max. value, in seconds. - The ENV variable C(VULTR_API_RETRY_MAX_DELAY) is used as default, when defined. - Fallback value is 12 seconds. type: int auto_backup_enabled: description: - Whether to enable automatic backups or not. type: bool private_network_enabled: description: - Whether to enable private networking or not. type: bool
vultr_api: contains: api_account: description: Account used in the ini file to select the key returned: success sample: default type: string api_endpoint: description: Endpoint used for the API requests returned: success sample: https://api.vultr.com type: string api_retries: description: Amount of max retries for the API requests returned: success sample: 5 type: int api_timeout: description: Timeout used for the API requests returned: success sample: 60 type: int description: Response from Vultr API with a few additions/modification returned: success type: complex vultr_server: contains: allowed_bandwidth_gb: description: Allowed bandwidth to use in GB returned: success sample: 1000 type: int auto_backup_enabled: description: Whether automatic backups are enabled returned: success sample: false type: bool cost_per_month: description: Cost per month for the server returned: success sample: 5.0 type: float current_bandwidth_gb: description: Current bandwidth used for the server returned: success sample: 0 type: int date_created: description: Date when the server was created returned: success sample: '2017-08-26 12:47:48' type: string default_password: description: Password to login as root into the server returned: success sample: '!p3EWYJm$qDWYaFr' type: string disk: description: Information about the disk returned: success sample: Virtual 25 GB type: string firewall_group: description: Firewall group the server is assinged to returned: success and available sample: CentOS 6 x64 type: string id: description: ID of the server returned: success sample: 10194376 type: string internal_ip: description: Internal IP returned: success sample: '' type: string kvm_url: description: URL to the VNC returned: success sample: https://my.vultr.com/subs/vps/novnc/api.php?data=xyz type: string name: description: Name (label) of the server returned: success sample: ansible-test-vm type: string os: description: Operating system used for the server returned: success sample: CentOS 6 x64 type: string pending_charges: description: Pending charges returned: success sample: 0.01 type: float plan: description: Plan used for the server returned: success sample: 1024 MB RAM,25 GB SSD,1.00 TB BW type: string power_status: description: Power status of the server returned: success sample: running type: string ram: description: Information about the RAM size returned: success sample: 1024 MB type: string region: description: Region the server was deployed into returned: success sample: Amsterdam type: string server_state: description: State about the server returned: success sample: ok type: string status: description: Status about the deployment of the server returned: success sample: active type: string tag: description: TBD returned: success sample: '' type: string v4_gateway: description: IPv4 gateway returned: success sample: 45.32.232.1 type: string v4_main_ip: description: Main IPv4 returned: success sample: 45.32.233.154 type: string v4_netmask: description: Netmask IPv4 returned: success sample: 255.255.254.0 type: string v6_main_ip: description: Main IPv6 returned: success sample: '' type: string v6_network: description: Network IPv6 returned: success sample: '' type: string v6_network_size: description: Network size IPv6 returned: success sample: '' type: string v6_networks: description: Networks IPv6 returned: success sample: [] type: list vcpu_count: description: Virtual CPU count returned: success sample: 1 type: int description: Response from Vultr API with a few additions/modification returned: success type: complex