From c8de187cad59b62c01488280bc52db67c9fa4040 Mon Sep 17 00:00:00 2001 From: Kostiantyn Kalynovskyi Date: Tue, 28 Jan 2020 23:49:48 +0000 Subject: [PATCH] [AIR-72] Add role to sync repository This role is only needed during local development, if developer is using remote machine to deploy environment on. Role will copy local repository to remote ansible host, his repository will be then used to build airshipctl binary and to create bundle with airship docs Change-Id: I742d89656830d02a8e998bbef6041a5b0231d132 --- roles/sync-manifests/defaults/main.yml | 1 + roles/sync-manifests/tasks/main.yml | 28 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 roles/sync-manifests/defaults/main.yml create mode 100644 roles/sync-manifests/tasks/main.yml diff --git a/roles/sync-manifests/defaults/main.yml b/roles/sync-manifests/defaults/main.yml new file mode 100644 index 0000000..3047245 --- /dev/null +++ b/roles/sync-manifests/defaults/main.yml @@ -0,0 +1 @@ +remote_work_dir: "/tmp/airship-manifests" \ No newline at end of file diff --git a/roles/sync-manifests/tasks/main.yml b/roles/sync-manifests/tasks/main.yml new file mode 100644 index 0000000..f122d9b --- /dev/null +++ b/roles/sync-manifests/tasks/main.yml @@ -0,0 +1,28 @@ +# 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. + +# The role is used to copy manifest directory to remote host +# Durning tests in zuul, zuul copies git repository to target node, however +# When running outside zuul/opendev ci env, we want to copy manifests from +# commit to remote machine as well. `local_src_dir` should be set from command +# line in anisble-playbook -e option, +# eg: ansible-playbook -e local_src_dir="/home/ubuntu/airshipctl" + + +- name: sync repository + synchronize: + delete: true + dest: "{{ remote_work_dir }}" + recursive: true +# trailing slash "/" is needed to copy contents of the directory not directory itself. + src: "{{ local_src_dir }}/" + no_log: true