Skip to content

Commit

Permalink
add verify
Browse files Browse the repository at this point in the history
  • Loading branch information
Code-Egg committed Sep 2, 2020
1 parent 2c91d61 commit b779d0d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 12 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ os: linux
jobs:
include:
- dist: Focal
- dist: Bionic

notifications:
email:
Expand All @@ -22,5 +21,4 @@ install:
- ansible-playbook travisbook.yml

script:
- ansible-lint travisbook.yml || true

- ./.travis/verify.sh
33 changes: 33 additions & 0 deletions .travis/verify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

#!/bin/bash
set -o errexit

verify_syntax(){
ansible-lint travisbook.yml || true
}

verify_lsws(){
curl -sIk http://localhost:7080/ | grep -i LiteSpeed
if [ ${?} = 0 ]; then
echo '[O] https://localhost:7080/'
else
echo '[X] https://localhost:7080/'
exit 1
fi
}

verify_wordpress(){
curl -siL http://localhost/ | grep -i WordPress
if [ ${?} = 0 ]; then
echo '[O] https://localhost/'
else
echo '[X] https://localhost/'
exit 1
fi
}

main(){
verify_syntax
verify_lsws
verify_wordpress
}
10 changes: 1 addition & 9 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,4 @@
- name: Install unzip
raw: test -e /usr/bin/unzip || apt install -y unzip
changed_when: false
tags: [ system ]

- name: Make sure pymysql is present
become: true
pip:
name: "{{ item }}"
state: present
with_items:
- pymysql
tags: [ system ]

0 comments on commit b779d0d

Please sign in to comment.