[Ovirt-devel] [PATCH node] Add collectd and libvirt-qpid setup to ovirt-install-node

Daniel P. Berrange berrange at redhat.com
Tue Oct 14 21:17:55 UTC 2008


On Tue, Oct 14, 2008 at 02:28:33PM -0400, Perry Myers wrote:
> This patch adds setup for libvirt-qpid and collectd to
> the ovirt-install-node script so that they will both work
> in stateful setup.
> 
> Signed-off-by: Ian Main <imain at redhat.com>
> Signed-off-by: Perry Myers <pmyers at redhat.com>
> ---
>  ovirt-listen-awake/ovirt-install-node   |   28 ++++++++++++++++++++++++----
>  ovirt-listen-awake/ovirt-uninstall-node |    4 +++-
>  2 files changed, 27 insertions(+), 5 deletions(-)
> 
> diff --git a/ovirt-listen-awake/ovirt-install-node b/ovirt-listen-awake/ovirt-install-node
> index a4a4b6f..95ba4de 100644
> --- a/ovirt-listen-awake/ovirt-install-node
> +++ b/ovirt-listen-awake/ovirt-install-node
> @@ -28,7 +28,7 @@ backup_file() {
>      dir=$(dirname "$1")
>      case $dir in /*);; *) die "unexpected non-absolute dir: $dir";; esac
>      mkdir -p "$OVIRT_BACKUP_DIR/${dir:1}"
> -    cp -pf "$1" "$OVIRT_BACKUP_DIR/${dir:1}"
> +    test -f "$1" && cp -pf "$1" "$OVIRT_BACKUP_DIR/${dir:1}"
>  }
>  
>  add_if_not_exist() {
> @@ -103,12 +103,31 @@ elif [ "$1" = "stateful" ]; then
>      fi
>      hostname $PHYS_HOST
>  
> +    collectd_conf=/etc/collectd.conf
> +    backup_file $collectd_conf
> +    if [ -f $collectd_conf.in ]; then
> +        sed -e "s/@COLLECTD_SERVER@/$MGMT_HOST/" \
> +            -e "s/@COLLECTD_PORT@/25826/" $collectd_conf.in \
> +            > $collectd_conf
> +    fi

Anyone fancy writing an augeas lens for collectd ?

> +
> +    libvirt_qpid_conf=/etc/sysconfig/libvirt-qpid

Doesn't augeas know how to edit all sysconfig files ? Be
better to use that than sed/grep IMHO.

> +    backup_file $libvirt_qpid_conf
> +    if [ -f $libvirt_qpid_conf ]; then
> +        if grep "^LIBVIRT_QPID_ARGS=" $libvirt_qpid_conf > /dev/null 2>&1 ; then
> +            sed -i -e "s/^LIBVIRT_QPID_ARGS=.*/LIBVIRT_QPID_ARGS=\"--broker $MGMT_HOST --port 5672\"/" $libvirt_qpid_conf
> +        else
> +            echo "LIBVIRT_QPID_ARGS=\"--broker $MGMT_HOST --port 5672\"" >> $libvirt_qpid_conf
> +        fi
> +    fi
> +
>      backup_file /etc/hosts
>      add_if_not_exist "192.168.50.1 $PHYS_HOST" /etc/hosts
>      add_if_not_exist "192.168.50.2 $MGMT_HOST" /etc/hosts
>  
>      chkconfig ovirt-listen-awake on
>      chkconfig collectd on
> +    chkconfig libvirt-qpid on

What's our security model for libvirt-qpid / brokers ? Our
existing libvirtd setup is kerberos secured, so it'd expect
qpid to at least match that before switching.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the ovirt-devel mailing list