From 3cda8600a5d1c3f4f4dd10e6b6caac1b5c8a043b Mon Sep 17 00:00:00 2001 From: baigk Date: Mon, 25 Jan 2016 17:38:01 +0800 Subject: [PATCH] support copy roles dir copy role dir to virtual env Change-Id: I5e89cab526dfc7c7b3527e5934254c69a6635a82 Signed-off-by: baigk --- .../ansible_installer/ansible_installer.py | 14 +++++--------- conf/package_installer/ansible-juno.conf | 2 +- conf/package_installer/ansible-kilo.conf | 2 +- conf/package_installer/ansible-liberty.conf | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/compass/deployment/installers/pk_installers/ansible_installer/ansible_installer.py b/compass/deployment/installers/pk_installers/ansible_installer/ansible_installer.py index dadfe1f2..45961f9d 100644 --- a/compass/deployment/installers/pk_installers/ansible_installer/ansible_installer.py +++ b/compass/deployment/installers/pk_installers/ansible_installer/ansible_installer.py @@ -267,16 +267,12 @@ class AnsibleInstaller(PKInstaller): dirs = self.runner_dirs files = self.runner_files for dir in dirs: - items = dir.split(':') - src, dst = items[0], items[-1] - if not os.path.exists(os.path.join(self.ansible_dir, src)): + if not os.path.exists(os.path.join(self.ansible_dir, dir)): continue - - shutil.copytree( - os.path.join(self.ansible_dir, src), - os.path.join( - ansible_run_destination, - dst + os.system( + "cp -rf %s %s" % ( + os.path.join(self.ansible_dir, dir), + ansible_run_destination ) ) for file in files: diff --git a/conf/package_installer/ansible-juno.conf b/conf/package_installer/ansible-juno.conf index 10031b28..0c74b2ed 100644 --- a/conf/package_installer/ansible-juno.conf +++ b/conf/package_installer/ansible-juno.conf @@ -8,6 +8,6 @@ SETTINGS = { 'inventory_file': 'inventory.yml', 'group_variable': 'all', 'etc_hosts_path': 'roles/common/templates/hosts', - 'runner_dirs': ['roles','openstack_juno/templates:templates'] + 'runner_dirs': ['roles','openstack_juno/templates','openstack_juno/roles'] } diff --git a/conf/package_installer/ansible-kilo.conf b/conf/package_installer/ansible-kilo.conf index 6a465d9f..cfe21478 100644 --- a/conf/package_installer/ansible-kilo.conf +++ b/conf/package_installer/ansible-kilo.conf @@ -8,6 +8,6 @@ SETTINGS = { 'inventory_file': 'inventory.yml', 'group_variable': 'all', 'etc_hosts_path': 'roles/common/templates/hosts', - 'runner_dirs': ['roles','openstack_kilo/templates:templates'] + 'runner_dirs': ['roles','openstack_kilo/templates','openstack_kilo/roles'] } diff --git a/conf/package_installer/ansible-liberty.conf b/conf/package_installer/ansible-liberty.conf index 48bc018d..f0c8fb39 100644 --- a/conf/package_installer/ansible-liberty.conf +++ b/conf/package_installer/ansible-liberty.conf @@ -8,6 +8,6 @@ SETTINGS = { 'inventory_file': 'inventory.yml', 'group_variable': 'all', 'etc_hosts_path': 'roles/common/templates/hosts', - 'runner_dirs': ['roles','openstack_liberty/templates:templates'] + 'runner_dirs': ['roles','openstack_liberty/templates','openstack_liberty/roles'] }