bifrost/playbooks/roles/bifrost-prep-for-install/tasks/main.yml

39 lines
1.3 KiB
YAML

# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
- name: ensure installation root folder exists
become: yes
file:
state: directory
dest: "{{ git_root }}"
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_gid }}"
- name: "Download via GIT"
git:
dest: "{{ item.git_folder }}"
force: yes
repo: "{{ item.git_url }}"
version: "{{ item.git_branch }}"
update: yes
clone: yes
with_items: "{{ bifrost_install_sources }}"
when: ci_testing_zuul | bool == false and copy_from_local_path | bool == false
- name: "Copy from local path"
command: cp -a {{ item.git_url }} {{ item.git_folder }} creates={{ item.git_folder }}
with_items: "{{ bifrost_install_sources }}"
when: ci_testing_zuul | bool == true or copy_from_local_path | bool == true