Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created May 8, 2017 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6e79b6c140fd55b4cf542d416e396d88 to your computer and use it in GitHub Desktop.
Save anonymous/6e79b6c140fd55b4cf542d416e396d88 to your computer and use it in GitHub Desktop.
THis is non production, testing enviroment.
I am testing "id" specific configs.. i need different config elements for different hosts.
The mechanics work, but the rendered configuration on the minion has a lot of emtpy lines.
The empty lines are the lines in the template that has the if else ifelse statements.
[root@salt salt]# less configs/vsftpd.conf
{% if grains['id'] == 'minion1.vosko.lab' %}
anonymous_enable=NO
{% else %}
anonymous_enable=YES
{% endif %}
vsftpd.sls:
vsftpd:
pkg.installed: []
service.running:
- require:
- pkg: vsftpd
/etc/vsftpd/vsftpd.conf:
file:
- managed
- source: salt://configs/vsftpd.conf
- template: jinja
- require:
- pkg: vsftpd
###
the mechanics work, its just a lot of empty lines in the rendered configuration file:
[root@minion1 ~]# cat /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
..... rest of configuration
Question, is there a method to remove those empty lines with the saltstack mechanics?
Or do i need to script seperately to have the empty lines removed?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment