blob: 32b8b63091136a0288b2749de4848188a1633884 [file] [log] [blame]
Andy Baviera27effe2016-07-18 19:23:26 -04001---
2# post-deploy-tasks/tasks/main.yml
3#
4# Run tests to check that the single-node deployment has worked
5
6- name: Create a sample CORD subscriber
7 command: ansible xos-1 -u ubuntu -m shell \
8 -a "cd ~/service-profile/cord-pod; make cord-subscriber"
9
10- name: Pause 60 seconds (work around bug in synchronizer)
11 pause: seconds=60
12
13- name: Re-run 'make vtn' (work around bug in synchronizer)
14 command: ansible xos-1 -u ubuntu -m shell \
15 -a "cd ~/service-profile/cord-pod; make vtn"
16
17- name: Wait for vSG VM to come up
18 shell: bash -c "source ~/admin-openrc.sh; nova list --all-tenants|grep 'vsg.*ACTIVE' > /dev/null"
19 register: result
20 until: result | success
21 retries: 10
22 delay: 60
23
24- name: Get ID of VM
25 shell: bash -c "source ~/admin-openrc.sh; nova list --all-tenants|grep mysite_vsg|cut -d '|' -f 2"
26 register: nova_id
27
28- name: Get mgmt IP of VM
29 shell: bash -c "source ~/admin-openrc.sh; nova interface-list {{ nova_id.stdout }}|grep -o -m 1 172.27.[[:digit:]]*.[[:digit:]]*"
30 register: mgmt_ip
31
32- name: Wait for Docker container inside VM to come up
33 shell: ssh -o ProxyCommand="ssh -W %h:%p ubuntu@nova-compute-1" ubuntu@{{ mgmt_ip.stdout }} "sudo docker ps|grep vcpe" > /dev/null
34 register: result
35 until: result | success
36 retries: 20
37 delay: 60
38
39- name: Run dhclient inside testclient to get IP address from vSG
40 command: ansible nova-compute-1 -u ubuntu -m shell \
41 -s -a "lxc-attach -n testclient -- dhclient eth0.222.111"
42
43- name: Test external connectivity in test client
44 command: ansible nova-compute-1 -u ubuntu -m shell \
45 -s -a "lxc-attach -n testclient -- ping -c 3 8.8.8.8"
46 register: pingtest
47
48- name: Output from ping test
49 debug: var=pingtest.stdout_lines