Skip to content

jinja strip white spaces option in salt master config causes a broken pg_hba.conf #241

@bebosudo

Description

@bebosudo

Hi,
I'm using this formula, along with the following lines in my salt master configuration:

jinja_env:
  trim_blocks: True
  lstrip_blocks: True

to strip empty lines in my salt states. This causes the following pg_hba.conf file:

          ID: postgresql-pg_hba
    Function: file.managed
        Name: /var/lib/pgsql/data/pg_hba.conf
      Result: True
     Comment: File /var/lib/pgsql/data/pg_hba.conf updated
     Started: 10:18:10.901757
    Duration: 6342.325 ms
     Changes:   
              ----------
              diff:
                  --- 
                  +++ 
                  @@ -18,6 +18,4 @@
                   # Database administrative login by Unix domain socket
                   local   all             postgres                                peer
                   
                  -# TYPE  DATABASE        USER            ADDRESS                 METHOD
                  -host    all             all             127.0.0.1/32            md5
                  -host    all             all             ::1/128                 md5
                  +# TYPE  DATABASE        USER            ADDRESS                 METHODhost    all             all             127.0.0.1/32            md5host    all             all             ::1/128                 md5

Which is caused by lines

{{ '{0:<7} {1:<15} {2:<15} {3:<23} {4}'.format(*acl) -}}
and L23.
Do you think a pull request to remove the line strip in jinja could be feasible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions