ceph-salt fails when yaml exceeds 1024 characters
- Dominant language
- Python
- Stars
- 36
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
Based on the character limitation described [here](https://github.com/saltstack/salt/issues/52323), adding new minions fails with a pillar render error if the number of minions exceeds the total number of 1024 characters.
```
2024-05-16 09:58:54,321 [salt.pillar :1266][CRITICAL][8409] Pillar render error: Rendering Primary Top file failed, render error:
mapping values are not allowed here; line 8
---
[...]
base:
ses7-host2.fqdn,ses7-host3.fqdn,ses7-host4.fqdn,ses7-host1.fqdn,ses7-host5.fqdn,ses7-host6.fqdn,ses7-host7.fqdn,ses7-host8.fqdn,ses7-host9.fqdn,ses7-host10.fqdn,ses7-host11.fqdn,ses7-host12.fqdn,ses7-host13.fqdn,ses7-host14.fqdn,ses7-host15.fqdn,ses7-host16.fqdn,ses7-host17.fqdn,ses7-host18.fqdn,ses7-host19.fqdn,ses7-host20.fqdn,ses7-host21.fqdn,ses7-host22.fqdn,ses7-host23.fqdn,ses7-host24.fqdn,ses7-host25.fqdn,ses7-host26.fqdn,ses7-host27.fqdn,ses7-host28.fqdn,ses7-host29.fqdn,ses7-host30.fqdn,ses7-host31.fqdn,ses7-host32.fqdn,ses7-host33.fqdn,ses7-host34.fqdn,ses7-host35.fqdn,ses7-host36.fqdn,ses7-host37.fqdn,ses7-host38.fqdn,ses7-host39.fqdn,ses7-host40.fqdn: <======================
- match: list
- ceph-salt
```
The [ceph-salt-top.sls](https://github.com/ceph/ceph-salt/blob/f0d86b1c677a7265064a5c9a3c76d37d7e975bdf/ceph_salt/salt_utils.py#L165) content is generated here:
```
class PillarManager:
CS_TOP_FILE = "ceph-salt-top.sls"
CS_TOP_INCLUDE = "{% include 'ceph-salt-top.sls' %}"
CS_TOP_CONTENT = """{% import_yaml "ceph-salt.sls" as ceph_salt %}
{% set ceph_salt_minions = ceph_salt.get('ceph-salt', {}).get('minions', {}).get('all', []) %}
{% if ceph_salt_minions %}
{{ ceph_salt_minions|join(',') }}:
- match: list
- ceph-salt
{% endif %}
```
This modification seems to work:
```
{% set ceph_salt_minions = ceph_salt.get('ceph-salt', {}).get('minions', {}).get('all', []) %}
{% if ceph_salt_minions %}
{% for minion in ceph_salt_minions %}
{{ minion }}:
- ceph-salt
{% endfor %}
{% endif %}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in ceph_salt/salt_utils.py at PillarManager.CS_TOP_CONTENT and reproduce the pillar render failure with a minion list exceeding 1024 characters. Compare the reported template with the proposed per-minion rendering, then verify that the generated ceph-salt-top.sls parses successfully and includes every minion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100