Comments (15)
Hi, sorry for the slow reply.
I believe that error is complaining about the {{UNQIUE}}
Jinja variable on line 57 of that example file. If you're not using the debian_full
state you don't need that pillar entry at all and can remove it. If you are using it, you have to replace that with a unique value of your choosing.
We're working on some documentation formatting for formula that will hopefully make things like this a bit more clear. Stay tuned...
from apache-formula.
I am receiving a similar error- although it appears to be unrelated to the {{UNQIUE}} variable. My error is as follows:
web01:
Data failed to compile:
----------
Pillar failed to render with the following messages:
----------
Rendering SLS 'apache' failed, render error:
Undefined jinja variable; line 37 in template
The above is the pillar.example file (renamed to init.sls).
I have added the following line to /etc/salt/pillar/top.sls:
- apache
I have added the following line to /etc/salt/salt/top.sls:
- apache.vhost.standard
from apache-formula.
I started to write a small formula for httpd, vhost management will be possible soon.
Take a look at https://github.com/bechtoldt/httpd-formula when you're interested.
from apache-formula.
This formula doesn't work out of the box. I get the same errors reported on the previous comments and:
local:
Data failed to compile:
Pillar failed to render with the following messages:
Rendering SLS 'apache' failed, render error:
Jinja variable 'id' is undefined; line 40
[...]
CustomLog: {{ logdir }}/{{ id }}-access.log # E.g.: /var/log/apache2/example.com-access.log
DocumentRoot: {{ wwwdir }}/{{ id }} # E.g., /var/www/example.com
Directory:
default: # "default" is a special case; Adds ``{{ wwwdir }}/{{ id }}`` e.g.: /var/www/example.com <======================
Options: -Indexes FollowSymLinks
Order: allow,deny
Allow: from all
AllowOverride: None
Formula_Append: |
[...]
from apache-formula.
Sorry that file isn't more clear -- that needs to be cleaned up. Short explanation: the pillar.example
file isn't meant to be a drop-in but rather serve as an example. In most places the values in {{ }}
markers are the defaults used if you don't specify that value in your Pillar (pulling those defaults from the map file) -- the exception to that is the id
of the vhost.
from apache-formula.
Rephrased: you need to specify the vhost id
in your Pillar (e.g.: example.com). Everything else is optional.
from apache-formula.
Thanks @whiteinge I'll try again tomorrow, but I'm pretty sure I tried to add a key/value id : example.com
from apache-formula.
@whiteinge are you sure this should work ? http://pastie.org/private/un1vped84pfzywe4p4tig
local:
Data failed to compile:
Pillar failed to render with the following messages:
Rendering SLS 'apache' failed, render error:
Jinja variable 'id' is undefined; line 54
from apache-formula.
@heldrida there is no {{ id }}
variable used or defined in your paste. There must be one somewhere else in your Pillar files which is causing the error.
You are right that is the minimum configuration for the state to run. You don't need the id: example.com
line. It won't hurt anything; it'll just be ignored. What I meant by id
is that the top-level example.com: key in that dictionary is used as the ID declaration of the Salt state.
from apache-formula.
I'm running into the exact same issue as others are experiencing.
Pillar failed to render with the following messages:
----------
Rendering SLS 'apache' failed, render error:
Jinja variable 'id' is undefined; line 32
Now, line 32 does not even contain {{ id }}, but it's not the first time the line number being reported is wrong when dealing with jinja. However I'm confused as per the example pillar, the id should be correct
apache:
sites:
testsite.com:
template_file: salt://apache/vhosts/standard.tmpl
template_engine: jinja
interface: '*'
port: '80'
ServerAdmin: webmaster@{{ id }}
LogLevel: warn
ErrorLog: {{ logdir }}/{{ id }}-error.log
CustomLog: {{ logdir }}/{{ id }}-access.log
DocumentRoot: {{ wwwdir }}/
...
DocumentRoot being line 32 in this case.
I did try to explicitly set id as well, but hat did nothing.
salt v.2014.1.4
from apache-formula.
@TJuberg I don't remember how I fixed this and it's been awhile since I used Salt. But what I did was using a different formula or created my own. I tried this one quite a lot without success and lost quite a lot of time.
from apache-formula.
@heldrida Thank you. I'll abandon this for now and explore other avenues.
from apache-formula.
I pushed an update to the example Pillar value that spells out that the values there are intended as examples and not drop-in values. I also replaced the Jinja placeholders with more obvious placeholder text. I tested the formula as well with the minimal Pillar configuration and everything is working as expected.
If anyone is still encountering trouble using this, please reply and include your current Pillar configuration.
from apache-formula.
Well, that explains a lot.
It does not matter if the "values" used are intended as examples when the examples along with their explanation indicate that they are automatically taken from what is explained as passing example.com as {{ id }}.
For those of us that do not know salt very well, had no way of telling that {{ id }} and {{ wwwdir }} had to be replaced as it was presented as something replaced automatically with the value specified as the id when rendering the pillar.
Was very confusing to say the least.
Thanks for fixing this.
from apache-formula.
@whiteinge thanks for fixing it!
from apache-formula.
Related Issues (20)
- Default log formats doesn't use IP from mod remoteip in debian
- [BUG] apache.vhost.cleanup fails if apache is not yet installed HOT 2
- [FEATURE] support mod_md
- In Debian apache.config plays two opposite actions HOT 1
- A recursive requisite was found in apache.config.modules.mod_security
- [BUG] use of tpldir variable does not allow the formula to be wrapped HOT 12
- [BUG] apache.vhosts.standard (and potentially others) generate MemoryError HOT 9
- [BUG] apache.config.vhosts.standard: mapping error when "enabled: false" HOT 3
- yaml syntax error in mod_pagespeed.sls HOT 1
- [BUG] syntax error near "module;" in apache/config/register_site.sls line 66 HOT 1
- [BUG] apache.config.modules.mod_wsgi fails, pkg: apache not found HOT 2
- [BUG] On CentOS 7, enabled modules are reported as changed on every highstate HOT 1
- [BUG] apache.config.vhosts.cleanup now remove the service HOT 3
- [BUG] in vhosts/standard.sls the map.pop affects the apache variable as well because it is a reference, not a copy HOT 3
- [BUG] ssl.conf should never be removed - should always be managed
- [BUG] vhost proxy.tmpl doesn' add DocumentRoot
- [BUG] ID apache-service-running in SLS apache.service.running is not a dictionary
- [FEATURE] Add SSLCACertificate
- [FEATURE] handle multiple CustomLog directives
- [BUG] apache.clean removed too much files, breaking installation after reinstall
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 apache-formula.