We are currently studying Ansible to provide our servers. This is pretty default nginx, php-fpm and mysql setup. However, I am interested in installing these packages and how to make an idempotent playbook with running services.
For nginx, we have nginx.conf by default and some files in conf.d/ . For php, we have php.ini , a php-fpm.conf , a pool in pool.d/ and some ini files in conf.d/ . Is the idea to transfer all files to any available call for playback?
If all configurations are overwritten, is it normal to do service nginx reload and service php5-fpm reload , even if the server is under heavy load? For initial installation, a reload will not start the server, so I need to first check the status and based on this switch between start and reload ?
If I am looking for players with nginx installation, they often use handlers that restart nginx. However, this is not elegant, so I don't really like this approach:
service: name=nginx state=restarted
In general , what is the general pattern for using servers and provisioning servers with services such as nginx, php-fpm and mysql without forcing a restart ?
source share