Comments (4)
Protip: Use 3 ` (backticks) around code to keep markdown from trying to interpret parts of it.
I agree. Feel free to submit a PR to change it.
You should be able to just do:
{% if salt['pillar.get']('postgres:use_upstream_repo') %}
...
{% endif %}
from postgres-formula.
Hello,
The lines mentioned in this ticket also cause errors in case no pillar data is set at all for "postgres". It should work out of the box with no additional configuration as stated in the documentation.
However, I get the following error:
[CRITICAL] Rendering SLS 'base:postgres' failed: Jinja error: argument of type 'NoneType' is not iterable
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 286, in render_jinja_tmpl
output = template.render(**unicode_context)
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 969, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File "<template>", line 3, in top-level template code
TypeError: argument of type 'NoneType' is not iterable
; line 3
---
{% from "postgres/map.jinja" import postgres with context %}
{% if 'use_upstream_repo' in pillar.get('postgres') %} <======================
install-postgresql-repo:
pkgrepo.managed:
- humanname: PostgreSQL Official Repository
- name: {{ postgres.pkg_repo }}
- keyid: B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
[...]
---
local:
Data failed to compile:
----------
Rendering SLS 'base:postgres' failed: Jinja error: argument of type 'NoneType' is not iterable
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 286, in render_jinja_tmpl
output = template.render(**unicode_context)
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 969, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File "<template>", line 3, in top-level template code
TypeError: argument of type 'NoneType' is not iterable
; line 3
---
{% from "postgres/map.jinja" import postgres with context %}
{% if 'use_upstream_repo' in pillar.get('postgres') %} <======================
install-postgresql-repo:
pkgrepo.managed:
- humanname: PostgreSQL Official Repository
- name: {{ postgres.pkg_repo }}
- keyid: B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
[...]
---
Which is seems to be fixed if I apply the change @iggy suggested. It is needed for the ID install_postgresql too though.
from postgres-formula.
agree with @rmoorman - #42 must be merged.
from postgres-formula.
Merged!
from postgres-formula.
Related Issues (20)
- Command "service postgresql initdb" run failing on /etc/init.d/postgresql
- jinja strip white spaces option in salt master config causes a broken pg_hba.conf HOT 2
- use_upstream_repo is unable to install the latest version of pg on Centos 7 HOT 4
- Unable to locate package on debian stretch HOT 16
- Package 'libpqxx' not found
- Initial postgresql.conf file not managed HOT 12
- osFamilyMap.yaml FreeBSD default user HOT 3
- Setting `postgres.port` does not work on `RedHat` OSes
- "LATIN1" does not match locale "en_US.UTF-8" HOT 8
- Does not work with Debian Buster HOT 1
- Uses initdb even when it's not needed
- state failures on archlinux HOT 1
- Tavis CI job failure for redhat
- freebsd: User 'pgsql' is not available
- [BUG] tablespace state failure on CENT8/RHEL8
- [BUG] nothing provides libicui18n.so.52.1()(64bit) for postgresql10 HOT 2
- [BUG] postgres.dev state fails on suse
- [FEATURE] replace module.run function when postgres.bake_image=True
- [BUG] Postgesql version install 14 instead of 13
- [BUG] postgresql-common conflicts with pgdg-keyring HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postgres-formula.