I have two minions with httpd server managed under saltstack. VirtualHost based on ports need to be configured for them separately. So /etc/httpd/conf.d/httpd-vhost.conf is watched like this:
httpd:
pkg.installed: []
service.running:
- require:
- pkg: httpd
- watch:
- file: /etc/httpd/conf.d/httpd-vhosts.conf
/etc/httpd/conf.d/httpd-vhosts.conf:
file.managed:
- source: salt://webserver/httpd-vhosts.conf
The problem is that the two minions have their own server name and httpd-vhost.conf should be different like ServerName www.example1.com and www.example2.com. Saltstack grains module just work for .sls file not managed file. So any advice to make it work?