[systemd-devel] Query regarding "EnvironmentFile"

Manuel Amador (Rudd-O) rudd-o at rudd-o.com
Sat Dec 26 11:00:22 PST 2015


On 12/11/2015 02:59 PM, Reindl Harald wrote:
> and that's exactly what i don't want to do for damned good reasons
>
> * in the past i started httpd with type=forking
> * it was just "/usr/sbin/httpd $OPTIONS"
> * switch to "Type=simple" was change the untit in our own
>   maintained rpm-package and add "-D FOREGROUND" too

Hi.  Here is how you solve the problem with the right tool for the job:

---
# configapache.yml
hosts: apacheservers
sudo: True
tasks:
- name: configure apache
  template:
    dest: /etc/httpd/conf/httpd.conf
    src:  httpd.conf.jinja2
  notify: reload apache
- name: copy testserver stuff
  copy:
    dest: /etc/httpd/conf/local/testserver.conf
    src: testserver.conf
  notify: reload apache
handlers:
- name: reload apache
  service: httpd state=reloaded

---
# httpd.conf.jinja2
...standard config...
{% if apache.testserver %}
Include "conf/local/testserver.conf"
{% endif %}

---
# host_vars/apache1.yml
apache:
  testserver: True

---
# hosts
apache1
apache2
apache3
postfix1
postfix2

[apacheservers]
apache1
apache2
apache3

---
# your prompt
ansible-playbook -v configapache.yml

There you go -- a quick way to do proper Apache configuration without
dicking with EnvironmentFiles that *actually preserves the ability to
reload Apache with no downtime!*

-- 
    Rudd-O
    http://rudd-o.com/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20151226/ad6a0552/attachment.sig>


More information about the systemd-devel mailing list