|
| 1 | +# Barbican Proteccio Adoption Role |
| 2 | + |
| 3 | +Ansible role for adopting Barbican service from OpenStack 17.1 to RHOSO 18 with Proteccio HSM integration. |
| 4 | + |
| 5 | +## 🔗 **Relationship to Existing Barbican Adoption Role** |
| 6 | + |
| 7 | +This repository contains **two distinct Barbican adoption roles**: |
| 8 | + |
| 9 | +### 1. `barbican_adoption` (Standard) |
| 10 | +- **Purpose**: Standard Barbican adoption without HSM |
| 11 | +- **Backend**: Uses `simple_crypto` plugin only |
| 12 | +- **Use Case**: Standard OpenStack deployments |
| 13 | +- **Process**: Simple configuration adoption and service deployment |
| 14 | + |
| 15 | +### 2. `barbican_proteccio_adoption` (HSM-Enabled) - **This Role** |
| 16 | +- **Purpose**: Barbican adoption with Proteccio HSM integration |
| 17 | +- **Backend**: Supports both `simple_crypto` and `pkcs11` (HSM) plugins |
| 18 | +- **Use Case**: High-security environments requiring HSM |
| 19 | +- **Process**: Complex multi-phase adoption with HSM configuration |
| 20 | + |
| 21 | +**WARNING: Important**: These roles are **mutually exclusive**. Choose the appropriate role based on your source environment: |
| 22 | +- If your TripleO 17.1 has **standard Barbican** → use `barbican_adoption` |
| 23 | +- If your TripleO 17.1 has **Proteccio HSM integration** → use `barbican_proteccio_adoption` |
| 24 | + |
| 25 | +## WARNING: **IMPORTANT: Customization Required** |
| 26 | + |
| 27 | +**This role contains placeholder values that MUST be customized for your environment before use.** |
| 28 | + |
| 29 | +### Required Customization Steps: |
| 30 | + |
| 31 | +1. **Copy and customize the sample variables:** |
| 32 | + ```bash |
| 33 | + cp vars/sample_environment.yml vars/my_environment.yml |
| 34 | + # Edit vars/my_environment.yml with your values |
| 35 | + ``` |
| 36 | + |
| 37 | +2. **Generate your own KEK key:** |
| 38 | + ```bash |
| 39 | + openssl rand -base64 32 |
| 40 | + ``` |
| 41 | + |
| 42 | +3. **Update the following in `vars/my_environment.yml`:** |
| 43 | + - `source_undercloud_host`: Your actual undercloud hostname |
| 44 | + - `source_controller_host`: Your actual controller hostname |
| 45 | + - `barbican_simple_crypto_kek`: Your generated 32-byte base64 key |
| 46 | + - `hsm_login_password`: Your HSM login password |
| 47 | + - `hsm_token_labels`: Your HSM token label |
| 48 | + - `proteccio_required_files`: List your actual certificate filenames |
| 49 | + - `work_dir` and `proteccio_files_dir`: Your actual directory paths |
| 50 | + |
| 51 | +4. **Use your custom variables:** |
| 52 | + ```bash |
| 53 | + ansible-playbook -i inventory.proteccio.yaml -e @vars/my_environment.yml playbooks/barbican_proteccio_adoption.yml |
| 54 | + ``` |
| 55 | + |
| 56 | +## Key Features |
| 57 | + |
| 58 | +- **Automatic RabbitMQ user management** to prevent service authentication failures |
| 59 | +- **Graceful HSM role dependency handling** with fallback mechanisms |
| 60 | +- **Database adoption with backup and verification** capabilities |
| 61 | +- **Custom Proteccio image deployment** and HSM configuration management |
| 62 | +- **Comprehensive relationship with standard adoption** - clearly separated workflows |
| 63 | + |
| 64 | +## Documentation |
| 65 | + |
| 66 | +For complete documentation, see the official adoption guide: |
| 67 | + |
| 68 | +- **Procedure**: `docs_user/modules/proc_adopting-key-manager-service-with-proteccio-hsm.adoc` |
| 69 | +- **Concept**: `docs_user/modules/con_key-manager-service-adoption-approaches.adoc` |
| 70 | +- **Troubleshooting**: `docs_user/modules/ref_troubleshooting-key-manager-proteccio-adoption.adoc` |
| 71 | + |
| 72 | +## Quick Start |
| 73 | + |
| 74 | +**WARNING: DO NOT run without customization - it will fail with placeholder values!** |
| 75 | + |
| 76 | +### **Recommended Approach: Use the Adoption Script** |
| 77 | + |
| 78 | +```bash |
| 79 | +# 1. Navigate to the tests directory |
| 80 | +cd /path/to/your/dp-adopt/tests |
| 81 | + |
| 82 | +# 2. Configure script environment |
| 83 | +cp config.env.sample config.env |
| 84 | +vim config.env # Update paths for your environment |
| 85 | + |
| 86 | +# 3. Customize role variables |
| 87 | +cp roles/barbican_proteccio_adoption/vars/sample_environment.yml \ |
| 88 | + roles/barbican_proteccio_adoption/vars/my_environment.yml |
| 89 | +vim roles/barbican_proteccio_adoption/vars/my_environment.yml # Update with your values |
| 90 | + |
| 91 | +# 4. Execute the adoption |
| 92 | +./run_proteccio_adoption.sh |
| 93 | +``` |
| 94 | + |
| 95 | +### **Alternative: Direct Ansible Execution (Advanced Users)** |
| 96 | + |
| 97 | +```bash |
| 98 | +# For advanced users or troubleshooting specific phases |
| 99 | +ansible-playbook -i inventory.proteccio.yaml \ |
| 100 | + -e @roles/barbican_proteccio_adoption/vars/my_environment.yml \ |
| 101 | + playbooks/barbican_proteccio_adoption.yml |
| 102 | +``` |
| 103 | + |
| 104 | +## Dependencies |
| 105 | + |
| 106 | +### **MANDATORY Requirements** |
| 107 | + |
| 108 | +- **`ansible-role-rhoso-proteccio-hsm` role**: **REQUIRED** - This role is absolutely mandatory for Proteccio HSM adoption. It MUST be executed either: |
| 109 | + - As part of this adoption process (automatic execution), OR |
| 110 | + - Before running this adoption process (manual execution) |
| 111 | + - **WITHOUT THIS ROLE, THE ADOPTION WILL FAIL** |
| 112 | + |
| 113 | +- **Proteccio client files**: All certificate and key files must be present in the specified directory |
| 114 | +- **OpenStack 17.1 source environment** with **Proteccio HSM integration** already configured |
| 115 | +- **RHOSO 18 target cluster** with administrative access |
| 116 | +- **Kubernetes/OpenShift CLI access** with appropriate permissions |
| 117 | + |
| 118 | +### **Critical HSM Role Information** |
| 119 | + |
| 120 | +The `ansible-role-rhoso-proteccio-hsm` role is responsible for: |
| 121 | +- Creating essential Kubernetes secrets (`hsm-login`, `proteccio-data`) |
| 122 | +- Mounting Proteccio certificate files in the target environment |
| 123 | +- Configuring HSM authentication for Barbican services |
| 124 | + |
| 125 | +**This role is NOT optional**. If you attempt to run the adoption without it: |
| 126 | +- The adoption process will fail with clear error messages |
| 127 | +- Barbican services will not be able to access the HSM |
| 128 | +- Your existing HSM-protected secrets will become inaccessible |
| 129 | + |
| 130 | +## Troubleshooting |
| 131 | + |
| 132 | +If Barbican services show CrashLoopBackOff after deployment, the role automatically: |
| 133 | +1. Extracts RabbitMQ credentials from transport URLs |
| 134 | +2. Creates missing RabbitMQ users |
| 135 | +3. Sets appropriate permissions |
| 136 | +4. The services should recover automatically |
| 137 | + |
| 138 | +## Security Note |
| 139 | + |
| 140 | +**Never commit files containing real credentials, passwords, or certificate data to version control.** |
0 commit comments