Ansible modules for OpenNebula
The following list represent's all of OpenNebula's resources reachable through their API. The checked items are the ones that are fully functional and tested:
- oneacct
- oneacl
- onecluster
- onedatastore
- onegroup
- onehook
- onehost
- oneimage
- onetemplate
- oneuser
- onevdc
- onevm
- onevnet
- onezone
- onesecgroup
- onevcenter
- onevrouter
- oneshowback
- onemarket
- onemarketapp
This add-on is compatible with OpenNebula 5.6+ (older version can work but not have properly tested)
There is no actially any requipments.
Clone this repository into your modules library:
git clone https://github.com/kvaps/opennebula-ansible-modules library/opennebula
Update path in your ansible.cfg file:
[defaults]
library = library
tasks:
- onecluster:
name: "cluster1"
template: "RESERVED_CPU=0 RESERVED_CPU=0"
- onedatastore:
name: "images"
chmod: "600"
user: "oneadmin"
group: "oneadmin"
clusters: "default cluster1"
template: |
ALLOW_ORPHANS="NO"
CLONE_TARGET="SYSTEM"
DRIVER="raw"
DS_MAD="fs"
DS_MIGRATE="YES"
LN_TARGET="SYSTEM"
RESTRICTED_DIRS="/"
SAFE_DIRS="/var/tmp"
TM_MAD="fs_lvm"
TYPE="IMAGE_DS"
BRIDGE_LIST="{{ lookup("pipe","echo node{1..50}") }}"
- onehost:
name: "{{ item }}"
template: "RESERVED_CPU=100 RESERVED_MEM=2922448"
im_mad: "kvm"
vmm_mad: "kvm"
cluster: "cluster1"
loop: "{{ lookup("pipe","echo node{1..50}") }}"
- oneimage:
name: "Debian 10"
chmod: "644"
user: "oneadmin"
group: "oneadmin"
path: "https://marketplace.opennebula.wedos.cloud/images/debian-10.qcow2"
type: "OS"
datastore: "files"
template: "DEV_PREFIX=vd FORMAT=raw LABELS=OS"
- onetemplate:
name: "Debian 10"
template: "{{ lookup('template', 'templates/cloud.j2') }}"
chmod: "600"
user: "oneadmin"
group: "oneadmin"
vars:
name: "Debian 10"
image: "Debian 10"
logo: "images/logos/debian.png"
- onevnet:
name: dev-ip
template: |
BRIDGE="vmbr0v4000"
DNS="10.28.0.1"
PHYDEV="bond0"
SECURITY_GROUPS="0"
VLAN_ID="4000"
VN_MAD="802.1Q"
clusters: "default cluster1"
chmod: "604"
user: "oneadmin"
group: "oneadmin"
- onevnetar:
ar_uniq_key: "IP"
template: "{{ ar_template }}"
loop_control:
loop_var: ar_template
loop:
- |
AR=[
GATEWAY="172.16.0.1",
IP="172.16.0.5",
SIZE="250",
TYPE="IP4" ]
- |
AR=[
GATEWAY="172.17.0.1",
IP="172.17.0.5",
SIZE="250",
TYPE="IP4" ]
To contribute bug patches or new features, you can use the github Pull Request model. It is assumed that code and documentation are contributed under the Apache License 2.0.
More info:
- How to Contribute
- Support: OpenNebula user forum
- Development: OpenNebula developers forum
- Issues Tracking: Github issues
- Author: kvaps