This repository has been archived by the owner on Oct 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.yml
58 lines (51 loc) · 1.57 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
# (c) Wong Hoi Sing Edison <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Use `gather_faces: no` to initialize Python on system that not yet
# pre-installed with Python (e.g. Ubuntu 16.04 Cloud Image and Docker Image).
- hosts: all
remote_user: root
gather_facts: no
roles:
- role: ansible-role-python
- hosts: all
remote_user: root
roles:
- role: ansible-role-apt
- role: ansible-role-yum
- role: ansible-role-varnish
- hosts: all
remote_user: root
tasks:
- name: start service
service:
name: "varnish"
state: "started"
- name: varnishd -V
shell: |
varnishd -V
register: varnishd_version_result
changed_when: varnishd_version_result.rc != 0
- name: check port
wait_for:
port: "6081"
timeout: "300"
delay: "10"
async: "300"
poll: "10"
- name: check result
shell: |
varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 banner | grep Varnish
register: varnishadm_result
changed_when: varnishadm_result.rc != 0