title: Is a graceful reload idempotent for ansible?
body: <p>We're now investigating Ansible to provision our servers. It's quite a default nginx, php-fpm &amp; mysql setup. However, I am wondering about installation of these packages and how to make the playbook idempotent with the services running.</p>
  
  <p>For nginx, we've a default <code>nginx.conf</code> and some files in <code>conf.d/</code>. For php, we've a <code>php.ini</code>, a <code>php-fpm.conf</code>, a pool in <code>pool.d/</code> and some ini files in <code>conf.d/</code>. Is it the idea to overwrite all files on every ansible playbook call?</p>
  
  <p>If all configurations are overwritten, is it OK to do a <code>service nginx reload</code> and <code>service php5-fpm reload</code> even when the server is under heavy load? For initial installations, a <code>reload</code> will not start the server, so I have to check the status first and based on that, switch between <code>start</code> and <code>reload</code>?</p>
  
  <p>If I look for playbooks with a nginx installation, they often use handlers which will restart nginx. However, this is not graceful, so I don't really like that approach:</p>
  
  <pre><code>service: name=nginx state=restarted
  </code></pre>
  
  <p>In general, <strong>what's the common pattern to use ansible and provision servers with services</strong> like nginx, php-fpm and mysql <strong>without forcing a restart</strong>?</p>