-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a6d22ef
commit fec7997
Showing
4 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
- name: Bring up one container for ports test | ||
hosts: localhost | ||
vars: | ||
inventory: | ||
- name: provision_docker_host_one | ||
image: "chrismeyers/centos7" | ||
expose: 80 | ||
ports: | ||
- 8080:80 | ||
roles: | ||
- role: provision_docker | ||
provision_docker_inventory: "{{ inventory }}" | ||
|
||
|
||
- name: Deploy apache server in container | ||
hosts: provision_docker_host_one | ||
tasks: | ||
- name: Install epel-release | ||
yum: | ||
name: epel-release | ||
state: present | ||
- name: Install nginx | ||
yum: | ||
name: nginx | ||
state: present | ||
- name: Start service | ||
service: | ||
name: nginx | ||
state: started | ||
|
||
|
||
- name: Verify that sevice is exposed on host's port | ||
hosts: localhost | ||
tasks: | ||
- name: Wait for nginx appear on port 8080 | ||
uri: | ||
url: "http://localhost:8080" | ||
status_code: 200 | ||
register: result | ||
until: result.status == 200 # Welcome page is not really welcoming | ||
# and returns 403 status instead of 200. | ||
retries: 10 | ||
delay: 1 |