mirror of
https://github.com/rocky-linux/infrastructure
synced 2024-12-25 12:28:29 +00:00
Updating/Adding rabbitmq vars and playbooks
This commit is contained in:
parent
6c27e93d7d
commit
496e2d208d
@ -0,0 +1,5 @@
|
||||
---
|
||||
# RabbitMQ Staging Vars
|
||||
rabbitmq_cluster_name: "rabbitprod"
|
||||
rabbitmq_cluster_list: "{{ groups['rabbitmq'] }}"
|
||||
rabbitmq_env: "production"
|
5
ansible/inventories/staging/group_vars/rabbitmq/main.yml
Normal file
5
ansible/inventories/staging/group_vars/rabbitmq/main.yml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
# RabbitMQ Staging Vars
|
||||
rabbitmq_cluster_name: "rabbitstage"
|
||||
rabbitmq_cluster_list: "{{ groups['rabbitmq'] }}"
|
||||
rabbitmq_env: "staging"
|
74
ansible/playbooks/role-rocky-rabbitmq.yml
Normal file
74
ansible/playbooks/role-rocky-rabbitmq.yml
Normal file
@ -0,0 +1,74 @@
|
||||
---
|
||||
# Stands up a RabbitMQ Cluster
|
||||
- name: Configure RabbitMQ
|
||||
hosts: rabbitmq
|
||||
become: true
|
||||
vars_files:
|
||||
- vars/encpass.yml
|
||||
- vars/rabbitmq.yml
|
||||
|
||||
# This is to try to avoid the handler issue in pre/post tasks
|
||||
handlers:
|
||||
- import_tasks: handlers/main.yml
|
||||
|
||||
pre_tasks:
|
||||
- name: Check if ansible cannot be run here
|
||||
stat:
|
||||
path: /etc/no-ansible
|
||||
register: no_ansible
|
||||
|
||||
- name: Verify if we can run ansible
|
||||
assert:
|
||||
that:
|
||||
- "not no_ansible.stat.exists"
|
||||
msg: "/etc/no-ansible exists - skipping run on this node"
|
||||
|
||||
# We have separate passwords per rabbitmq env
|
||||
- name: Import rabbitmq passwords
|
||||
include_vars:
|
||||
file: "vars/rabbitmq_{{ rabbitmq_env }}.yml"
|
||||
|
||||
# EPEL and PowerTools are required for ipsilon to function
|
||||
# I also couldn't find an ansible built-in to do this
|
||||
- name: Enable the PowerTools repository
|
||||
ini_file:
|
||||
dest: /etc/yum.repos.d/CentOS-Linux-PowerTools.repo
|
||||
section: powertools
|
||||
option: enabled
|
||||
value: 1
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
# The CentOS extras repos has epel-release provided
|
||||
- name: Enable the EPEL repository
|
||||
yum:
|
||||
name: epel-release
|
||||
state: present
|
||||
tags:
|
||||
- packages
|
||||
|
||||
# This will change eventually to a rocky-release-messaging repo or to a
|
||||
# rocky-release-rabbitmq repo
|
||||
- name: Install centos rabbitmq
|
||||
yum:
|
||||
name: centos-release-rabbitmq
|
||||
state: present
|
||||
tags:
|
||||
- packages
|
||||
|
||||
roles:
|
||||
- role: rockylinux.ipagetcert
|
||||
state: present
|
||||
|
||||
- role: rockylinux.rabbitmq
|
||||
state: present
|
||||
|
||||
post_tasks:
|
||||
- name: Touching run file that ansible has ran here
|
||||
file:
|
||||
path: /var/log/ansible.run
|
||||
state: touch
|
||||
mode: '0644'
|
||||
owner: root
|
||||
group: root
|
2
ansible/playbooks/tasks/rabbitmq-reconfigure.yml
Normal file
2
ansible/playbooks/tasks/rabbitmq-reconfigure.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
# RabbitMQ Additional Changes
|
17
ansible/playbooks/vars/rabbitmq.yml
Normal file
17
ansible/playbooks/vars/rabbitmq.yml
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
# rabbitmq settings
|
||||
rabbitmq_tls_ca_cert: "/etc/pki/tls/certs/ca-bundle.crt"
|
||||
rabbitmq_tls_cert: "/etc/pki/tls/certs/{{ ansible_fqdn }}.crt"
|
||||
rabbitmq_tls_key: "/etc/pki/tls/private/{{ ansible_fqdn }}.key"
|
||||
|
||||
# These should be in a vault, with a different value. Generated by:
|
||||
# dd if=/dev/urandom bs=30 count=1 | base64
|
||||
#rabbitmq_cookie: ...
|
||||
|
||||
# Admin passwords - these should be in a vault
|
||||
#rabbitmq_admin_password: ...
|
||||
|
||||
# rabbitmq cluster list and information should be defined in hostvars to ensure
|
||||
# that the configuration is idempotent.
|
||||
#rabbitmq_cluster_staging_list:
|
||||
#rabbitmq_cluster_staging_name:
|
4
ansible/playbooks/vars/rabbitmq_production.yml
Normal file
4
ansible/playbooks/vars/rabbitmq_production.yml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
# This will need to be vaulted
|
||||
rabbitmq_admin_password: ThisIsNotThePassword!
|
||||
rabbitmq_cookie: "X4MYneML6Ppp+ajPuG/qdD64ZjdVT1OJF8XUG/o+"
|
4
ansible/playbooks/vars/rabbitmq_staging.yml
Normal file
4
ansible/playbooks/vars/rabbitmq_staging.yml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
# This will need to be vaulted
|
||||
rabbitmq_admin_password: ThisIsNotThePassword!
|
||||
rabbitmq_cookie: "X4MYneML6Ppp+ajPuG/qdD64ZjdVT1OJF8XUG/o+"
|
Loading…
Reference in New Issue
Block a user