summaryrefslogtreecommitdiffstats
path: root/xci/nfvi/osa/playbooks/configure-localhost.yml
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2017-12-20 10:12:42 +0000
committerFatih Degirmenci <fdegir@gmail.com>2017-12-21 00:28:52 +0100
commitc74cfd33fc3c8274433f153f1d211b7b2657ab54 (patch)
tree252c2aae1f81393300714abab472b0242c3db936 /xci/nfvi/osa/playbooks/configure-localhost.yml
parent8662864a166d9e89ba8058c871526b3ad94aae21 (diff)
xci: OSA: Move all the OSA specific playbooks to the NFVI directory
Move all the playbooks that only make sense for OpenStack-Ansible deployments to the NFVI/OSA directory where they belong. This further disassociates XCI from OSA. Change-Id: Iab8b6dc81d9025a1d85608a98fb1eee0f1c6a69f Signed-off-by: Markos Chandras <mchandras@suse.de> Signed-off-by: Fatih Degirmenci <fdegir@gmail.com>
Diffstat (limited to 'xci/nfvi/osa/playbooks/configure-localhost.yml')
-rw-r--r--xci/nfvi/osa/playbooks/configure-localhost.yml75
1 files changed, 75 insertions, 0 deletions
diff --git a/xci/nfvi/osa/playbooks/configure-localhost.yml b/xci/nfvi/osa/playbooks/configure-localhost.yml
new file mode 100644
index 00000000..caa5d673
--- /dev/null
+++ b/xci/nfvi/osa/playbooks/configure-localhost.yml
@@ -0,0 +1,75 @@
+---
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2017 Ericsson AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+- hosts: localhost
+ connection: local
+
+ pre_tasks:
+ - name: Load distribution variables
+ include_vars:
+ file: "{{ item }}"
+ failed_when: false
+ with_items:
+ - "{{ XCI_PATH }}/xci/var/opnfv.yml"
+ - "{{ XCI_PATH }}/xci/var/{{ ansible_os_family }}.yml"
+
+ - name: cleanup leftovers of previous deployment
+ file:
+ path: "{{ item }}"
+ state: absent
+ recurse: no
+ with_items:
+ - "{{ XCI_CACHE }}/repos"
+ - "{{ LOG_PATH }} "
+ - "{{ OPNFV_SSH_HOST_KEYS_PATH }}"
+
+ roles:
+ - role: clone-repository
+ project: "openstack/openstack-ansible-openstack_openrc"
+ repo: "{{ OPENSTACK_OSA_OPENRC_GIT_URL }}"
+ dest: roles/openstack-ansible-openstack_openrc
+ version: "master"
+ - role: clone-repository
+ project: "openstack/openstack-ansible"
+ repo: "{{ OPENSTACK_OSA_GIT_URL }}"
+ dest: "{{ XCI_CACHE }}/repos/openstack-ansible"
+ version: "{{ OPENSTACK_OSA_VERSION }}"
+
+ tasks:
+ - name: create log directory {{LOG_PATH}}
+ file:
+ path: "{{LOG_PATH}}"
+ state: directory
+ recurse: no
+ - name: check if certificate directory /etc/ssl/certs exists already
+ stat: path=/etc/ssl/certs
+ register: check_etc_ssl_certs
+ - name: create certificate directory /etc/ssl/certs
+ become: true
+ file:
+ path: "/etc/ssl/certs"
+ state: directory
+ when: check_etc_ssl_certs.stat.exists == false
+ - name: create key directory /etc/ssl/private
+ become: true
+ file:
+ path: "/etc/ssl/private"
+ state: directory
+ - name: generate self signed certificate
+ command: openssl req -new -nodes -x509 -subj "{{ XCI_SSL_SUBJECT }}" -days 3650 -keyout "/etc/ssl/private/xci.key" -out "/etc/ssl/certs/xci.crt" -extensions v3_ca
+ become: true
+ - name: Synchronize local development OSA repository to XCI paths
+ # command module is much faster than the copy module
+ synchronize:
+ src: "{{ OPENSTACK_OSA_DEV_PATH }}"
+ dest: "{{ XCI_CACHE }}/repos/openstack-ansible"
+ recursive: yes
+ delete: yes
+ when:
+ - OPENSTACK_OSA_DEV_PATH != ""