Skip to main content

Ansible

NetActuate provides Ansible modules for provisioning and managing infrastructure. You can use Ansible playbooks to deploy virtual servers, configure BGP sessions, and manage your NetActuate resources alongside your application deployment workflows.

Prerequisites

  • Ansible 2.10 or later
  • Python 3.8 or later
  • A NetActuate API key

Installation

Install the NetActuate Ansible collection:

ansible-galaxy collection install netactuate.cloud

Authentication

Set your API key as an environment variable:

export NETACTUATE_API_KEY="your-api-key-here"

Or pass it directly in your playbook:

- hosts: localhost
vars:
netactuate_api_key: "{{ lookup('env', 'NETACTUATE_API_KEY') }}"

Quick Start

Create a playbook to provision a virtual server:

---
- hosts: localhost
connection: local
gather_facts: false

tasks:
- name: Create a virtual server
netactuate.cloud.server:
api_key: "{{ lookup('env', 'NETACTUATE_API_KEY') }}"
hostname: "web-01"
plan: "VR2048x2x40"
location: "ashburn"
image: "ubuntu-24.04"
ssh_keys:
- "my-key-id"
state: present
register: server

- name: Display server IP
debug:
msg: "Server IP: {{ server.ip_address }}"

Run the playbook:

ansible-playbook provision.yml

Available Modules

ModuleDescription
netactuate.cloud.serverManage virtual server instances
netactuate.cloud.ssh_keyManage SSH keys
netactuate.cloud.bgp_sessionManage BGP sessions
netactuate.cloud.server_infoRetrieve server information
netactuate.cloud.location_infoRetrieve available locations

Playbook Examples

The following pages provide complete playbook examples for common use cases:

Need Help?

If you need assistance with Ansible automation, visit our support page.