Here it is for anyone reading this discussion: https://www.ansible.com/
Basically the reason I created this rather than relying on something else is that I wanted an easy script that can setup a full production Web Server environment for PHP without any dependencies other than the minimum needed.
The script is completely free and open source any easy to change in case someone wants to use it for Laravel, Symfony, or something else. Most automation scripts are used to sell additional products like Ansible so this script avoids that.
Currently the script works on Ubuntu only but I will expand to RedHat and other OS's as time permits. Of course if anyone can help contribute I would gladly accept.
https://github.com/nginxinc/ansible-role-nginx
it is complete free, open source, not difficult to use, does not require any additional tools on the target host.
On the control (source) host you just need ansible and target hosts need python3.
And from there you can use this role to push nginx install on 10 or 100 target hosts (with same single command). The hosts do not have to run the same OS (they can run a mix Debian-based, or -redhat based Linuxes, and a FreeBSD.. I think (although did not try that) ).
This role automatically setups and download the appropriate versions of nginx binaries, and allows pretty flexible config of nginx itself, from load balancers to reverse proxies, to plain-jane web servers...
Any passwords that may need to be transmitted to target hosts (eg for cert files), are normally encrypted in crypto-secure ansible vault. So they get transferred with SSH over to the host, without being ever bein stored plain on the source/controller host.
With regards to
> Most automation scripts are used to sell additional products like Ansible so this script avoids that.
I think most open source software, nginx including, can be though of as 'promoting' something or somebody. Just like any other endeavor that meant to be publicly consumed.
I just see that writing large scripts like this is a waste of time when we have cool tech like Ansible that could do this far easier. Plus Ansible is idempotence!
Scripts like this take time to create, debug and read to those that are seeing it the first time, or the 100th. This is one reason imho why Ansible (Puppet, Chef) were created. Yaml synax is easy, just need a good editor that shows the spaces. I use Atom and sometimes Notepad++
For example, here is a Nginx role with php that I randomly found: https://github.com/geerlingguy/ansible-role-nginx
Sure, if you are using some of Ansible's modules that are developed specifically to be idempotent, then yes, but there are plenty of "shell" module examples out there that aren't remotely idempotent
Also Ansible Tower (AWX for opensource version) can have user access control and keep a history of past execution whether they succeeded or not.
And there are bunch of community written recipes for many tasks.
While writing everything in yaml may or may not make you feel good but at least it's more readable than a complicated bash script.
And yet, not everyone needs a diamong-encrusted gold-plated wrench. There is a place in the world for a regular simple wrench.
The existence of one does not invalidate the existence of everything else.
There is room for DIY scripts but it's mostly in development and perhaps early testing. In production the most important thing would be ease of maintenance. DIY scripts just create technical debt down the line, unless your whole setup is so simple that you can completely replace Ansible or similar with a DIY script.
Python is extremely easy to setup on Windows though.
Time have changed a lot though as you can now run complex bash scripts on the Windows Subsystem for Linux (published by Microsoft).
Windows Subsystem for Linux https://docs.microsoft.com/en-us/windows/wsl/about
Print Screens and Doc of running as Bash Script on Windows: https://fastsitephp.com/en/documents/file-encryption-windows
If python happens to disappear from all linux distros ansible can still work with the raw module.
In any case, the bash script posted is based on apt install so it's not going to work on much less amount of distros rather than if it was just an ansible role.