Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,14 @@ cluster: ansible-prereqs
@mkdir -p $(ARTIFACT_DIR)/logs
@ansible-playbook ansible/provision-cluster.yml --private-key $(PRIVATE_KEY) --inventory $(ANSIBLE_INVENTORY) --extra-vars is_using_unstable=$(IS_USING_UNSTABLE)

# Logging configuration
REDPANDA_LOGGING_LOG_FILE ?= /var/log/redpanda2/redpanda.log

.PHONY: operation-configure-logging
operation-configure-logging: ansible-prereqs
@mkdir -p $(ARTIFACT_DIR)/logs
@ansible-playbook ansible/operation-configure-logging.yml --private-key $(PRIVATE_KEY) --inventory $(ANSIBLE_INVENTORY) --extra-vars is_using_unstable=$(IS_USING_UNSTABLE) --extra-vars redpanda_logging_log_file=$(REDPANDA_LOGGING_LOG_FILE)

TEST_TOPIC_NAME ?= testtopic
PARTITION_COUNT ?= 3
.PHONY: test-cluster
Expand Down
72 changes: 72 additions & 0 deletions ansible/operation-configure-logging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
- name: Configure Redpanda Logging
hosts: redpanda
become: true
vars:
rpk_bin: rpk

tasks:
- name: Check cluster health
ansible.builtin.shell: |
{{ rpk_bin }} cluster health | grep -i 'healthy:' | tr -d '[:space:]' | awk -F ':' '{print tolower($2)}'
register: health_check
run_once: true
failed_when: "health_check.stdout != 'true'"
changed_when: false

- name: Apply logging role

Check failure on line 17 in ansible/operation-configure-logging.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

role-name[path]

Avoid using paths when importing roles. (/Users/gene/GolandProjects/redpanda-ansible-collection/roles/redpanda_logging)
ansible.builtin.include_role:
name: /Users/gene/GolandProjects/redpanda-ansible-collection/roles/redpanda_logging
vars:
redpanda_logging_log_file: "{{ redpanda_logging_log_file | default('/var/log/redpanda.log') }}"

- name: Verify logging directory exists
ansible.builtin.stat:
path: "{{ redpanda_logging_log_file | default('/var/log/redpanda.log') | dirname }}"
register: log_dir_check
failed_when: not log_dir_check.stat.exists or not log_dir_check.stat.isdir

- name: Verify rsyslog configuration
ansible.builtin.stat:
path: "/etc/rsyslog.d/{{ redpanda_logging_rsyslog_priority | default('40') }}-redpanda.conf"
register: rsyslog_config_check
when: redpanda_logging_rsyslog_enabled | default(true)
failed_when: not rsyslog_config_check.stat.exists

- name: Verify logrotate configuration
ansible.builtin.stat:
path: /etc/logrotate.d/redpanda
register: logrotate_config_check
when: redpanda_logging_logrotate_enabled | default(true)
failed_when: not logrotate_config_check.stat.exists

- name: Test log rotation (dry run)
ansible.builtin.command: logrotate -d /etc/logrotate.d/redpanda
register: logrotate_test
when: redpanda_logging_logrotate_enabled | default(true)
changed_when: false

- name: Verify log file exists with correct permissions
ansible.builtin.stat:
path: "{{ redpanda_logging_log_file | default('/var/log/redpanda.log') }}"
register: log_file_check
failed_when: >
not log_file_check.stat.exists or
log_file_check.stat.pw_name != (redpanda_logging_owner | default('syslog')) or
log_file_check.stat.gr_name != (redpanda_logging_group | default('adm'))

- name: Check broker status
ansible.builtin.shell: |
{{ rpk_bin }} redpanda admin brokers list | grep -q 'active.*true'
register: broker_status
changed_when: false
failed_when: broker_status.rc != 0

- name: Display logging configuration summary
ansible.builtin.debug:
msg:
- "Redpanda logging configuration completed"
- "Log file: {{ redpanda_logging_log_file | default('/var/log/redpanda.log') }}"
- "Rsyslog: {{ 'enabled' if (redpanda_logging_rsyslog_enabled | default(true)) else 'disabled' }}"
- "Logrotate: {{ 'enabled' if (redpanda_logging_logrotate_enabled | default(true)) else 'disabled' }}"
run_once: true

Check failure on line 72 in ansible/operation-configure-logging.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

yaml[new-line-at-end-of-file]

No new line character at the end of file
4 changes: 2 additions & 2 deletions aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ variable "prometheus_instance_type" {
}

variable "availability_zone" {
default = ["us-west-2a"]
default = ["us-east-2a"]
type = list(string)
}

Expand Down Expand Up @@ -127,7 +127,7 @@ terraform {

variable "aws_region" {
type = string
default = "us-west-2"
default = "us-east-2"
}

provider "aws" {
Expand Down
5 changes: 3 additions & 2 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
collections:
- name: community.general
- name: redpanda.cluster
type: galaxy
- name: https://github.com/redpanda-data/redpanda-ansible-collection.git
type: git
version: console-config-changes
- name: ansible.posix
- name: grafana.grafana
version: 5.6.0
Expand Down
Loading