Import ONE-related types from dot-cdist
This commit is contained in:
parent
610a91e6ef
commit
8c5cedaefd
10 changed files with 101 additions and 0 deletions
32
type/__opennebula_repo/manifest
Normal file
32
type/__opennebula_repo/manifest
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
one_release=$(cat "${__object:?}/parameter/one-release")
|
||||||
|
|
||||||
|
os=$(cat "${__global:?}/explorer/os")
|
||||||
|
os_release=$(cat "${__global:?}/explorer/lsb_release")
|
||||||
|
case "$os" in
|
||||||
|
debian|ubuntu)
|
||||||
|
if [ "$os" = "debian" ]; then
|
||||||
|
os="Debian"
|
||||||
|
else
|
||||||
|
os="Ubuntu"
|
||||||
|
fi
|
||||||
|
|
||||||
|
__package gnupg2
|
||||||
|
__package ca-certificates
|
||||||
|
|
||||||
|
require="__package/gnupg2 __package/ca-certificates" __apt_key_uri opennebula \
|
||||||
|
--name "Opennebula APT repository" \
|
||||||
|
--uri https://downloads.opennebula.org/repo/repo.key \
|
||||||
|
--state present
|
||||||
|
|
||||||
|
require="__apt_key_uri/opennebula" __apt_source opennebula \
|
||||||
|
--uri "http://downloads.opennebula.org/repo/$one_release/$os/$os_release/" \
|
||||||
|
--distribution stable \
|
||||||
|
--component opennebula
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "This type is expected to run on Ubuntu, not $os. Exiting." >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
1
type/__opennebula_repo/parameter/required
Normal file
1
type/__opennebula_repo/parameter/required
Normal file
|
@ -0,0 +1 @@
|
||||||
|
one-release
|
0
type/__opennebula_repo/singleton
Normal file
0
type/__opennebula_repo/singleton
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cat << EOF
|
||||||
|
[client.libvirt]
|
||||||
|
key = $LIBVIRT_KEY
|
||||||
|
caps mon = "profile rbd"
|
||||||
|
caps osd = "profile rbd pool=one"
|
||||||
|
EOF
|
1
type/__recycledcloud_opennebula_node/files/lnth.ch.pub
Normal file
1
type/__recycledcloud_opennebula_node/files/lnth.ch.pub
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDEPIotg1yfaCg++zGUCg2MR2Aq/xfXb8+wWwYyIfgTdCoNB6L8EWcxpo73Wx8HkGjyYufo6nQOPBfkos1mrdpZCdxMShfixk6weywGCaIph0EEMwgvftTnK1HmZz935DEhJMm0GEEx2RNCUXVjfkPM8ASpfaNGzikseL1/HudBXgNb0umddnoHt5N15J5gTE9dNgnwvXqHAdeyPqJK+Mc0cxVQIt5tG9fps71/9Ovh0vJs8LQfpzdicB1QkRTxTI9Td9It843lz6iihznwSzFrzWpuc3HpSyx+1IUGoPUl+LdDeuxT0jK78MibCJ+r+t8pY62AochPd10Gjj5GF7DlE3dTHd0HurcvPtWzO/fx6ZLh7/kj4TKTs0AULJVH5puJ3j1RdCPJNPzYLUKoifxuoXnhtgBeyAoaZoV25aR/HPFj2kwOKCuS1SoctqNvG6ZPqFkWll5tc8QxddhHcul5+jMBTTOCzAHePKVinIRUbGVF9/MirYDjIfs7eounpok= oneadmin@bottom-center
|
1
type/__recycledcloud_opennebula_node/files/lsne.ch.pub
Normal file
1
type/__recycledcloud_opennebula_node/files/lsne.ch.pub
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCtLXNb7LYaYpUSynmP5+25AJX0II0M0IuNHC++plxuYBu/ziouiSHsfyoVeBUTXbPAxmz1Ginp1qSzXdL5R9J1ryUPDq8Ml/V+Wj3HrISxGjIrhBXABCct3U2XfN4Ag4KYapmDREe2EJ1TaSNOGUaVoL2/kxw4Uz8v4V6YNiXsN2l8d3H9Tp2c0VpXRmSIaMWqETl0yl3f8rz2IAFRPNkc4GW+ChbYy3YR9dy8P2okBJR5d0nQqLtSSgneexNePG8X/1E8cqTOwJGFZh8G7gLdhHlalgrqLbEGR7JH5RZm87ml1OvlDWQQqjlTZLRdeHKz5ebHy+tHeYUCns2akNdu7+mSzUX4ZYY/3vrCE14G9Yoebff1kRcGnzS4mqG0dNAnOy+HT62rdfAuGCWQZqkNhgOTjaokxiK4Zhg5jUyTcyRiJaa1I25wdyOfRZQnqd2FTkW6zhalh+MloCXL9yugKHd2395lKwIualKVolqrRAtrdztsaiW9EgD5Fl9OJUk= oneadmin@gentle-pony
|
18
type/__recycledcloud_opennebula_node/gencode-remote
Executable file
18
type/__recycledcloud_opennebula_node/gencode-remote
Executable file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
ceph_libvirt_key=$(cat "$__object/parameter/ceph-secret")
|
||||||
|
UUID=$(cat "$__object/parameter/ceph-secret-uuid")
|
||||||
|
|
||||||
|
cat << EOF
|
||||||
|
cat > secret.xml << END
|
||||||
|
<secret ephemeral='no' private='no'>
|
||||||
|
<uuid>$UUID</uuid>
|
||||||
|
<usage type='ceph'>
|
||||||
|
<name>client.libvirt secret</name>
|
||||||
|
</usage>
|
||||||
|
</secret>
|
||||||
|
END
|
||||||
|
|
||||||
|
virsh -c qemu:///system secret-define secret.xml
|
||||||
|
virsh -c qemu:///system secret-set-value --secret $UUID --base64 $ceph_libvirt_key
|
||||||
|
EOF
|
37
type/__recycledcloud_opennebula_node/manifest
Normal file
37
type/__recycledcloud_opennebula_node/manifest
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
#!/bin/sh
|
||||||
|
ONE_RELEASE='5.12'
|
||||||
|
|
||||||
|
os=$(cat "${__global:?}/explorer/os")
|
||||||
|
case "$os" in
|
||||||
|
ubuntu)
|
||||||
|
os="Ubuntu"
|
||||||
|
;;
|
||||||
|
debian)
|
||||||
|
__package qemu-block-extra
|
||||||
|
__package netcat-openbsd
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "This type is expected to run on Ubuntu, not $os. Exiting." >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
zone=$(cat "${__object:?}/parameter/zone")
|
||||||
|
|
||||||
|
LIBVIRT_KEY=$(cat "${__object:?}/parameter/ceph-secret")
|
||||||
|
export LIBVIRT_KEY
|
||||||
|
|
||||||
|
__opennebula_repo --one-release $ONE_RELEASE
|
||||||
|
|
||||||
|
require="__opennebula_repo" __package opennebula-node
|
||||||
|
require="__package/opennebula-node" __ssh_authorized_keys oneadmin \
|
||||||
|
--key "$(cat "${__type:?}/files/$zone.pub")"
|
||||||
|
|
||||||
|
mkdir -p "${__object:?}/files"
|
||||||
|
"${__type:?}/files/ceph.client.libvirt.keyring.sh" > "${__object:?}/files/ceph.client.libvirt.keyring"
|
||||||
|
|
||||||
|
__directory /etc/ceph --parents
|
||||||
|
require="__directory/etc/ceph __package/opennebula-node" __file \
|
||||||
|
/etc/ceph/ceph.client.libvirt.keyring \
|
||||||
|
--source "$__object/files/ceph.client.libvirt.keyring" \
|
||||||
|
--owner oneadmin
|
3
type/__recycledcloud_opennebula_node/parameter/required
Normal file
3
type/__recycledcloud_opennebula_node/parameter/required
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
zone
|
||||||
|
ceph-secret
|
||||||
|
ceph-secret-uuid
|
0
type/__recycledcloud_opennebula_node/singleton
Normal file
0
type/__recycledcloud_opennebula_node/singleton
Normal file
Reference in a new issue