blob: 9f02a01cfb15c8db5c1f76f9040e2762eaad37e9 [file] [log] [blame]
---
# xos-onboarding/tasks/main.yml
- name: Wait for XOS to be ready
wait_for:
host: localhost
port: "{{ xos_bootstrap_ui_port }}"
timeout: 240
- name: Bootstrap XOS database - create site, deployment, admin user
command: "python /opt/xos/tosca/run.py none /opt/cord_profile/{{ item }}"
with_items:
- "fixtures.yaml"
- "deployment.yaml"
tags:
- skip_ansible_lint # TOSCA loading should be idempotent
- name: Configure XOS with xos.yaml TOSCA
command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/cord_profile/xos.yaml"
tags:
- skip_ansible_lint # TOSCA loading should be idempotent
- name: Wait for XOS to be onboarded
uri:
url: "http://localhost:{{ xos_bootstrap_ui_port }}/api/utility/onboarding/xos/ready/"
method: GET
return_content: yes
register: xos_onboard_status
until: '"true" in xos_onboard_status.content'
retries: 120
delay: 2
- name: Disable onboarding
command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/cord_profile/disable-onboarding.yaml"
tags:
- skip_ansible_lint # TOSCA loading should be idempotent
- name: Onboard libraries
command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/xos_libraries/{{ item }}/{{ item }}-onboard.yaml"
with_items: "{{ xos_libraries }}"
tags:
- skip_ansible_lint # TOSCA loading should be idempotent
- name: Onboard services
command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/xos_services/{{ item.path | basename }}/xos/{{ item.name }}-onboard.yaml"
with_items: "{{ xos_services }}"
tags:
- skip_ansible_lint # TOSCA loading should be idempotent
- name: Onboard components
command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/cord_profile/{{ item.recipe_filename }}"
with_items: "{{ xos_components }}"
tags:
- skip_ansible_lint # TOSCA loading should be idempotent
- name: Enable onboarding
command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} /opt/cord_profile/enable-onboarding.yaml"
tags:
- skip_ansible_lint # TOSCA loading should be idempotent
- name: Wait for libraries to be onboarded
uri:
url: "http://localhost:{{ xos_bootstrap_ui_port }}/api/utility/onboarding/services/{{ item }}/ready/"
method: GET
return_content: yes
register: xos_onboard_status
until: '"true" in xos_onboard_status.content'
retries: 60
delay: 10
with_items: "{{ xos_libraries }}"
- name: Wait for services to be onboarded
uri:
url: "http://localhost:{{ xos_bootstrap_ui_port }}/api/utility/onboarding/services/{{ item.name }}/ready/"
method: GET
return_content: yes
register: xos_onboard_status
until: '"true" in xos_onboard_status.content'
retries: 60
delay: 10
with_items: "{{ xos_services }}"
- name: Wait for XOS to be onboarded after service onboarding
uri:
url: "http://localhost:{{ xos_bootstrap_ui_port }}/api/utility/onboarding/xos/ready/"
method: GET
return_content: yes
register: xos_onboard_status
until: '"true" in xos_onboard_status.content'
retries: 60
delay: 10