blob: f1980fae463bc504cff2d0cd3d8445510bf350a9 [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 }}"
Zack Williams10952202017-02-10 17:53:33 -07008 timeout: 240
Zack Williamsa2763112017-01-03 11:38:38 -07009
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'
Zack Williams0c554ce2017-02-22 13:56:03 -070030 retries: 60
31 delay: 10
Zack Williamsa2763112017-01-03 11:38:38 -070032
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
Scott Baker74065da2017-03-16 13:33:39 -070045 command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/xos_services/{{ item.path | basename }}/xos/{{ item.name }}-{{ item.operation | default('onboard') }}.yaml"
Zack Williamsa2763112017-01-03 11:38:38 -070046 with_items: "{{ xos_services }}"
47 tags:
48 - skip_ansible_lint # TOSCA loading should be idempotent
49
Scott Baker5ca4bd12017-02-10 15:17:06 -080050- name: Onboard components
51 command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/cord_profile/{{ item.recipe_filename }}"
52 with_items: "{{ xos_components }}"
53 tags:
54 - skip_ansible_lint # TOSCA loading should be idempotent
55
Zack Williamsa2763112017-01-03 11:38:38 -070056- name: Enable onboarding
57 command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/cord_profile/enable-onboarding.yaml"
58 tags:
59 - skip_ansible_lint # TOSCA loading should be idempotent
60
61- name: Wait for libraries to be onboarded
62 uri:
63 url: "http://localhost:{{ xos_bootstrap_ui_port }}/api/utility/onboarding/services/{{ item }}/ready/"
64 method: GET
65 return_content: yes
66 register: xos_onboard_status
67 until: '"true" in xos_onboard_status.content'
68 retries: 60
Zack Williams2478b302017-02-14 10:42:55 -070069 delay: 10
Zack Williamsa2763112017-01-03 11:38:38 -070070 with_items: "{{ xos_libraries }}"
71
72- name: Wait for services to be onboarded
73 uri:
74 url: "http://localhost:{{ xos_bootstrap_ui_port }}/api/utility/onboarding/services/{{ item.name }}/ready/"
75 method: GET
76 return_content: yes
77 register: xos_onboard_status
78 until: '"true" in xos_onboard_status.content'
79 retries: 60
Zack Williams2478b302017-02-14 10:42:55 -070080 delay: 10
Zack Williamsa2763112017-01-03 11:38:38 -070081 with_items: "{{ xos_services }}"
82
83- name: Wait for XOS to be onboarded after service onboarding
84 uri:
85 url: "http://localhost:{{ xos_bootstrap_ui_port }}/api/utility/onboarding/xos/ready/"
86 method: GET
87 return_content: yes
88 register: xos_onboard_status
89 until: '"true" in xos_onboard_status.content'
90 retries: 60
Zack Williams2478b302017-02-14 10:42:55 -070091 delay: 10
Zack Williamsa2763112017-01-03 11:38:38 -070092