Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 1 | --- |
| 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 Williams | 1095220 | 2017-02-10 17:53:33 -0700 | [diff] [blame] | 8 | timeout: 240 |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 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' |
Zack Williams | 0c554ce | 2017-02-22 13:56:03 -0700 | [diff] [blame] | 30 | retries: 60 |
| 31 | delay: 10 |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 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 |
Scott Baker | 74065da | 2017-03-16 13:33:39 -0700 | [diff] [blame] | 45 | 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 Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 46 | with_items: "{{ xos_services }}" |
| 47 | tags: |
| 48 | - skip_ansible_lint # TOSCA loading should be idempotent |
| 49 | |
Scott Baker | 5ca4bd1 | 2017-02-10 15:17:06 -0800 | [diff] [blame] | 50 | - 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 Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 56 | - 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 Williams | 2478b30 | 2017-02-14 10:42:55 -0700 | [diff] [blame] | 69 | delay: 10 |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 70 | 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 Williams | 2478b30 | 2017-02-14 10:42:55 -0700 | [diff] [blame] | 80 | delay: 10 |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 81 | 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 Williams | 2478b30 | 2017-02-14 10:42:55 -0700 | [diff] [blame] | 91 | delay: 10 |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 92 | |