apache and nginx examples will fail on successive run if you change the webserver port.
tima opened this issue · 0 comments
Testing #239 I noticed that successive runs of the apache and nginx basic and role examples where you are switching the web server port will fail at the smoke test because the restart handler hasn't executed yet for the web server to have switched ports.
One approach would be to restructure the examples. In the "basic playbook" examples you'd do the smoke test in a secondary play in the playbook. In the roles examples you could breakout the smoke test into its own file and use include_role: task_from: tasks.yml
in a secondary play in the playbook. It is part of the extra credit assignments in the hands on workshops but is this getting too complicated too soon though?
A more direct approach is to use a meta: flush_handlers
before the smoke test should handle that BUT we need to make sure to give hints and links in the docs to introduce students to that function throughout.
- name: Forcing any notified handlers to run now
meta: flush_handlers