blob: df3a2051f1a54c9334c933da9213de7c6019e17d [file] [log] [blame]
Zack Williamsa2763112017-01-03 11:38:38 -07001---
2# xos-onboarding/tasks/main.yml
3
4- name: Wait for XOS to be ready
5 wait_for:
6 host: localhost
7 port: "{{ xos_bootstrap_ui_port }}"
8 timeout: 120
9
10- name: Bootstrap XOS database - create site, deployment, admin user
11 command: "python /opt/xos/tosca/run.py none /opt/cord_profile/{{ item }}"
12 with_items:
13 - "fixtures.yaml"
14 - "deployment.yaml"
15 tags:
16 - skip_ansible_lint # TOSCA loading should be idempotent
17
18- name: Configure XOS with xos.yaml TOSCA
19 command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/cord_profile/xos.yaml"
20 tags:
21 - skip_ansible_lint # TOSCA loading should be idempotent
22
23- name: Wait for XOS to be onboarded
24 uri:
25 url: "http://localhost:{{ xos_bootstrap_ui_port }}/api/utility/onboarding/xos/ready/"
26 method: GET
27 return_content: yes
28 register: xos_onboard_status
29 until: '"true" in xos_onboard_status.content'
30 retries: 120
31 delay: 2
32
33- name: Disable onboarding
34 command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/cord_profile/disable-onboarding.yaml"
35 tags:
36 - skip_ansible_lint # TOSCA loading should be idempotent
37
38- name: Onboard libraries
39 command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/xos_libraries/{{ item }}/{{ item }}-onboard.yaml"
40 with_items: "{{ xos_libraries }}"
41 tags:
42 - skip_ansible_lint # TOSCA loading should be idempotent
43
44- name: Onboard services
45 command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/xos_services/{{ item.path | basename }}/xos/{{ item.name }}-onboard.yaml"
46 with_items: "{{ xos_services }}"
47 tags:
48 - skip_ansible_lint # TOSCA loading should be idempotent
49
50- name: Enable onboarding
51 command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/cord_profile/enable-onboarding.yaml"
52 tags:
53 - skip_ansible_lint # TOSCA loading should be idempotent
54
55- name: Wait for libraries to be onboarded
56 uri:
57 url: "http://localhost:{{ xos_bootstrap_ui_port }}/api/utility/onboarding/services/{{ item }}/ready/"
58 method: GET
59 return_content: yes
60 register: xos_onboard_status
61 until: '"true" in xos_onboard_status.content'
62 retries: 60
63 delay: 5
64 with_items: "{{ xos_libraries }}"
65
66- name: Wait for services to be onboarded
67 uri:
68 url: "http://localhost:{{ xos_bootstrap_ui_port }}/api/utility/onboarding/services/{{ item.name }}/ready/"
69 method: GET
70 return_content: yes
71 register: xos_onboard_status
72 until: '"true" in xos_onboard_status.content'
73 retries: 60
74 delay: 5
75 with_items: "{{ xos_services }}"
76
77- name: Wait for XOS to be onboarded after service onboarding
78 uri:
79 url: "http://localhost:{{ xos_bootstrap_ui_port }}/api/utility/onboarding/xos/ready/"
80 method: GET
81 return_content: yes
82 register: xos_onboard_status
83 until: '"true" in xos_onboard_status.content'
84 retries: 60
85 delay: 5
86