Skip to content

garethahealy/ansible-middleware-playground

Repository files navigation

ansible-middleware-playground

Examples using https://github.com/ansible-middleware/amq

Setup

If you don't have any infrastructure, see README.md. If you do, create an inventory file like samples

Check hosts are OK (run from bootstrap)

ansible all -i inventory/all.yml -m ansible.builtin.ping --user ec2-user --private-key ~/ec2_keypair.pem

Install the required roles

ansible-galaxy install -r requirements.yml

Set credentials to download AMQ. Service accounts can be used from https://console.redhat.com/iam/service-accounts/

export RHN_USERNAME="replace_me"
export RHN_PASSWORD="replace_me"

Set your AWS credentials

export AWS_ACCESS_KEY_ID="replace_me"
export AWS_SECRET_ACCESS_KEY="replace_me"

Single Broker

Deploy single broker with a custom broker.xml

ansible-playbook -i inventory/custom.yml playbooks/deploy-amq-custom.yml \
  -e rhn_username=${RHN_USERNAME} \
  -e rhn_password=${RHN_PASSWORD}

Test single broker configuration

ansible-playbook -i inventory/test.yml playbooks/test-amq-custom.yml \
  -e aws_access_key=${AWS_ACCESS_KEY_ID} \
  -e aws_secret_key=${AWS_SECRET_ACCESS_KEY}

Master/Slave Broker

Deploy master/slave broker, with shared storage

ansible-playbook -i inventory/master-slave.yml playbooks/deploy-amq-master-slave.yml \
  -e rhn_username=${RHN_USERNAME} \
  -e rhn_password=${RHN_PASSWORD} \
  -e aws_access_key=${AWS_ACCESS_KEY_ID} \
  -e aws_secret_key=${AWS_SECRET_ACCESS_KEY}

Test master/slave broker configuration

ansible-playbook -i inventory/test.yml playbooks/test-amq-master-slave.yml \
  -e aws_access_key=${AWS_ACCESS_KEY_ID} \
  -e aws_secret_key=${AWS_SECRET_ACCESS_KEY}

3 Clustered Brokers

Deploy clustered brokers

ansible-playbook -i inventory/clustered.yml playbooks/deploy-amq-clustered.yml \
  -e rhn_username=${RHN_USERNAME} \
  -e rhn_password=${RHN_PASSWORD}

Test clustered brokers configuration

ansible-playbook -i inventory/test.yml playbooks/test-amq-clustered.yml \
  -e aws_access_key=${AWS_ACCESS_KEY_ID} \
  -e aws_secret_key=${AWS_SECRET_ACCESS_KEY}

3 Federated Brokers

Deploy federated brokers

ansible-playbook -i inventory/federated.yml playbooks/deploy-amq-federated.yml \
  -e rhn_username=${RHN_USERNAME} \
  -e rhn_password=${RHN_PASSWORD}

Test federated brokers configuration

ansible-playbook -i inventory/test.yml playbooks/test-amq-federated.yml \
  -e aws_access_key=${AWS_ACCESS_KEY_ID} \
  -e aws_secret_key=${AWS_SECRET_ACCESS_KEY}

Remove an installation

ansible-playbook -i inventory/all.yml playbooks/remove-amq.yml \
  -e aws_access_key=${AWS_ACCESS_KEY_ID} \
  -e aws_secret_key=${AWS_SECRET_ACCESS_KEY}