xci: Ensure using flavor inventory
[releng.git] / prototypes / xci / playbooks / configure-localhost.yml
1 ---
2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2017 Ericsson AB and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10 - hosts: localhost
11   remote_user: root
12   vars_files:
13     - ../var/{{ ansible_os_family }}.yml
14     - ../var/opnfv.yml
15   roles:
16     - role: remove-folders
17     - { role: clone-repository, project: "opnfv/releng", repo: "{{ OPNFV_RELENG_GIT_URL }}", dest: "{{ OPNFV_RELENG_PATH }}", version: "{{ OPNFV_RELENG_VERSION }}" }
18   tasks:
19     - name:  create log directory {{LOG_PATH}}
20       file:
21         path: "{{LOG_PATH}}"
22         state: directory
23         recurse: no
24     # when the deployment is not aio, we use playbook, configure-targethosts.yml, to configure all the hosts
25     - name: copy multihost playbook
26       copy:
27         src: "{{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/configure-targethosts.yml"
28         dest: "{{OPNFV_RELENG_PATH}}/prototypes/xci/playbooks"
29       when: XCI_FLAVOR != "aio"
30     # when the deployment is aio, we overwrite and use playbook, configure-opnfvhost.yml, since everything gets installed on opnfv host
31     - name: copy aio playbook
32       copy:
33         src: "{{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/configure-opnfvhost.yml"
34         dest: "{{OPNFV_RELENG_PATH}}/prototypes/xci/playbooks"
35       when: XCI_FLAVOR == "aio"
36     - name: copy flavor inventory
37       copy:
38         src: "{{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/inventory"
39         dest: "{{OPNFV_RELENG_PATH}}/prototypes/xci/playbooks"
40     - name: copy flavor vars
41       copy:
42         src: "{{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/flavor-vars.yml"
43         dest: "{{OPNFV_RELENG_PATH}}/prototypes/xci/var"