Skip to content

Commit 08986c5

Browse files
committed
avoid create credentials related to empty groups
Was confluentinc#1513
1 parent 6884638 commit 08986c5

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

roles/variables/defaults/main.yml

+18-18
Original file line numberDiff line numberDiff line change
@@ -1264,27 +1264,27 @@ _sasl_scram_users: "{
12641264
'client': {
12651265
'principal': 'client',
12661266
'password': 'client-secret'
1267-
}{% if 'schema_registry' in groups %},
1267+
}{% if 'schema_registry' in groups and groups['schema_registry']|length > 0 %},
12681268
'schema_registry': {
12691269
'principal': 'schema_registry',
12701270
'password': 'schema_registry-secret'
1271-
}{% endif %}{% if 'kafka_connect' in groups %},
1271+
}{% endif %}{% if 'kafka_connect' in groups and groups['kafka_connect']|length > 0 %},
12721272
'kafka_connect': {
12731273
'principal': 'kafka_connect',
12741274
'password': 'kafka_connect-secret'
1275-
}{% endif %}{% if 'kafka_rest' in groups %},
1275+
}{% endif %}{% if 'kafka_rest' in groups and groups['kafka_rest']|length > 0 %},
12761276
'kafka_rest': {
12771277
'principal': 'kafka_rest',
12781278
'password': 'kafka_rest-secret'
1279-
}{% endif %}{% if 'ksql' in groups %},
1279+
}{% endif %}{% if 'ksql' in groups and groups['ksql']|length > 0 %},
12801280
'ksql': {
12811281
'principal': 'ksql',
12821282
'password': 'ksql-secret'
1283-
}{% endif %}{% if 'control_center' in groups %},
1283+
}{% endif %}{% if 'control_center' in groups and groups['control_center']|length > 0 %},
12841284
'control_center': {
12851285
'principal': 'control_center',
12861286
'password': 'control_center-secret'
1287-
}{% endif %}{% if 'kafka_connect_replicator' in groups %},
1287+
}{% endif %}{% if 'kafka_connect_replicator' in groups and groups['kafka_connect_replicator']|length > 0 %},
12881288
'kafka_connect_replicator': {
12891289
'principal': 'kafka_connect_replicator',
12901290
'password': 'kafka_connect_replicator-secret'
@@ -1305,27 +1305,27 @@ _sasl_scram256_users: "{
13051305
'client': {
13061306
'principal': 'client',
13071307
'password': 'client-secret'
1308-
}{% if 'schema_registry' in groups %},
1308+
}{% if 'schema_registry' in groups and groups['schema_registry']|length > 0 %},
13091309
'schema_registry': {
13101310
'principal': 'schema_registry',
13111311
'password': 'schema_registry-secret'
1312-
}{% endif %}{% if 'kafka_connect' in groups %},
1312+
}{% endif %}{% if 'kafka_connect' in groups and groups['kafka_connect']|length > 0 %},
13131313
'kafka_connect': {
13141314
'principal': 'kafka_connect',
13151315
'password': 'kafka_connect-secret'
1316-
}{% endif %}{% if 'kafka_rest' in groups %},
1316+
}{% endif %}{% if 'kafka_rest' in groups and groups['kafka_rest']|length > 0 %},
13171317
'kafka_rest': {
13181318
'principal': 'kafka_rest',
13191319
'password': 'kafka_rest-secret'
1320-
}{% endif %}{% if 'ksql' in groups %},
1320+
}{% endif %}{% if 'ksql' in groups and groups['ksql']|length > 0 %},
13211321
'ksql': {
13221322
'principal': 'ksql',
13231323
'password': 'ksql-secret'
1324-
}{% endif %}{% if 'control_center' in groups %},
1324+
}{% endif %}{% if 'control_center' in groups and groups['control_center']|length > 0 %},
13251325
'control_center': {
13261326
'principal': 'control_center',
13271327
'password': 'control_center-secret'
1328-
}{% endif %}{% if 'kafka_connect_replicator' in groups %},
1328+
}{% endif %}{% if 'kafka_connect_replicator' in groups and groups['kafka_connect_replicator']|length > 0 %},
13291329
'kafka_connect_replicator': {
13301330
'principal': 'kafka_connect_replicator',
13311331
'password': 'kafka_connect_replicator-secret'
@@ -1346,27 +1346,27 @@ _sasl_plain_users: "{
13461346
'client': {
13471347
'principal': 'client',
13481348
'password': 'client-secret'
1349-
}{% if 'schema_registry' in groups %},
1349+
}{% if 'schema_registry' in groups and groups['schema_registry']|length > 0 %},
13501350
'schema_registry': {
13511351
'principal': '{% if ccloud_kafka_enabled|bool %}{{ccloud_kafka_key}}{% else %}schema_registry{% endif %}',
13521352
'password': '{% if ccloud_kafka_enabled|bool %}{{ccloud_kafka_secret}}{% else %}schema_registry-secret{% endif %}'
1353-
}{% endif %}{% if 'kafka_connect' in groups %},
1353+
}{% endif %}{% if 'kafka_connect' in groups and groups['kafka_connect']|length > 0 %},
13541354
'kafka_connect': {
13551355
'principal': '{% if ccloud_kafka_enabled|bool %}{{ccloud_kafka_key}}{% else %}kafka_connect{% endif %}',
13561356
'password': '{% if ccloud_kafka_enabled|bool %}{{ccloud_kafka_secret}}{% else %}kafka_connect-secret{% endif %}'
1357-
}{% endif %}{% if 'kafka_rest' in groups %},
1357+
}{% endif %}{% if 'kafka_rest' in groups and groups['kafka_rest']|length > 0 %},
13581358
'kafka_rest': {
13591359
'principal': '{% if ccloud_kafka_enabled|bool %}{{ccloud_kafka_key}}{% else %}kafka_rest{% endif %}',
13601360
'password': '{% if ccloud_kafka_enabled|bool %}{{ccloud_kafka_secret}}{% else %}kafka_rest-secret{% endif %}'
1361-
}{% endif %}{% if 'ksql' in groups %},
1361+
}{% endif %}{% if 'ksql' in groups and groups['ksql']|length > 0 %},
13621362
'ksql': {
13631363
'principal': '{% if ccloud_kafka_enabled|bool %}{{ccloud_kafka_key}}{% else %}ksql{% endif %}',
13641364
'password': '{% if ccloud_kafka_enabled|bool %}{{ccloud_kafka_secret}}{% else %}ksql-secret{% endif %}'
1365-
}{% endif %}{% if 'control_center' in groups %},
1365+
}{% endif %}{% if 'control_center' in groups and groups['control_center']|length > 0 %},
13661366
'control_center': {
13671367
'principal': '{% if ccloud_kafka_enabled|bool %}{{ccloud_kafka_key}}{% else %}control_center{% endif %}',
13681368
'password': '{% if ccloud_kafka_enabled|bool %}{{ccloud_kafka_secret}}{% else %}control_center-secret{% endif %}'
1369-
}{% endif %}{% if 'kafka_connect_replicator' in groups %},
1369+
}{% endif %}{% if 'kafka_connect_replicator' in groups and groups['kafka_connect_replicator']|length > 0 %},
13701370
'kafka_connect_replicator': {
13711371
'principal': 'kafka_connect_replicator',
13721372
'password': 'kafka_connect_replicator-secret'

0 commit comments

Comments
 (0)