Scott Baker | f93a06c | 2016-07-11 17:04:49 -0700 | [diff] [blame] | 1 | --- |
| 2 | |
| 3 | #- name: disable onboarding |
| 4 | # uri: |
| 5 | # url="http://127.0.0.1:{{ bootstrap_port }}/utility/tosca/run" |
| 6 | # user={{ bootstrap_user }} |
| 7 | # password={{ bootstrap_password }} |
| 8 | # body= {{ "{" }} 'recipe': {{ lookup('file', disable_tosca_yaml) }} {{ "}" }} |
| 9 | |
| 10 | - name: disable onboarding |
| 11 | xostosca: |
| 12 | port={{ bootstrap_port }} |
| 13 | username={{ bootstrap_user }} |
| 14 | password={{ bootstrap_password }} |
| 15 | recipe={{ lookup('file', disable_onboarding_tosca_yml) }} |
| 16 | |
| 17 | - name: install private keys |
| 18 | copy: |
| 19 | dest="{{ key_import_dir }}/{{ item.name }}" |
| 20 | src="{{ item.private_fn }}" |
| 21 | with_items: "{{ onboard_keys | default([]) }}" |
| 22 | |
| 23 | - name: install public keys |
| 24 | copy: |
| 25 | dest="{{ key_import_dir }}/{{ item.name }}.pub" |
| 26 | src="{{ item.public_fn }}" |
| 27 | with_items: "{{ onboard_keys | default([]) }}" |
| 28 | |
| 29 | - name: onboard services |
| 30 | xostosca: |
| 31 | port={{ bootstrap_port }} |
| 32 | username={{ bootstrap_user }} |
| 33 | password={{ bootstrap_password }} |
| 34 | recipe={{ lookup('file', item.yaml) }} |
| 35 | with_items: "{{ onboard_services | default([]) }}" |
| 36 | |
| 37 | - name: run synchronizers.yml tosca recipe |
| 38 | xostosca: |
| 39 | port={{ bootstrap_port }} |
| 40 | username={{ bootstrap_user }} |
| 41 | password={{ bootstrap_password }} |
| 42 | recipe={{ lookup('file', synchronizers_yml) }} |
| 43 | when: synchronizers_yml is defined |
| 44 | |
| 45 | - name: enable onboarding |
| 46 | xostosca: |
| 47 | port={{ bootstrap_port }} |
| 48 | username={{ bootstrap_user }} |
| 49 | password={{ bootstrap_password }} |
| 50 | recipe={{ lookup('file', enable_onboarding_tosca_yml) }} |
| 51 | |
| 52 | - name: wait for onboarding ready for service {{ item.name }} |
| 53 | uri: |
| 54 | url: "http://0.0.0.0:{{ bootstrap_port }}/api/utility/onboarding/services/{{ item.name }}/ready/" |
| 55 | return_content: true |
| 56 | register: result |
| 57 | retries: 60 |
| 58 | delay: 5 |
| 59 | until: result.content=="true" |
| 60 | with_items: "{{ onboard_services | default([]) }}" |
| 61 | |
| 62 | - name: wait for onboarding ready for xos core |
| 63 | uri: |
| 64 | url: "http://0.0.0.0:{{ bootstrap_port }}/api/utility/onboarding/xos/ready/" |
| 65 | return_content: true |
| 66 | register: result |
| 67 | retries: 60 |
| 68 | delay: 5 |
| 69 | until: result.content=="true" |
| 70 | |
| 71 | - name: wait for XOS ui to come online |
| 72 | uri: |
| 73 | url: "http://0.0.0.0:{{ ui_port }}/" |
| 74 | register: result |
| 75 | retries: 120 |
| 76 | delay: 1 |
| 77 | until: result['status']|default(0)==200 |