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

include isn't working with Salt 3006 #432

Closed
jpmckinney opened this issue May 27, 2023 · 3 comments
Closed

include isn't working with Salt 3006 #432

jpmckinney opened this issue May 27, 2023 · 3 comments
Labels
S: cove Relating to the Data Review Tool servers

Comments

@jpmckinney
Copy link
Member

{% include 'apache/includes/' + name + '.include.jinja' ignore missing %}

We have:

  extra_filerefs:
    - $REPO_DIR/salt/apache/includes/cove.include.jinja

But ErrorDocument 500 isn't getting written.

@jpmckinney jpmckinney added the S: cove Relating to the Data Review Tool servers label May 27, 2023
@jpmckinney jpmckinney changed the title include in django.conf.include isn't working with Salt 3006 include isn't working with Salt 3006 Jun 1, 2023
@jpmckinney
Copy link
Member Author

jpmckinney commented Jun 1, 2023

The same is happening for me with {% include 'postgres/files/conf/shared.include' %}

I tried:

  • passing --extra-filerefs both with absolute and salt:// paths
  • using absolute path in include
  • changing to extends, adding a block in shared.include and using that block in the conf files
  • using absolute path in extends
  • Removing extra_filerefs from Saltfile and repeating some of the above
  • {% import_text 'postgres/files/conf/shared.include' as shared %} {{ shared }} from improve salt file.managed with multiple sources saltstack/salt#7532 (comment)

file.managed doesn't have a sources option like file.append in order to create a target file from many source files. file.accumulated doesn't have a source option. We can't use file.prepend or file.append, because the old file content won't be removed.

Although we can add shared.include as a separate file (e.g. looping over configurations, and using loop.index0 to prefix the files), this makes changes harder to deploy, since re-ordering or removing a configuration will rename the new files, but not remove the old files. Instead, a developer needs to include it in the configuration file.

Nothing seems to work.

@jpmckinney
Copy link
Member Author

Another option is to use shared.include as the template, and then provide the custom settings (max_wal_size, etc.) as Pillar data. (Basically, reverse the direction of the inclusion.)

I'll do this because Salt seems incapable of keeping extra-filerefs working across versions (not the first time it breaks).

@jpmckinney
Copy link
Member Author

Closed by 2048551

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: cove Relating to the Data Review Tool servers
Projects
None yet
Development

No branches or pull requests

1 participant