Skip to content

Commit

Permalink
Add a verifier.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdebock committed Jan 15, 2020
1 parent fdb28a1 commit 9b93333
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,29 @@ The machine you are running this on, may need to be prepared, I use this playboo
- robertdebock.python_pip
```
After running this role, this playbook runs to verify that everything works, this may be a good example how you can use this role.
```yaml
---
- name: Verify
hosts: all
become: yes
gather_facts: yes

tasks:
- name: check if ports are open
wait_for:
port: "{{ item }}"
timeout: 2
loop:
- "80"
- "443"

- name: interact with webserver
uri:
url: "https://127.0.0.1/mylocation1/"
status_code: 503
validate_certs: no
```
Also see a [full explanation and example](https://robertdebock.nl/how-to-use-these-roles.html) on how to use these roles.
Expand Down
5 changes: 5 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@ provisioner:
defaults:
stdout_callback: yaml
bin_ansible_callbacks: yes
verifier:
name: ansible
lint:
name: ansible-lint
enabled: no
scenario:
name: default
20 changes: 20 additions & 0 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- name: Verify
hosts: all
become: yes
gather_facts: yes

tasks:
- name: check if ports are open
wait_for:
port: "{{ item }}"
timeout: 2
loop:
- "80"
- "443"

- name: interact with webserver
uri:
url: "https://127.0.0.1/mylocation1/"
status_code: 503
validate_certs: no

0 comments on commit 9b93333

Please sign in to comment.