summaryrefslogtreecommitdiffstats
path: root/tools/cicdansible/roles/install/tasks
diff options
context:
space:
mode:
authorMichal Ptacek <m.ptacek@partner.samsung.com>2019-09-04 15:39:20 +0000
committerGerrit Code Review <gerrit@onap.org>2019-09-04 15:39:20 +0000
commit1da8b7af533aa48450d42219f0615d0bb510da4a (patch)
tree827fc4fa9da8d685d6d7960978ce99680e8f7d31 /tools/cicdansible/roles/install/tasks
parent8620b2be770895ffca1385f3a8a57b9422ecf126 (diff)
parent2e34522351d40edd0e37b4919630736748949f2a (diff)
Merge changes from topic "OOM-2042"
* changes: Add ansible configuration file Add cicdansible playbook Add onap installation role Add onap instance configuration role Add ansible role to deploy onap infrastructure on openstack Add floating ip fact retrieval module Add inventory for cicdansible playbook Add heat template to deploy onap infrastructure Add the .gitignore for cicdansible
Diffstat (limited to 'tools/cicdansible/roles/install/tasks')
-rw-r--r--tools/cicdansible/roles/install/tasks/download_resources.yml6
-rw-r--r--tools/cicdansible/roles/install/tasks/install.yml48
-rw-r--r--tools/cicdansible/roles/install/tasks/main.yml1
3 files changed, 55 insertions, 0 deletions
diff --git a/tools/cicdansible/roles/install/tasks/download_resources.yml b/tools/cicdansible/roles/install/tasks/download_resources.yml
new file mode 100644
index 00000000..7f042596
--- /dev/null
+++ b/tools/cicdansible/roles/install/tasks/download_resources.yml
@@ -0,0 +1,6 @@
+#Download resources/scripts to controller.
+- name: "Download software resources"
+ fetch:
+ src: "{{ resources_dir }}/{{ resources_sw_filename }}"
+ flat: yes
+ dest: "resources/"
diff --git a/tools/cicdansible/roles/install/tasks/install.yml b/tools/cicdansible/roles/install/tasks/install.yml
new file mode 100644
index 00000000..35df7976
--- /dev/null
+++ b/tools/cicdansible/roles/install/tasks/install.yml
@@ -0,0 +1,48 @@
+#Onap installation tasks
+#Copy ssh private key used for resource server access
+- name: "Copy resource server access key"
+ copy:
+ src: "{{ hostvars[groups['resources'][0]].ansible_private_key_file }}"
+ dest: "{{ ansible_user_dir }}/.ssh/res.pem"
+ mode: 0600
+#Unarchive resources.
+- name: "Ensure {{ installer_deploy_path }} directory exists"
+ file:
+ path: "{{ installer_deploy_path }}"
+ state: directory
+- name: "Extract sw resources"
+ unarchive:
+ src: "resources/{{ hostvars[groups['resources'][0]].resources_sw_filename }}"
+ dest: "{{ installer_deploy_path }}"
+#Generate ansible inventory and extra vars.
+- name: "Generate ansible inventory for installer"
+ template:
+ src: inventory.yml.j2
+ dest: "{{ installer_deploy_path }}/ansible/inventory/hosts.yml"
+- name: "generate application specific config overrides"
+ copy:
+ content: "{{ application_config | b64decode }}"
+ dest: "{{ installer_deploy_path }}/ansible/application/application_overrides.yml"
+# This generates a file with locations of resource files in resource host, we
+# do it only to allow manually running offline installer without
+# typing them by hand. We cannot use
+# inventory template because it will be overridden
+# by application_configuration.yml.
+- name: Generate resource location file
+ copy:
+ content: |
+ resources_dir: {{ resources_dir }}
+ resources_filename: {{ resources_filename }}
+ aux_resources_filename: {{ aux_resources_filename }}
+ app_data_path: /opt/onap/resources
+ dest: "{{ installer_deploy_path }}/ansible/application/resources.yml"
+#Run script.
+- name: "Execute installation"
+ shell:
+ ./run_playbook.sh
+ -e @application/application_configuration.yml -e @application/application_overrides.yml
+ -e @application/resources.yml -i inventory/hosts.yml site.yml
+ args:
+ chdir: "{{ installer_deploy_path }}/ansible"
+ async: "{{ install_timeout }}"
+ when: install_app
diff --git a/tools/cicdansible/roles/install/tasks/main.yml b/tools/cicdansible/roles/install/tasks/main.yml
new file mode 100644
index 00000000..04ac4c3d
--- /dev/null
+++ b/tools/cicdansible/roles/install/tasks/main.yml
@@ -0,0 +1 @@
+- include_tasks: "{{ mode }}.yml"