1 #Onap installation tasks
2 #Copy ssh private key used for resource server access
3 - name: "Copy resource server access key"
5 src: "{{ hostvars[groups['resources'][0]].ansible_private_key_file }}"
6 dest: "{{ ansible_user_dir }}/.ssh/res.pem"
9 - name: "Ensure {{ installer_deploy_path }} directory exists"
11 path: "{{ installer_deploy_path }}"
13 - name: "Extract sw resources"
15 src: "resources/{{ hostvars[groups['resources'][0]].resources_sw_filename }}"
16 dest: "{{ installer_deploy_path }}"
17 #Generate ansible inventory and extra vars
18 - name: "Generate ansible inventory for installer"
21 dest: "{{ installer_deploy_path }}/ansible/inventory/hosts.yml"
22 - name: "generate application specific config overrides"
24 content: "{{ application_config | b64decode }}"
25 dest: "{{ installer_deploy_path }}/ansible/application/application_overrides.yml"
26 # add onap network configuration to overrides
27 - name: "inject onap network information to config overrides"
29 path: "{{ installer_deploy_path }}/ansible/application/application_overrides.yml"
30 regexp: '({{ item.key }}:)\s?.*'
31 replace: '\1 {{ item.value }}'
32 loop: "{{ lines|dict2items }}"
35 openStackPrivateNetId: "{{ (hostvars['localhost'].heat_stack.stack.outputs | selectattr('output_key', 'equalto', 'network_id') | list).0.output_value }}"
36 openStackPrivateSubnetId: "{{ (hostvars['localhost'].heat_stack.stack.outputs | selectattr('output_key', 'equalto', 'subnet_id') | list).0.output_value }}"
37 # This generates a file with locations of resource files in resource host, we
38 # do it only to allow manually running offline installer without
39 # typing them by hand. We cannot use
40 # inventory template because it will be overridden
41 # by application_configuration.yml.
42 - name: Generate resource location file
45 resources_dir: {{ resources_dir }}
46 resources_filename: {{ resources_filename }}
47 aux_resources_filename: {{ aux_resources_filename }}
48 app_data_path: {{ app_data_path }}
49 dest: "{{ installer_deploy_path }}/ansible/application/resources.yml"
51 - name: "Execute installation"
54 -e @application/application_configuration.yml -e @application/application_overrides.yml
55 -e @application/resources.yml -i inventory/hosts.yml site.yml
57 chdir: "{{ installer_deploy_path }}/ansible"
58 async: "{{ install_timeout }}"
59 when: install_app | bool