Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ceph-salt fails when yaml exceeds 1024 characters #490

Open
ebl-nde opened this issue May 16, 2024 · 0 comments
Open

ceph-salt fails when yaml exceeds 1024 characters #490

ebl-nde opened this issue May 16, 2024 · 0 comments

Comments

@ebl-nde
Copy link

ebl-nde commented May 16, 2024

Based on the character limitation described here, 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 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 %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant