diff --git a/templates/neutron/dibbler-client.epp b/templates/neutron/dibbler-client.epp index 6a9686805..e416dd013 100644 --- a/templates/neutron/dibbler-client.epp +++ b/templates/neutron/dibbler-client.epp @@ -24,9 +24,11 @@ NETNS=$(ip netns identify) NAME=neutron-dibbler-${NETNS} <%- if $container_cli == 'docker' { -%> CLI='docker' +LOGGING='' CMD="ip netns exec ${NETNS} /usr/sbin/dibbler-client run" <%- } elsif $container_cli == 'podman' { -%> CLI="nsenter --net=/run/netns/${NETNS} --preserve-credentials -m -t 1 podman" +LOGGING="--log-driver json-file --log-opt path=/var/log/containers/stdouts/${NAME}.log" CMD='/usr/sbin/dibbler-client run' <%- } else { -%> CLI='echo noop' @@ -47,7 +49,7 @@ fi # If the NAME is already taken by a container, give it an unique name printf "%s\n" "${LIST}" | grep -q "${NAME}$" && NAME="${NAME}-$(date +%Y-%m-%d-%H%M%S-%N)" echo "Starting a new child container ${NAME}" -$CLI run --detach \ +$CLI run --detach ${LOGGING} \ -v /var/lib/config-data/puppet-generated/neutron/etc/neutron:/etc/neutron:ro \ -v /run/netns:/run/netns:shared \ -v /var/lib/neutron:/var/lib/neutron:z,shared \ diff --git a/templates/neutron/dnsmasq.epp b/templates/neutron/dnsmasq.epp index f09234702..2b9b898a3 100644 --- a/templates/neutron/dnsmasq.epp +++ b/templates/neutron/dnsmasq.epp @@ -21,9 +21,11 @@ NETNS=$(ip netns identify) NAME=neutron-dnsmasq-${NETNS} <%- if $container_cli == 'docker' { -%> CLI='docker' +LOGGING='' CMD="ip netns exec ${NETNS} /usr/sbin/dnsmasq -k" <%- } elsif $container_cli == 'podman' { -%> CLI="nsenter --net=/run/netns/${NETNS} --preserve-credentials -m -t 1 podman" +LOGGING="--log-driver json-file --log-opt path=/var/log/containers/stdouts/${NAME}.log" CMD='/usr/sbin/dnsmasq -k' <%- } else { -%> CLI='echo noop' @@ -45,7 +47,7 @@ fi # If the NAME is already taken by a container, give it an unique name printf "%s\n" "${LIST}" | grep -q "${NAME}$" && NAME="${NAME}-$(date +%Y-%m-%d-%H%M%S-%N)" echo "Starting a new child container ${NAME}" -$CLI run --detach \ +$CLI run --detach ${LOGGING} \ -v /var/lib/config-data/puppet-generated/neutron/etc/neutron:/etc/neutron:ro \ -v /run/netns:/run/netns:shared \ -v /var/lib/neutron:/var/lib/neutron:z,shared \ diff --git a/templates/neutron/haproxy.epp b/templates/neutron/haproxy.epp index 86d21c7de..c4359e71d 100644 --- a/templates/neutron/haproxy.epp +++ b/templates/neutron/haproxy.epp @@ -22,9 +22,11 @@ NAME=neutron-haproxy-${NETNS} HAPROXY_CMD='$(if [ -f /usr/sbin/haproxy-systemd-wrapper ]; then echo "/usr/sbin/haproxy -Ds"; else echo "/usr/sbin/haproxy -Ws"; fi)' <%- if $container_cli == 'docker' { -%> CLI='docker' +LOGGING='' CMD="ip netns exec ${NETNS} "'$HAPROXY' <%- } elsif $container_cli == 'podman' { -%> CLI="nsenter --net=/run/netns/${NETNS} --preserve-credentials -m -t 1 podman" +LOGGING="--log-driver json-file --log-opt path=/var/log/containers/stdouts/${NAME}.log" CMD='$HAPROXY' <%- } else { -%> CLI='echo noop' @@ -45,7 +47,7 @@ fi # If the NAME is already taken by a container, give it an unique name printf "%s\n" "${LIST}" | grep -q "${NAME}$" && NAME="${NAME}-$(date +%Y-%m-%d-%H%M%S-%N)" echo "Starting a new child container ${NAME}" -$CLI run --detach \ +$CLI run --detach ${LOGGING} \ -v /var/lib/config-data/puppet-generated/neutron/etc/neutron:/etc/neutron:ro \ -v /run/netns:/run/netns:shared \ -v /var/lib/neutron:/var/lib/neutron:z,shared \ diff --git a/templates/neutron/keepalived.epp b/templates/neutron/keepalived.epp index 5f0dca24a..599038c72 100644 --- a/templates/neutron/keepalived.epp +++ b/templates/neutron/keepalived.epp @@ -21,9 +21,11 @@ NETNS=$(ip netns identify) NAME=neutron-keepalived-${NETNS} <%- if $container_cli == 'docker' { -%> CLI='docker' +LOGGING='' CMD="ip netns exec ${NETNS} /usr/sbin/keepalived -n -l -D" <%- } elsif $container_cli == 'podman' { -%> CLI="nsenter --net=/run/netns/${NETNS} --preserve-credentials -m -t 1 podman" +LOGGING="--log-driver json-file --log-opt path=/var/log/containers/stdouts/${NAME}.log" CMD='/usr/sbin/keepalived -n -l -D' <%- } else { -%> CLI='echo noop' @@ -44,7 +46,7 @@ fi # If the NAME is already taken by a container, give it an unique name printf "%s\n" "${LIST}" | grep -q "${NAME}$" && NAME="${NAME}-$(date +%Y-%m-%d-%H%M%S-%N)" echo "Starting a new child container ${NAME}" -$CLI run --detach \ +$CLI run --detach ${LOGGING} \ -v /var/lib/config-data/puppet-generated/neutron/etc/neutron:/etc/neutron:ro \ -v /lib/modules:/lib/modules:ro \ -v /sbin/modprobe:/sbin/modprobe:ro \ diff --git a/templates/neutron/radvd.epp b/templates/neutron/radvd.epp index bb5c517e6..03b40e7c9 100644 --- a/templates/neutron/radvd.epp +++ b/templates/neutron/radvd.epp @@ -21,9 +21,11 @@ NETWORK_ID=$(echo $ARGS| awk '{if (match($0, /(\w{8}-\w{4}-\w{4}-\w{4}-\w{12})/, NAME=neutron-radvd-${NETWORK_ID} <%- if $container_cli == 'docker' { -%> CLI='docker' +LOGGING='' CMD="ip netns exec qrouter-${NETWORK_ID} /usr/sbin/radvd -n" <%- } elsif $container_cli == 'podman' { -%> CLI="nsenter --net=/run/netns/${NETNS} --preserve-credentials -m -t 1 podman" +LOGGING="--log-driver json-file --log-opt path=/var/log/containers/stdouts/${NAME}.log" CMD='/usr/sbin/radvd -n' <%- } else { -%> CLI='echo noop' @@ -44,7 +46,7 @@ fi # If the NAME is already taken by a container, give it an unique name printf "%s\n" "${LIST}" | grep -q "${NAME}$" && NAME="${NAME}-$(date +%Y-%m-%d-%H%M%S-%N)" echo "Starting a new child container ${NAME}" -$CLI run --detach \ +$CLI run --detach ${LOGGING} \ -v /var/lib/config-data/puppet-generated/neutron/etc/neutron:/etc/neutron:ro \ -v /run/netns:/run/netns:shared \ -v /var/lib/neutron:/var/lib/neutron:z,shared \