<commit_before>#!/usr/bin/env bash
set -o errexit -o nounset
TOP_DIR=$(cd "$(dirname "$0")/.." && pwd)
source "$TOP_DIR/config/paths"
source "$CONFIG_DIR/credentials"
source "$LIB_DIR/functions.guest"
source "$CONFIG_DIR/openstack"
exec_logfile

indicate_current_auto

#------------------------------------------------------------------------------
# Set up OpenStack Networking (neutron) for network node.
# http://docs.openstack.org/juno/install-guide/install/apt/content/neutron-network-node.html
#------------------------------------------------------------------------------

echo "Editing /etc/sysctl.conf: enable IP forwarding, disable RPF filter."
cat << SYSCTL | sudo tee -a /etc/sysctl.conf
# Enable IP forwarding
net.ipv4.ip_forward=1
# Disable Reverse Path Forwarding filter (RFC 3704)
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
SYSCTL

# Reload changed file
sudo sysctl -p

echo "Installing networking components for network node."
sudo apt-get install -y neutron-plugin-ml2 neutron-plugin-openvswitch-agent \
    neutron-l3-agent neutron-dhcp-agent

# neutron-l3-agent has just been installed and is about to start. We are also
# about to change its configuration file which tends to result in the agent
# starting up with our changed configuration before the external bridge is
# ready which ends with a misconfigured system (port with tag=4095). We can
# either wait here for neutron-l3-agent to start with the old configuration
# files, or shut it down now and start it with the new configuration files once
# configuration files _and_ the external bridge are ready.
echo "Stopping neutron-l3-agent for now."
#sudo service neutron-l3-agent stop

echo "Configuring neutron for network node."

neutron_admin_user=$(service_to_user_name neutron)
neutron_admin_password=$(service_to_user_password neutron)

conf=/etc/neutron/neutron.conf
echo "Configuring $conf."

# Configure AMQP parameters
iniset_sudo $conf DEFAULT rpc_backend rabbit
iniset_sudo $conf DEFAULT rabbit_host controller-mgmt<commit_msg>Fix patch "Wait for external bridge"<commit_after>#!/usr/bin/env bash
set -o errexit -o nounset
TOP_DIR=$(cd "$(dirname "$0")/.." && pwd)
source "$TOP_DIR/config/paths"
source "$CONFIG_DIR/credentials"
source "$LIB_DIR/functions.guest"
source "$CONFIG_DIR/openstack"
exec_logfile

indicate_current_auto

#------------------------------------------------------------------------------
# Set up OpenStack Networking (neutron) for network node.
# http://docs.openstack.org/juno/install-guide/install/apt/content/neutron-network-node.html
#------------------------------------------------------------------------------

echo "Editing /etc/sysctl.conf: enable IP forwarding, disable RPF filter."
cat << SYSCTL | sudo tee -a /etc/sysctl.conf
# Enable IP forwarding
net.ipv4.ip_forward=1
# Disable Reverse Path Forwarding filter (RFC 3704)
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
SYSCTL

# Reload changed file
sudo sysctl -p

echo "Installing networking components for network node."
sudo apt-get install -y neutron-plugin-ml2 neutron-plugin-openvswitch-agent \
    neutron-l3-agent neutron-dhcp-agent

# neutron-l3-agent has just been installed and is about to start. We are also
# about to change its configuration file which tends to result in the agent
# starting up with our changed configuration before the external bridge is
# ready which ends with a misconfigured system (port with tag=4095). We can
# either wait here for neutron-l3-agent to start with the old configuration
# files, or shut it down now and start it with the new configuration files once
# configuration files _and_ the external bridge are ready.
echo "Stopping neutron-l3-agent for now."
sudo service neutron-l3-agent stop

echo "Configuring neutron for network node."

neutron_admin_user=$(service_to_user_name neutron)
neutron_admin_password=$(service_to_user_password neutron)

conf=/etc/neutron/neutron.conf
echo "Configuring $conf."

# Configure AMQP parameters
iniset_sudo $conf DEFAULT rpc_backend rabbit
iniset_sudo $conf DEFAULT rabbit_host controller-mgmt
{'fraction_non_alphanumeric': 0.157470703125, 'fraction_numerical': 0.01025390625, 'mean_word_length': 3.358510638297872, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6257248', 'n_tokens_mistral': 1221, 'n_tokens_neox': 1156, 'n_words': 402}