Skip to content

Instantly share code, notes, and snippets.

@eglute
Forked from shannonmitchell/rpc_maas_on_osp_13.md
Created December 1, 2020 20:34
Show Gist options
  • Save eglute/2cd2552f7d69ddf85216cf872e8346e8 to your computer and use it in GitHub Desktop.
Save eglute/2cd2552f7d69ddf85216cf872e8346e8 to your computer and use it in GitHub Desktop.

Install rpc-maas on osp13 test

Entity creation

No need to create entities when testing with a test cloud account. The scripts will create them for you. Hybrid's with a core account has to have the entities created though. This is done automatically if the core account is set up for rackspace monitoring.

Configuring overrides

I use raxmon with cloud10 to work with the monitoring api. I have the ~/.raxrc file set up for it. The username and apikey was set up from the account page. You can find more info at:

cat ~/.raxrc 
[credentials]
username=removed
api_key=removed



[auth_api]
url=https://identity.api.rackspacecloud.com/v2.0/tokens

# Get a current token
raxmon-limits-list --debug 2>&1 | egrep 'curl.*X-Auth-Token'
# Run as stack on the director vm
cat <<EOF > /home/stack/user_maas_variables.yml
# MaaS v2 overrides
maas_api_url: https://monitoring.api.rackspacecloud.com/v1.0/407382
maas_auth_token: "Pulled from the X-Auth-Token info from the raxmon debug"

# The entityLabel should based on the 'maas_fqdn_extension', as follows:
# entityLabel == '{{ inventory_hostname }}{{ maas_fqdn_extension }}'
# Refer to the naming convention documentation section for additional details
#
maas_fqdn_extension: ".lab3.phobos.rpc.rackspace.com"

# Define a Unique Environment ID
# If multiple clouds exist on an account, each should have a different value
#
maas_env_identifier: "testenv"

# Identify data center requirements for PNM and hardware monitoring
#  true = Rackspace DC (RDC) or OpenStack Everywhere deployments
# false = Customer DC (CDC)
#
maas_raxdc: true

# Release-specific exclusions are now handled dynamically. These
# overrides will likely remain empty. These are included for
# compatibility to remove any remnant host_vars that may have
# existed in the inventory.
maas_excluded_checks: []
maas_excluded_alarms: []

maas_rabbitmq_password: $(openssl rand -base64 32)
maas_swift_accesscheck_password: $(openssl rand -base64 32)

maas_notification_plan: "set up a test notification plan and use the np id(not the name)"


EOF

Pull down repositories

# Run as root on the director vm:
git clone https://github.com/rcbops/rpc-maas.git /opt/rpc-maas
git clone https://github.com/rcbops/magnanimous-turbo-chainsaw.git /opt/magnanimous-turbo-chainsaw

Set up the venv using MTC scripts

# Run as root on the director vm
cd /opt/magnanimous-turbo-chainsaw
chmod u+x scripts/*
scripts/setup.sh

Run the playbooks

# Run steps as root on the director vm

# activate the venv with added env vars.
. /opt/magnanimous-turbo-chainsaw/scripts/setup-workspace.sh
env | egrep "^(ANSIBLE|MTC)" | sort

# Run system probe
# Fix 1: It expects 'director' in /etc/hosts.  I had to edit and add 'director' to the end
#    grep director /etc/hosts
#    192.168.221.1 directorvm.lab3.phobos.rpc.rackspace.com directorvm directorvm.ctlplane director
#
ansible-playbook /opt/magnanimous-turbo-chainsaw/playbooks/probe-systems.yml


# Make sure all of the overrides files are set in USER_ALL_VARS
echo "${USER_ALL_VARS}"


# Run the rpc-maas playbooks
cd /opt/rpc-maas
ansible-playbook ${USER_ALL_VARS} playbooks/site.yml -e 'create_entity_if_not_exists=True' -e 'maas_use_api=True' -e 'maas_private_monitoring_enabled=False' -f 75


# Actions taken before re-running the above:
#
# Fixing contextlib2 error. 
# vi playbooks/vars/maas.yml
#   maas_pip_packages:
#    ...
#    - contextlib2==0.6.0.post1

# 
#
# Fixed an issue where mass was thinking we were setting up private pollers with the maas_private_monitoring_enabled option.
#
# Fixed entities not creating by adding create_entity_if_not_exists and maas_use_api.
#

ansible-playbook ${USER_ALL_VARS} playbooks/maas-verify.yml -f 20
deactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment