Skip to content

Commit 2b52153

Browse files
committed
OpenNebula Ansible Deployment (Technology Preview)
Initial set of optimized OpenNebula deployment playbooks dedicated for public use. Included features: - Ansible Galaxy collection structure - Debian / RedHat-like Linux distros - CE / EE OpenNebula - MariaDB / PostgreSQL - Single / HA Front-end - OneGate Server / Proxy - OneFlow Server - Sunstone and FireEdge Servers - Prometheus Server / Exporters (EE-only) - Grafana Server (EE-only) - OpenNebula KVM Node management (including fixes for Libvirt instances) - Semi-automated Datastore configuration - Semi-automated Datastore symlink management - Semi-automated Networking configuration - Semi-automated Networking IP / bridging management - Auto-generated SSH jumphost / bastion config - Auto-generated SSH keys (password-less login) - Predefined easy-to-use Ansible tags - Markdown documentation for each role - Simple Makefile for handling common tasks - Apache-2.0 License Author: Michal Opala <mopala@opennebula.io>
1 parent 4245090 commit 2b52153

138 files changed

Lines changed: 4384 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*.swp
2+
*.tar.gz
3+
__pycache__/
4+
/ansible_collections/*
5+
!/ansible_collections/opennebula/deploy
6+
/inventory/.one-deploy/
7+
/inventory/*.yml
8+
!/inventory/example.yml
9+
!/inventory/shared.yml
10+
!/inventory/shared-generic.yml

Makefile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
SHELL := $(shell which bash)
2+
SELF := $(patsubst %/,%,$(dir $(abspath $(firstword $(MAKEFILE_LIST)))))
3+
4+
I ?= $(SELF)/inventory/example.yml
5+
INVENTORY ?= $(I)
6+
7+
T ?=
8+
TAGS ?= $(T)
9+
10+
S ?=
11+
SKIP_TAGS ?= $(S)
12+
13+
V ?= vv
14+
VERBOSE ?= $(V)
15+
16+
export
17+
18+
.PHONY: all
19+
20+
all: main
21+
22+
.PHONY: pre site main
23+
24+
pre site main: _TAGS := $(if $(TAGS),-t $(TAGS),)
25+
pre site main: _SKIP_TAGS := $(if $(SKIP_TAGS),--skip-tags $(SKIP_TAGS),)
26+
pre site main: _VERBOSE := $(if $(VERBOSE),-$(VERBOSE),)
27+
pre site main:
28+
cd $(SELF)/ && ansible-playbook $(_VERBOSE) -i $(INVENTORY) $(_TAGS) $(_SKIP_TAGS) opennebula.deploy.$@
29+
30+
.PHONY: requirements build publish
31+
32+
requirements: $(SELF)/requirements.yml
33+
ansible-galaxy collection install --requirements-file $<
34+
35+
build:
36+
ansible-galaxy collection build --force --verbose
37+
38+
publish: build
39+
shopt -qs failglob && \
40+
ansible-galaxy collection publish \
41+
"$$(ls -1 $(SELF)/opennebula-deploy-[0-9].[0-9].[0-9].tar.gz | sort --version-sort | tail -n1)" \
42+
--api-key="$$(cat $(SELF)/.galaxy-key)"

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,28 @@
1-
# one-deploy
1+
# OpenNebula Ansible Playbooks
2+
3+
The OpenNebula Ansible project consists of a set of playbooks and roles that let you deploy an OpenNebula cloud in a simple and convenient way.
4+
5+
The documentation is organized based on three distinct architectures. We will start with the most straightforward architecture and gradually move towards more complex scenarios. For each scenario, we will provide concise explanations of the configurations implemented on both the platform and OpenNebula.
6+
7+
## Contents
8+
9+
* [Requirements & Platform Notes](../../wiki/sys_reqs)
10+
* [Using the playbooks](../../wiki/sys_use)
11+
* Deployments
12+
* [Local storage](../../wiki/arch_single_local)
13+
* [Shared storage](../../wiki/arch_single_shared)
14+
* [High availability front-ends](../../wiki/arch_ha)
15+
* [Connect through a bastion host](../../wiki/arch_bastion)
16+
* [Other configurations](../../wiki/arch_other)
17+
* [Verifying the installation](../../wiki/sys_verify)
18+
* [Playbook reference](../../wiki/sys_reference)
19+
20+
## License
21+
22+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
23+
24+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
25+
26+
## Author Information
27+
28+
Copyright 2002-2023, OpenNebula Project, OpenNebula Systems

ansible.cfg

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[defaults]
2+
collections_paths=./ansible_collections/
3+
inventory=./inventory/example.yml
4+
gathering=explicit
5+
host_key_checking=false
6+
display_skipped_hosts=true
7+
retry_files_enabled=false
8+
any_errors_fatal=true
9+
callbacks_enabled=profile_tasks
10+
stdout_callback=yaml
11+
timeout=30
12+
13+
[privilege_escalation]
14+
become=true
15+
become_user=root
16+
17+
[ssh_connection]
18+
pipelining=true
19+
# Uncomment to disable bastion:
20+
ssh_args=-q -o ControlMaster=auto -o ControlPersist=60s
21+
# Uncomment to enable bastion:
22+
#ssh_args=-q -o ControlMaster=auto -o ControlPersist=60s -F inventory/.one-deploy/bastion
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../

galaxy.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
namespace: opennebula
3+
name: deploy
4+
version: 0.0.1
5+
6+
readme: README.md
7+
8+
authors:
9+
- http://opennebula.io <contact@opennebula.io>
10+
description: HA DEPLOYMENT FOR OPENNEBULA (ANSIBLE)
11+
12+
license: []
13+
license_file: LICENSE
14+
15+
tags: []
16+
dependencies: {}
17+
18+
repository: https://github.com/OpenNebula/one-deploy
19+
documentation: https://github.com/OpenNebula/one-deploy
20+
homepage: https://github.com/OpenNebula/one-deploy
21+
issues: https://github.com/OpenNebula/one-deploy/issues
22+
23+
build_ignore:
24+
- .gitignore
25+
- .galaxy-key
26+
- inventory
27+
- ansible_collections

inventory/example.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
all:
3+
vars:
4+
env_name: example
5+
ansible_user: example
6+
ensure_keys_for: [example, root]
7+
one_version: '6.6'
8+
one_token: example:example
9+
features:
10+
gateproxy: true
11+
prometheus: false
12+
one_vip: 10.11.12.69
13+
one_vip_cidr: 24
14+
one_vip_if: eth0
15+
vn:
16+
service:
17+
managed: true
18+
template:
19+
VN_MAD: bridge
20+
PHYDEV: eth0
21+
BRIDGE: br0
22+
AR:
23+
TYPE: IP4
24+
IP: 10.11.12.200
25+
SIZE: 48
26+
NETWORK_ADDRESS: 10.11.12.0
27+
NETWORK_MASK: 255.255.255.0
28+
GATEWAY: 10.11.12.1
29+
DNS: 1.1.1.1
30+
vm:
31+
managed: true
32+
template:
33+
VN_MAD: bridge
34+
PHYDEV: eth1
35+
AR:
36+
TYPE: IP4
37+
IP: 192.168.150.200
38+
SIZE: 48
39+
NETWORK_ADDRESS: 192.168.150.0
40+
NETWORK_MASK: 255.255.255.0
41+
ds:
42+
mode: ssh
43+
config:
44+
mounts:
45+
- type: image
46+
path: /opt/nfs0/1/
47+
- type: file
48+
path: /opt/nfs0/2/
49+
50+
bastion:
51+
hosts:
52+
b1: { ansible_host: 10.11.12.10 }
53+
54+
frontend:
55+
hosts:
56+
f1: { ansible_host: 10.11.12.10 }
57+
f2: { ansible_host: 10.11.12.20 }
58+
f3: { ansible_host: 10.11.12.30 }
59+
60+
node:
61+
hosts:
62+
n1: { ansible_host: 10.11.12.40 }
63+
n2: { ansible_host: 10.11.12.50 }
64+
65+
grafana:
66+
hosts:
67+
f1: { ansible_host: 10.11.12.10 }

inventory/group_vars/all.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
ansible_python_interpreter: /usr/bin/python3

inventory/local.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
all:
3+
vars:
4+
ansible_user: root
5+
one_version: '6.6'
6+
one_pass: opennebulapass
7+
ds:
8+
mode: ssh
9+
vn:
10+
admin_net:
11+
managed: true
12+
template:
13+
VN_MAD: bridge
14+
PHYDEV: eth0
15+
BRIDGE: br0
16+
AR:
17+
TYPE: IP4
18+
IP: 172.20.0.100
19+
SIZE: 48
20+
NETWORK_ADDRESS: 172.20.0.0
21+
NETWORK_MASK: 255.255.255.0
22+
GATEWAY: 172.20.0.1
23+
DNS: 1.1.1.1
24+
25+
frontend:
26+
hosts:
27+
f1: { ansible_host: 172.20.0.6 }
28+
29+
node:
30+
hosts:
31+
n1: { ansible_host: 172.20.0.7 }
32+
n2: { ansible_host: 172.20.0.8 }

inventory/shared-generic.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
all:
3+
vars:
4+
env_name: shared
5+
ansible_python_interpreter: /usr/bin/python3
6+
ansible_user: example
7+
ensure_keys_for: [example, root]
8+
one_version: '6.6'
9+
one_token: example:example
10+
one_vip: 10.11.12.69
11+
one_vip_cidr: 24
12+
one_vip_if: eth0
13+
ds:
14+
mode: generic
15+
config:
16+
SYSTEM_DS:
17+
system:
18+
enabled: false
19+
system1:
20+
id: 100
21+
managed: true
22+
enabled: true
23+
symlink:
24+
groups: [node]
25+
src: /opt/nfs1/100/
26+
template: &template
27+
TYPE: SYSTEM_DS
28+
TM_MAD: shared
29+
BRIDGE_LIST: "{{ groups.node | map('extract', hostvars, ['ansible_host']) | join(' ') }}"
30+
system2:
31+
id: 101
32+
managed: true
33+
enabled: true
34+
symlink:
35+
groups: [node]
36+
src: /opt/nfs2/101/
37+
template: *template
38+
system3:
39+
id: 102
40+
managed: true
41+
enabled: true
42+
symlink:
43+
groups: [node]
44+
src: /opt/nfs3/102/
45+
template: *template
46+
IMAGE_DS:
47+
default:
48+
symlink: { src: /opt/nfs0/1/ }
49+
template:
50+
TM_MAD: shared
51+
FILE_DS:
52+
files:
53+
symlink: { src: /opt/nfs0/2/ }
54+
55+
bastion:
56+
hosts:
57+
b1: { ansible_host: 10.11.12.10 }
58+
59+
frontend:
60+
hosts:
61+
f1: { ansible_host: 10.11.12.10 }
62+
f2: { ansible_host: 10.11.12.20 }
63+
f3: { ansible_host: 10.11.12.30 }
64+
65+
node:
66+
hosts:
67+
n1: { ansible_host: 10.11.12.40 }
68+
n2: { ansible_host: 10.11.12.50 }
69+
70+
grafana:
71+
hosts:
72+
f1: { ansible_host: 10.11.12.10 }

0 commit comments

Comments
 (0)