OpenStack in a snap!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1020 lines
27 KiB

name: microstack
version: stein
base: core18
summary: OpenStack on your laptop.
description: |
Microstack gives you an easy way to develop and test OpenStack
workloads on your laptop.
grade: devel
confinement: strict
environment:
LC_ALL: C
PATH: $SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH
OS_PLACEMENT_CONFIG_DIR: $SNAP/etc/nova/
layout:
# Libvirt/Qemu libs
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/ceph:
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/ceph
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qemu:
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qemu
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio:
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio
/usr/lib/libvirt:
bind: $SNAP/usr/lib/libvirt
/usr/share/libvirt:
bind: $SNAP/usr/share/libvirt
/usr/share/qemu:
bind: $SNAP/usr/share/qemu
# Keystone really wants to look here for its fernet keys for some reason
/etc/keystone/fernet-keys:
bind: $SNAP_COMMON/fernet-keys
apps:
# Openstack
openstack:
command: openstack-wrapper openstack
plugs:
- network
# OpenStack Service Configuration
init:
command: microstack_init
plugs:
- network
- mount-observe # rabbitmq-ctl
- network-bind # rabbitmq-ctl?
- firewall-control # iptables
- network-control # iptables
- ssh-keys # write ssh key
- system-observe # rabbitmq ?
- hardware-observe # rabbitmq ?
remove:
command: microstack_remove
# Keystone
keystone-uwsgi:
command: snap-openstack launch keystone-uwsgi
daemon: simple
plugs:
- network-bind
- network
- network-control
keystone-manage:
command: snap-openstack launch keystone-manage
plugs:
- network
# Nova
nova-uwsgi:
command: snap-openstack launch nova-uwsgi
daemon: simple
plugs:
- network
- network-bind
- network-control
nova-api:
command: snap-openstack launch nova-api-os-compute
daemon: simple
plugs:
- network
- network-bind
- network-control
nova-conductor:
command: snap-openstack launch nova-conductor
daemon: simple
plugs:
- network
- network-control
nova-scheduler:
command: snap-openstack launch nova-scheduler
daemon: simple
plugs:
- network
- network-bind
- network-control
nova-compute:
command: snap-openstack launch nova-compute
daemon: simple
plugs:
- network
- network-bind
- network-control
- firewall-control
- hardware-observe
nova-api-metadata:
command: snap-openstack launch nova-api-metadata
daemon: simple
plugs:
- network
- network-bind
- firewall-control
nova-manage:
command: snap-openstack launch nova-manage
plugs:
- network
# Neutron
neutron-api:
command: snap-openstack launch neutron-server
daemon: simple
plugs:
- network
- network-bind
- network-control
neutron-openvswitch-agent:
command: snap-openstack launch neutron-openvswitch-agent
daemon: simple
plugs:
- network
- network-bind
- network-control
- network-observe
- firewall-control
- process-control
- system-observe
neutron-l3-agent:
command: snap-openstack launch neutron-l3-agent
daemon: simple
plugs:
- network
- network-bind
- network-control
- network-observe
- firewall-control
- process-control
- system-observe
neutron-dhcp-agent:
command: snap-openstack launch neutron-dhcp-agent
daemon: simple
plugs:
- network
- network-bind
- network-control
- network-observe
- process-control
- system-observe
neutron-metadata-agent:
command: snap-openstack launch neutron-metadata-agent
daemon: simple
plugs:
- network
- network-bind
- network-control
neutron-ovs-cleanup:
command: snap-openstack launch neutron-ovs-cleanup
plugs:
- network
- network-control
neutron-netns-cleanup:
command: snap-openstack launch neutron-netns-cleanup
plugs:
- network
- network-control
neutron-db-manage:
command: snap-openstack launch neutron-db-manage
plugs:
- network
# Glance
glance-api:
command: snap-openstack launch glance-api
daemon: simple
plugs:
- network
- network-bind
- mount-observe
- network-control
registry:
command: snap-openstack launch glance-registry
daemon: simple
plugs:
- network
- network-bind
- network-control
glance-manage:
command: snap-openstack launch glance-manage
plugs:
- network
# Openstack Shared Services
nginx:
command: snap-openstack launch nginx
daemon: forking
plugs:
- network
- network-bind
# Openvswitch
ovs-vswitchd:
command: ovs-wrapper $SNAP/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server --no-monitor --system-id=random start
stop-command: ovs-wrapper $SNAP/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server stop
after: [ovsdb-server]
daemon: forking
plugs:
- network
- network-bind
- network-control
- openvswitch-support
- process-control
- system-trace
ovsdb-server:
command: ovs-wrapper $SNAP/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd --no-monitor --system-id=random start
stop-command: ovs-wrapper $SNAP/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd stop
daemon: forking
plugs:
- network
- network-bind
- network-control
- openvswitch-support
- process-control
- system-trace
ovs-vsctl:
command: ovs-wrapper bin/ovs-vsctl
plugs:
- network
ovs-appctl:
command: ovs-wrapper bin/ovs-appctl
plugs:
- network
ovs-ofctl:
command: ovs-wrapper bin/ovs-ofctl
plugs:
- network
ovs-dpctl:
command: ovs-wrapper bin/ovs-dpctl
plugs:
- network
external-bridge:
command: wait-on-init setup-br-ex
daemon: oneshot
after: [ovs-vswitchd]
plugs:
- network
- network-control
# Libvirt/Qemu
libvirtd:
command: usr/sbin/libvirtd --pid $SNAP_DATA/libvirt.pid
daemon: simple
plugs:
- network
- network-bind
- network-control
- netlink-connector
- netlink-audit
virtlogd:
command: virtlogd --pid $SNAP_DATA/virtlogd.pid
daemon: simple
plugs:
- network
- network-bind
- network-control
virsh:
command: virsh
# MySQL
mysqld:
command: mysql-start-server
daemon: simple
plugs:
- process-control
- network
- network-bind
mysql:
command: mysql-start-client
plugs:
- process-control
- network
# RabbitMQ
rabbitmq-server:
command: rabbitmq-server
daemon: simple
plugs:
- network-bind
- network
- mount-observe
- log-observe
environment:
HOME: $SNAP_COMMON/lib/rabbitmq
rabbitmqctl:
command: rabbitmqctl
plugs:
- network
- mount-observe
environment:
HOME: $SNAP_COMMON/lib/rabbitmq
rabbitmq-plugins:
command: rabbitmq-plugins
environment:
HOME: $SNAP_COMMON/lib/rabbitmq
# Memcached
memcached:
command: memcached -u root -v
daemon: simple
plugs:
- network
- network-bind
# Cinder
cinder-uwsgi:
command: snap-openstack launch cinder-uwsgi
daemon: simple
plugs:
- network
- network-bind
cinder-backup:
command: snap-openstack launch cinder-backup
daemon: simple
plugs:
- network
- mount-observe
cinder-manage:
command: snap-openstack launch cinder-manage
plugs:
- network
- mount-observe
cinder-scheduler:
command: snap-openstack launch cinder-scheduler
daemon: simple
plugs:
- network
- mount-observe
cinder-volume:
command: snap-openstack launch cinder-volume
daemon: simple
plugs:
- network
- mount-observe
# Horizon
horizon-uwsgi:
command: snap-openstack launch horizon-uwsgi
daemon: simple
plugs:
- network
- network-bind
# Utility to launch a vm. Creates security groups, floating ips,
# and other necessities as well.
launch:
command: microstack_launch
plugs:
- network
# Cluster
cluster-server:
command: flask run -p 10002 --host 0.0.0.0 # TODO: run as a uwsgi app
daemon: simple
environment:
LC_ALL: C.UTF-8 # Makes flask happy
LANG: C.UTF-8 # Makes flask happy
FLASK_APP: $SNAP/lib/python3.6/site-packages/cluster/daemon.py
plugs:
- network
- network-bind
join:
command: python3 $SNAP/lib/python3.6/site-packages/cluster/client.py
filebeat:
# this is to avoid conflict with filebeat package
command: bin/filebeat
daemon: simple
nrpe:
command: bin/nrpe
daemon: simple
telegraf:
command: bin/telegraf
daemon: simple
parts:
# Add Ubuntu Cloud Archive sources.
# Allows us to fetch things such as updated libvirt.
uca-sources:
plugin: nil
build-packages:
- ubuntu-cloud-keyring
- software-properties-common
- dpkg-dev # We'll need to manipulate sources later.
override-build: |
add-apt-repository -s cloud-archive:stein
apt-key update
apt update
snapcraftctl build
# OpenStack Python Projects, keyed off Keystone
openstack-projects:
plugin: python
python-version: python3
after:
- uca-sources
- libvirt
- patches
constraints:
- ${SNAPCRAFT_STAGE}/patches/upper-constraints.txt
source: http://tarballs.openstack.org/keystone/keystone-stable-stein.tar.gz
python-packages:
- libvirt-python
- oslo.cache[dogpile]
- pymysql
- uwsgi
- git+https://opendev.org/x/snap.openstack#egg=snap.openstack
- http://tarballs.openstack.org/nova/nova-stable-stein.tar.gz
- http://tarballs.openstack.org/neutron/neutron-stable-stein.tar.gz
- http://tarballs.openstack.org/glance/glance-stable-stein.tar.gz
- http://tarballs.openstack.org/cinder/cinder-stable-stein.tar.gz
- horizon
- python-cinderclient
- python-openstackclient
- python-swiftclient
# Workaround for https://bugs.launchpad.net/snapcraft/+bug/1860768
# This is a package required for the launch script, per the bug
# above. We include it here so that we don't try to rebuild dist
# stuff:
- petname
build-packages:
- gcc
- git
- libffi-dev
- libssl-dev
- libxml2-dev
- libxslt1-dev
stage-packages:
- conntrack
- coreutils
- haproxy
- libmagic1
- python3-dev
- python3-systemd
override-prime: |
snapcraftctl prime
# Patch Openstack Dashboard (horizon) settings files.
for patch in ${SNAPCRAFT_STAGE}/patches/horizon/*.patch; do
echo "Applying $(basename "$patch") ..."
patch \
--batch \
--forward \
--strip 1 \
--input "$patch"
echo
done
# Now that everything is built, let's disable user site-packages
# as stated in PEP-0370
sed -i usr/lib/python3.6/site.py -e 's/^ENABLE_USER_SITE = None$/ENABLE_USER_SITE = False/'
# Uncomment the below line for better python-libvirt debugging output.
# patch --batch --forward --strip 1 --input ../project/patches/nova/nova_log_error.patch
organize:
lib/python3.6/site-packages/openstack_dashboard/local/local_settings.py.example: lib/python3.6/site-packages/openstack_dashboard/local/local_settings.py
keystone-config:
after: [openstack-projects]
plugin: dump
source: http://tarballs.openstack.org/keystone/keystone-stable-stein.tar.gz
organize:
etc/*.conf: etc/keystone/
etc/*.ini: etc/keystone/
etc/*.json: etc/keystone/
etc/*.templates: etc/keystone/
filesets:
etc:
- etc/keystone/*
stage: [$etc]
prime: [$etc]
openstack-wrapper:
source: ./snap-wrappers/openstack
plugin: dump
after:
- openstack-projects
organize:
openstack-wrapper: bin/openstack-wrapper
init-wrapper:
source: ./snap-wrappers/init
plugin: dump
organize:
wait-on-init: bin/wait-on-init
nova-config:
after: [openstack-projects]
plugin: dump
source: http://tarballs.openstack.org/nova/nova-stable-stein.tar.gz
filesets:
etc:
- etc/nova/*
stage: [$etc]
prime: [$etc]
neutron-config:
after: [openstack-projects]
plugin: dump
source: http://tarballs.openstack.org/neutron/neutron-stable-stein.tar.gz
organize:
etc/*.conf: etc/neutron/
etc/*.ini: etc/neutron/
etc/*.json: etc/neutron/
etc/rootwrap.d/*: etc/neutron/rootwrap.d/
filesets:
etc:
- etc/neutron/*
stage: [$etc]
prime: [$etc]
glance-config:
after: [openstack-projects]
plugin: dump
source: http://tarballs.openstack.org/glance/glance-stable-stein.tar.gz
organize:
etc/*.conf: etc/glance/
etc/*.ini: etc/glance/
etc/*.json: etc/glance/
filesets:
etc:
- etc/glance/*
stage: [$etc]
prime: [$etc]
cinder-config:
after: [openstack-projects]
plugin: dump
source: http://tarballs.openstack.org/cinder/cinder-stable-stein.tar.gz
organize:
etc/*.conf: etc/cinder/
etc/*.ini: etc/cinder/
etc/*.json: etc/cinder/
etc/*.templates: etc/cinder/
filesets:
etc:
- etc/cinder/*
stage: [$etc]
prime: [$etc]
horizon-config:
after: [openstack-projects]
plugin: dump
source: http://tarballs.openstack.org/horizon/horizon-stable-stein.tar.gz
organize:
etc/*.conf: etc/horizon/
filesets:
etc:
- etc/horizon/*
stage: [$etc]
prime: [$etc]
# Snap patches
patches:
after:
- uca-sources
source: patches/
plugin: dump
organize:
'*' : patches/
prime:
- -*
openvswitch:
source: http://openvswitch.org/releases/openvswitch-2.11.1.tar.gz
plugin: autotools
build-packages:
- libssl-dev
- try: [libnuma-dev]
- libcap-ng-dev
- libpcap-dev
- libunbound-dev
- python-all
- python-six
- python-setuptools
stage-packages:
- uuid-runtime
- libunbound2
configflags:
- "--localstatedir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common"
- "--sysconfdir=/var/snap/$SNAPCRAFT_PROJECT_NAME/etc"
after:
- patches
ovs-wrapper:
source: ./snap-wrappers/ovs
plugin: dump
after:
- openvswitch
organize:
ovs-wrapper: bin/ovs-wrapper
nginx:
source: http://www.nginx.org/download/nginx-1.13.0.tar.gz
plugin: autotools
after:
- patches
configflags:
- --prefix=/usr
- "--http-log-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/log/nginx-access.log"
- "--error-log-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/log/nginx-error.log"
- "--lock-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lock/nginx.lock"
- "--pid-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/run/nginx.pid"
- "--http-client-body-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_client_body"
- "--http-proxy-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_proxy"
- "--http-fastcgi-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_fastcgi"
- "--http-uwsgi-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_uwsgi"
- "--http-scgi-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_scgi"
- --with-http_ssl_module
build-packages:
- libpcre3-dev
- libssl-dev
- python-six
override-build: |
# Apply patches
for patch in ${SNAPCRAFT_STAGE}/patches/nginx/*.patch; do
echo "Applying $(basename "$patch") ..."
patch \
--batch \
--forward \
--strip 1 \
--input "$patch"
echo
done
snapcraftctl build
nginx:
source: http://www.nginx.org/download/nginx-1.13.0.tar.gz
plugin: autotools
after:
- patches
configflags:
- --prefix=/usr
- "--http-log-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/log/nginx-access.log"
- "--error-log-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/log/nginx-error.log"
- "--lock-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lock/nginx.lock"
- "--pid-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/run/nginx.pid"
- "--http-client-body-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_client_body"
- "--http-proxy-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_proxy"
- "--http-fastcgi-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_fastcgi"
- "--http-uwsgi-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_uwsgi"
- "--http-scgi-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_scgi"
- --with-http_ssl_module
build-packages:
- libpcre3-dev
- libssl-dev
- python-six
override-build: |
# Apply patches
for patch in ${SNAPCRAFT_STAGE}/patches/nginx/*.patch; do
echo "Applying $(basename "$patch") ..."
patch \
--batch \
--forward \
--strip 1 \
--input "$patch"
echo
done
snapcraftctl build
# libvirt/qemu
qemu:
source: .
source-subdir: qemu-3.1+dfsg
plugin: autotools
after:
- uca-sources
build-environment:
# Workaround for https://bugs.launchpad.net/snapcraft/+bug/1860766
- LD_LIBRARY_PATH: $SNAPCRAFT_PART_INSTALL/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/ceph:$SNAPCRAFT_PART_INSTALL/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio:$LD_LIBRARY_PATH
stage-packages:
- seabios
- ipxe-qemu
- freeglut3 # provides libglut.so.3
- try:
- libnuma1
- libspice-server1
- libasound2
- libasyncns0
- libbluetooth3
- libboost-iostreams1.62.0
- libboost-random1.62.0
- libboost-system1.62.0
- libboost-thread1.62.0
- libcaca0
- libfdt1
- libflac8
- libglu1-mesa
- libiscsi7
- libjpeg-turbo8
- libnspr4
- libnss3
- libogg0
- libopus0
- libpixman-1-0
- libpulse0
- librados2
- librbd1
- libsdl1.2debian
- libslang2
- libsndfile1
- libusb-1.0-0
- libusbredirparser1
- libvorbis0a
- libvorbisenc2
- libx11-6
- libxi6
- libxau6
- libxcb1
- libxdmcp6
- libxen-dev
- libxext6
- libpng16-16
build-packages:
- acpica-tools
- libaio-dev
- libasound2-dev
- libattr1-dev
- libbluetooth-dev
- libcap-dev
- libcap-ng-dev
- libcurl4-gnutls-dev
- libfdt-dev
- gnutls-dev
- libiscsi-dev
- libncurses5-dev
- try: [libnuma-dev]
- libpixman-1-dev
- libpulse-dev
- librados-dev
- librbd-dev
- libsasl2-dev
- libsdl1.2-dev
- try: [libspice-server-dev, libspice-protocol-dev]
- libusb-1.0-0-dev
- libusbredirparser-dev
- linux-libc-dev
- uuid-dev
- xfslibs-dev
- libjpeg-dev
- zlib1g-dev
- libpng-dev
- wget
- dpkg-dev
- gcc
configflags:
- --disable-blobs
- --prefix=/usr
- --localstatedir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common
- --sysconfdir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common
- --firmwarepath=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/seabios:/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/qemu:/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib/ipxe/qemu
- --disable-user
- --disable-linux-user
- --enable-system
- --target-list=x86_64-softmmu
override-build: |
# I think that snapcraft is creating this dir, which breaks the below.
rm -Rf qemu-3.1+dfsg
apt source qemu
# Fix issue with running apt source as root
dpkg-source --before-build qemu-3.1+dfsg
snapcraftctl build
kvm-support:
plugin: nil
stage-packages:
- try: [msr-tools]
libvirt:
source: .
source-subdir: libvirt-5.0.0
after:
- qemu
- uca-sources
plugin: autotools
build-packages:
- libxml2-dev
- libxml-libxml-perl
- libcurl4-gnutls-dev
- libncurses5-dev
- libreadline-dev
- zlib1g-dev
- libgcrypt20-dev
- libgnutls28-dev
- libyajl-dev
- libpcap0.8-dev
- libaudit-dev
- libdevmapper-dev
- libpciaccess-dev
- libnl-3-dev
- libnl-route-3-dev
- libxml2-utils
- uuid-dev
- try: [libnuma-dev]
- python-all
- python-six
- wget
- dpkg-dev
- xsltproc
stage-packages:
- dmidecode
- dnsmasq
- iptables
- libxml2
- libyajl2
- try: [libnuma1]
- libcurl3-gnutls
- libpcap0.8
- libpciaccess0
configflags:
- --with-qemu
- --without-bhyve
- --without-xen
- --without-openvz
- --without-vmware
- --without-xenapi
- --without-esx
- --without-hyperv
- --without-lxc
- --without-vz
- --without-vbox
- --without-uml
- --without-sasl
- --without-storage-iscsi
- --without-storage-sheepdog
- --without-storage-rbd
- --without-storage-lvm
- --without-selinux
- --prefix=/usr
- --localstatedir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common
- --sysconfdir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common
- DNSMASQ=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/sbin/dnsmasq
- DMIDECODE=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/sbin/dmidecode
- OVSVSCTL=/snap/$SNAPCRAFT_PROJECT_NAME/current/bin/ovs-vsctl
- IPTABLES_PATH=/snap/$SNAPCRAFT_PROJECT_NAME/current/sbin/iptables
- IP6TABLES_PATH=/snap/$SNAPCRAFT_PROJECT_NAME/current/sbin/ip6tables
override-build: |
# I think that snapcraft is creating this dir, which breaks the below.
rm -Rf libvirt-5.0.0
apt source libvirt
# Fix issue with running apt source as root
dpkg-source --before-build libvirt-5.0.0
snapcraftctl build
# MySQL
mysql-server:
plugin: dump
source: ./snap-wrappers/mysql
stage-packages:
- mysql-server
- mysql-client
organize:
mysql-start-server: bin/mysql-start-server
mysql-start-client: bin/mysql-start-client
# RabbitMQ
rabbitmq-server:
source: ./snap-wrappers/rabbitmq
plugin: dump
stage-packages:
- rabbitmq-server
override-build: |
rm -f $SNAPCRAFT_PART_INSTALL/usr/bin/erl
rm -f $SNAPCRAFT_PART_INSTALL/usr/lib/rabbitmq/bin/rabbitmq-script-wrapper
# NOTE(jamespage): The versioned path below is brittle.
rm -f $SNAPCRAFT_PART_INSTALL/usr/lib/rabbitmq/lib/rabbitmq_server-3.6.10/sbin/rabbitmq-defaults
snapcraftctl build
organize:
rabbitmq-script-wrapper: usr/lib/rabbitmq/bin/rabbitmq-script-wrapper
rabbitmq-defaults: usr/lib/rabbitmq/lib/rabbitmq_server-3.6.10/sbin/rabbitmq-defaults
erl: usr/bin/erl
# Memcached Token Caching
memcached:
plugin: nil
stage-packages:
- memcached
# Cinder LVM backend
lvm2:
source: http://www.sourceware.org/pub/lvm2/releases/LVM2.2.02.172.tgz
plugin: autotools
configflags:
- --with-confdir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/etc/
- --with-default-system-dir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/etc/
build-attributes: [no-patchelf]
# Templates and other files to be overlaid over the snap.
overlay:
plugin: dump
source: snap-overlay
# Optionally interactive init script
init:
plugin: python
python-version: python3
requirements:
- requirements.txt # Relative to source path, so tools/init/req...txt
source: tools/init
override-build: |
# Hack to avoid conflict between openstack-projects'
# site-customize and this one.
snapcraftctl build
rm $SNAPCRAFT_PART_INSTALL/usr/lib/python3.6/sitecustomize.py
# Launch script
launch:
plugin: python
python-version: python3
requirements:
- requirements.txt
source: tools/launch
override-build: |
# Hack to avoid conflict between openstack-projects'
# site-customize and this one.
snapcraftctl build
rm $SNAPCRAFT_PART_INSTALL/usr/lib/python3.6/sitecustomize.py
# Clustering client and server
cluster:
plugin: python
python-version: python3
requirements:
- requirements.txt
constraints:
- ${SNAPCRAFT_STAGE}/patches/upper-constraints.txt
source: tools/cluster
override-build: |
# Hack to avoid conflict between openstack-projects'
# site-customize and this one.
snapcraftctl build
rm $SNAPCRAFT_PART_INSTALL/usr/lib/python3.6/sitecustomize.py
### LMA stack ###
filebeat:
plugin: dump
source: ./snap-wrappers/filebeat
after: [ lma-build-prep, qemu, libvirt ]
stage-packages: [ filebeat ]
organize:
filebeat: bin/filebeat
nrpe:
plugin: dump
source: ./snap-wrappers/nrpe
organize:
nrpe: bin/nrpe
after: [ lma-build-prep ]
stage-packages: [ nagios-nrpe-server, nagios-nrpe-plugin, monitoring-plugins, monitoring-plugins-basic, monitoring-plugins-common ]
telegraf:
plugin: dump
source: ./snap-wrappers/telegraf
organize:
telegraf: bin/telegraf
# we use autotools plugin here because it brings git, make
# otherwise we'd have to add respective packages
after: [ lma-build-prep, qemu, libvirt ]
# See https://forum.snapcraft.io/t/patchelf-broke-my-binary/4928
# and https://bugs.launchpad.net/snapcraft/+bug/1753995
build-attributes: [no-patchelf]
stage-packages: [ telegraf, iproute2, bridge-utils, ethtool, fancontrol, libatm1, ipmitool, freeipmi-tools ]
lma-build-prep:
plugin: nil
source: ""
override-build: |
cat ../../../project/filebeat.pgp.key | apt-key add -
cat ../../../project/telegraf.pgp.key | apt-key add -
apt-get install apt-transport-https
echo 'deb https://artifacts.elastic.co/packages/5.x/apt stable main' > /etc/apt/sources.list.d/elastic-5.x.list
echo 'deb http://ppa.launchpad.net/telegraf-devs/ppa/ubuntu bionic main' > /etc/apt/sources.list.d/telegraf.x.list
# this needs to be re-worked in order to be built in-place
echo 'deb http://ppa.launchpad.net/nikolay.vinogradov/nrpe-root/ubuntu bionic main' > /etc/apt/sources.list.d/nrpe-root.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F767C80E0FC5C835
apt-get update --allow-unauthenticated
#lma-configs:
# plugin: dump
# source: ./lma
# after: [ lma-build-prep ]
# organize:
# 'config/nrpe': etc/nrpe
# 'config/telegraf': etc/telegraf
checks:
plugin: dump
source: ./checks
organize:
check_systemd.py: usr/lib/nagios/plugins/check_systemd.py
hooks:
install:
plugs: [network]
configure:
plugs: [network]
post-refresh:
plugs: [network]