Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
55a3f58
Add force-new-cluster helper
fonta-rh Oct 24, 2025
f3d987c
Initial docs for claude etcd slash command
fonta-rh Oct 27, 2025
c90a60a
Initial project file
fonta-rh Oct 27, 2025
5c6cdb7
Add access validation playbook
fonta-rh Oct 28, 2025
a543d7f
Swap from slash command to skill
fonta-rh Oct 28, 2025
3b8e3e1
Add diagnosis tools
fonta-rh Oct 28, 2025
8aaac76
Update READMEs
fonta-rh Oct 28, 2025
56576ee
Update gitignore to ignore create rpm files
fonta-rh Oct 28, 2025
24af791
Update to add small blurb to README
fonta-rh Oct 29, 2025
17f1f6b
Remove gitsubmodule
fonta-rh Oct 29, 2025
2a8ed48
Update podman-etcd filename to avoid shell check
fonta-rh Oct 29, 2025
0552c1d
Add quick reference
fonta-rh Nov 3, 2025
27b45cd
Make cluster access optional
fonta-rh Nov 4, 2025
f94e559
Update to make sure only cluster_vms are targeted with pcs commands
fonta-rh Nov 4, 2025
a9c80e4
Update files to use the right host group
fonta-rh Nov 4, 2025
abc9230
Update references to force-new-cluster playbook and other automated t…
fonta-rh Nov 4, 2025
cdbd2d9
Update force-new-cluster helper
fonta-rh Nov 5, 2025
4733524
Add log location
fonta-rh Nov 7, 2025
5c3205d
Update force new cluster playbook
fonta-rh Nov 17, 2025
4657a89
Move etcd scripts and playbooks to helpers/etcd/
fonta-rh Jan 7, 2026
531c756
Document diagnostic approach options in troubleshooting skill
fonta-rh Jan 8, 2026
f09ccdd
Fetch podman-etcd resource agent from upstream on demand
fonta-rh Jan 8, 2026
104b801
Collect all podman logs instead of last 100 lines
fonta-rh Jan 8, 2026
654715c
Auto-detect etcd leader in force-new-cluster playbook
fonta-rh Jan 8, 2026
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
212 changes: 212 additions & 0 deletions .claude/commands/etcd/PERMISSIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
# Etcd Troubleshooting Skill - Permission Configuration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is awesome! Does it always work, or the agent is picky? 😁
I need something similar in my environment


This document defines the permission grants for the etcd troubleshooting skill to enable faster diagnostics without requiring user approval for read-only operations.

## Permission Philosophy

**Automatic (No User Approval Required):**
- Read-only operations on diagnostic data
- File reading from diagnostic output directories
- Basic Ansible fact gathering (no changes)
- OpenShift cluster status queries (read-only)

**Requires User Approval:**
- Any operation that modifies cluster state
- Running Ansible playbooks (except validation)
- Executing remediation scripts
- Pacemaker resource operations (cleanup, restart, etc.)

## Granted Permissions

### Bash Tool - Read-Only Commands

The following Bash commands are automatically approved for execution without user permission:

```
# File reading operations
Bash(cat:*) # Read any file
Bash(head:*) # Read beginning of files
Bash(tail:*) # Read end of files
Bash(less:*) # Page through files

# File searching and filtering
Bash(grep:*) # Search file contents
Bash(find:*) # Find files
Bash(ls:*) # List directory contents

# Diagnostic data inspection
Bash(jq:*) # Parse JSON output
Bash(yq:*) # Parse YAML output

# Git read-only operations
Bash(git log:*) # View git history
Bash(git status:*) # Check git status
Bash(git diff:*) # View differences

# Ansible read-only operations
Bash(ansible cluster_vms -i * -m ping) # Test connectivity
Bash(ansible cluster_vms -i * -m setup) # Gather facts
Bash(ansible *_master_* -i * -m shell -a "cat *") # Read files via Ansible
Bash(ansible *_master_* -i * -m shell -a "grep *") # Search files via Ansible
Bash(ansible *_master_* -i * -m shell -a "tail *") # Read file ends via Ansible
Bash(ansible *_master_* -i * -m shell -a "pcs status*") # Read Pacemaker status
Bash(ansible *_master_* -i * -m shell -a "pcs resource status*") # Read resource status
Bash(ansible *_master_* -i * -m shell -a "podman ps*") # List containers
Bash(ansible *_master_* -i * -m shell -a "podman exec etcd etcdctl member list*") # Read member list
Bash(ansible *_master_* -i * -m shell -a "podman exec etcd etcdctl endpoint health*") # Check health
Bash(ansible *_master_* -i * -m shell -a "podman exec etcd etcdctl endpoint status*") # Check status
Bash(ansible *_master_* -i * -m shell -a "crm_attribute --query*") # Query CIB attributes
Bash(ansible *_master_* -i * -m shell -a "journalctl*") # Read system logs
Bash(ansible *_master_* -i * -m shell -a "systemctl status*") # Check service status

# OpenShift read-only operations (via oc-wrapper or with proxy sourcing)
Bash(source deploy/openshift-clusters/proxy.env && oc get*) # Read cluster resources
Bash(source deploy/openshift-clusters/proxy.env && oc describe*) # Describe resources
Bash(source deploy/openshift-clusters/proxy.env && oc logs*) # Read pod logs
Bash(*oc-wrapper.sh get*) # Get resources via wrapper
Bash(*oc-wrapper.sh describe*) # Describe resources via wrapper
Bash(*oc-wrapper.sh logs*) # Read logs via wrapper
```

### Read Tool - Diagnostic Directories

The following paths are automatically approved for reading:

```
Read(/tmp/etcd-diagnostics-*/*) # All diagnostic collection outputs
Read(/tmp/ansible-validation.log) # Ansible validation output
Read(deploy/openshift-clusters/inventory.ini) # Inventory file (read-only)
Read(deploy/openshift-clusters/proxy.env) # Proxy configuration (read-only)
Read(.claude/commands/etcd/**) # Skill documentation
```

### Validation Scripts (Read-Only)

These scripts only validate access and don't modify state:

```
Bash(helpers/etcd/validate-cluster-access.sh)
```

## Operations Requiring User Approval

The following operations will always prompt for user approval:

### Ansible Playbooks

```
ansible-playbook */collect-diagnostics.yml # Requires approval (executes many commands)
ansible-playbook */validate-access.yml # Requires approval
ansible-playbook helpers/force-new-cluster.yml # ALWAYS requires approval (destructive)
ansible-playbook * # Any other playbook
```

### Orchestration Scripts

```
helpers/etcd/collect-all-diagnostics.sh # Requires approval (runs playbook)
```

### Pacemaker Operations (Write)

```
ansible * -m shell -a "pcs resource cleanup*" # Requires approval (clears failures)
ansible * -m shell -a "pcs resource restart*" # Requires approval (restarts resources)
ansible * -m shell -a "pcs resource disable*" # Requires approval (disables resources)
ansible * -m shell -a "pcs resource enable*" # Requires approval (enables resources)
ansible * -m shell -a "pcs property set*" # Requires approval (changes config)
ansible * -m shell -a "crm_attribute --delete*" # Requires approval (modifies CIB)
ansible * -m shell -a "crm_attribute --update*" # Requires approval (modifies CIB)
```

### Etcd Operations (Write)

```
ansible * -m shell -a "podman exec etcd etcdctl member remove*" # Requires approval
ansible * -m shell -a "podman exec etcd etcdctl member add*" # Requires approval
ansible * -m shell -a "podman exec etcd etcdctl put*" # Requires approval
ansible * -m shell -a "podman exec etcd etcdctl del*" # Requires approval
```

### System Operations

```
ansible * -m shell -a "systemctl restart*" # Requires approval
ansible * -m shell -a "systemctl stop*" # Requires approval
ansible * -m shell -a "systemctl start*" # Requires approval
ansible * -m shell -a "reboot*" # Requires approval
```

## Usage in Claude Code

To apply these permissions, they need to be added to the Claude Code system configuration. This is typically done in one of two ways:

1. **Project-level**: In `.claude/settings.json` or project configuration
2. **User-level**: In global Claude Code settings

### Example Configuration Format

```json
{
"autoApprove": {
"bash": [
"cat:*",
"tail:*",
"head:*",
"grep:*",
"ls:*",
"git status:*",
"git log:*",
"ansible cluster_vms -i * -m ping",
"source deploy/openshift-clusters/proxy.env && oc get*"
],
"read": [
"/tmp/etcd-diagnostics-*/**",
"/tmp/ansible-validation.log",
"deploy/openshift-clusters/inventory.ini",
"deploy/openshift-clusters/proxy.env",
".claude/commands/etcd/**"
]
}
}
```

## Safety Considerations

### Why These Permissions Are Safe

**Read-only Bash commands:**
- Cannot modify cluster state
- Cannot delete data
- Cannot change configurations
- Only inspect and report

**Read tool permissions:**
- Limited to diagnostic output and documentation
- No write access to sensitive files
- Inventory and proxy.env are read-only copies

**Validation scripts:**
- Only test connectivity
- Don't execute remediation actions
- Safe to run repeatedly

### What Remains Protected

**Anything that changes state:**
- Resource operations (cleanup, restart, etc.)
- CIB attribute modifications
- Playbook executions
- Service restarts
- Member additions/removals

This ensures the skill can quickly gather and analyze diagnostic information while still requiring explicit user approval for any corrective actions.

## Updating Permissions

As the skill evolves, this document should be updated to reflect:
1. New safe read-only operations that can be auto-approved
2. New operations that require user approval
3. Any changes to the permission boundaries

When in doubt, default to requiring user approval - it's better to ask permission than to execute an unexpected operation.
Loading