open-contracting / deploy

Deployment configuration and scripts

Home Page:https://ocdsdeploy.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

include isn't working with Salt 3006

jpmckinney opened this issue · comments

{% 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.

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 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.

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).

Closed by 2048551