Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

apache and nginx examples will fail on successive run if you change the webserver port. #256

Open
tima opened this issue Jan 27, 2018 · 0 comments

Comments

@tima
Copy link
Collaborator

tima commented Jan 27, 2018

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

http://docs.ansible.com/ansible/latest/meta_module.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant