|
| 1 | +--- |
| 2 | +## |
| 3 | +## The following is an example inventory file for deploying Confluent Platform |
| 4 | +## using AWS Systems Manager (SSM) as the connection method with hostname aliasing enabled. |
| 5 | +## |
| 6 | +## For full SSM setup details, prerequisites, and configuration, see: |
| 7 | +## https://docs.confluent.io/ansible/7.9/ansible-prepare.html#manage-connections-to-cp-hosts |
| 8 | +## |
| 9 | +## When using SSM, ansible_host must contain the EC2 Instance ID for SSM to connect. |
| 10 | +## Since hostname_aliasing_enabled uses ansible_host as a fallback for resolving |
| 11 | +## the internal hostname, you must explicitly set the "hostname" variable on each host |
| 12 | +## to the actual network address (FQDN or IP) so that Confluent Platform components |
| 13 | +## can communicate with each other correctly. |
| 14 | +## |
| 15 | +## Resolution order when hostname_aliasing_enabled is true: |
| 16 | +## 1. hostname (host variable) |
| 17 | +## 2. ansible_host (fallback - but this is the Instance ID with SSM, so don't rely on it) |
| 18 | +## 3. inventory_hostname (final fallback) |
| 19 | +## |
| 20 | +## Usage: |
| 21 | +## ansible-playbook -i docs/sample_inventories/ssm/ssm_hostname_aliasing.yml confluent.platform.all |
| 22 | + |
| 23 | +all: |
| 24 | + vars: |
| 25 | + ## SSM Connection Settings |
| 26 | + ansible_connection: amazon.aws.aws_ssm |
| 27 | + ansible_aws_ssm_region: "us-east-2" |
| 28 | + ansible_aws_ssm_bucket_name: "cp-ansible-ssm-staging-bucket" |
| 29 | + ansible_become: true |
| 30 | + |
| 31 | + ## Enable hostname aliasing so that the "hostname" variable is used |
| 32 | + ## for internal CP component addressing instead of ansible_host (which holds the Instance ID). |
| 33 | + hostname_aliasing_enabled: true |
| 34 | + |
| 35 | +kafka_controller: |
| 36 | + hosts: |
| 37 | + kc1: |
| 38 | + ansible_host: i-0a1b2c3d4e5f60001 |
| 39 | + hostname: ip-172-31-10-101.us-east-2.compute.internal |
| 40 | + kc2: |
| 41 | + ansible_host: i-0a1b2c3d4e5f60002 |
| 42 | + hostname: ip-172-31-10-102.us-east-2.compute.internal |
| 43 | + kc3: |
| 44 | + ansible_host: i-0a1b2c3d4e5f60003 |
| 45 | + hostname: ip-172-31-10-103.us-east-2.compute.internal |
| 46 | + |
| 47 | +kafka_broker: |
| 48 | + hosts: |
| 49 | + kb1: |
| 50 | + ansible_host: i-0a1b2c3d4e5f60004 |
| 51 | + hostname: ip-172-31-10-104.us-east-2.compute.internal |
| 52 | + kb2: |
| 53 | + ansible_host: i-0a1b2c3d4e5f60005 |
| 54 | + hostname: ip-172-31-10-105.us-east-2.compute.internal |
| 55 | + kb3: |
| 56 | + ansible_host: i-0a1b2c3d4e5f60006 |
| 57 | + hostname: ip-172-31-10-106.us-east-2.compute.internal |
| 58 | + |
| 59 | +schema_registry: |
| 60 | + hosts: |
| 61 | + sr1: |
| 62 | + ansible_host: i-0a1b2c3d4e5f60007 |
| 63 | + hostname: ip-172-31-10-107.us-east-2.compute.internal |
| 64 | + |
| 65 | +kafka_connect: |
| 66 | + hosts: |
| 67 | + kc-connect1: |
| 68 | + ansible_host: i-0a1b2c3d4e5f60008 |
| 69 | + hostname: ip-172-31-10-108.us-east-2.compute.internal |
| 70 | + |
| 71 | +kafka_rest: |
| 72 | + hosts: |
| 73 | + kr1: |
| 74 | + ansible_host: i-0a1b2c3d4e5f60009 |
| 75 | + hostname: ip-172-31-10-109.us-east-2.compute.internal |
| 76 | + |
| 77 | +ksql: |
| 78 | + hosts: |
| 79 | + ksql1: |
| 80 | + ansible_host: i-0a1b2c3d4e5f60010 |
| 81 | + hostname: ip-172-31-10-110.us-east-2.compute.internal |
| 82 | + |
| 83 | +control_center_next_gen: |
| 84 | + hosts: |
| 85 | + c3ng1: |
| 86 | + ansible_host: i-0a1b2c3d4e5f60011 |
| 87 | + hostname: ip-172-31-10-111.us-east-2.compute.internal |
0 commit comments