Suggestions
Closed this issue · 1 comments
In setup.yml
on lines 49 and 56 you install php5-mysql
twice.
On line 52 you install php5-sqlite
, yet it's not needed for Wordpress since you use MySQL.
On line 55 you install php5-xcache
, however Ubuntu 14.04 comes with PHP5.5 which automatically comes with Zend Opcache, so unless you have a specific reason to want xcache, it's unnecessary.
On line 7 it's unnecessary to run apt module with update_cache=yes
. You can combine it with the regular apt: calls.
On line 23 instead of using command: a2enmod
, consider using http://docs.ansible.com/apache2_module_module.html
Having explicit separate tasks to install each package individually slows down your playbook. Instead, it's faster (and cleaner) to install all your needed packages from a singe task using with_items:
mode.
Extract all the hardcoded usernames, databases and passwords to be configurable variables.
Great suggestions, thanks! I've rolled most of them into a new commit I just pushed up.
The only ones not included were:
-
Rolling package installs into one big with_items list: it would speed things up, but the purpose of this project is at least partly educational, to help newbies learn Ansible, so I feel like the extra verbosity is valuable in that it makes it easier to read through the playbook step by step and grok what's going on. I could be wrong on that, though. Or maybe it's worth having two playbooks, one verbose one and one terse one, and then making it configurable which one gets run? Like the "turbo" switch on old PC XT clones 😄
-
Hardcoded usernames/databases/passwords should be extracted, but since they're all for internal use only (i.e. the only user of the MySQL account will be WordPress) that feels like a lower priority. I'll put it on my to-do list, though.
Again, thanks so much for taking the time to help me improve this thing! If you see any other ways it could be better, send them along.