From d1d50a232650973de00bb1c92d41498a477467d3 Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Thu, 18 Nov 2021 20:05:53 +0100 Subject: [PATCH] deploy: add --libcloud-ssl-cert and --os-userdata options Signed-off-by: Kyr Shatskyy --- teuthology/deploy/__init__.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/teuthology/deploy/__init__.py b/teuthology/deploy/__init__.py index 3c49de78a9..bd295e8d0c 100644 --- a/teuthology/deploy/__init__.py +++ b/teuthology/deploy/__init__.py @@ -48,6 +48,8 @@ --domain Target nodes domain name -C, --teuthology-config Use teuthology-config on deployment node -L, --libcloud-config Extra teuthology yaml file + --libcloud-ssl-cert Path to libcloud ssl cert file, for example: + /usr/share/pki/trust/anchors/SUSE_Trust_Root.crt.pem --dispatcher Deploy dispatcher with given job limit. --workers Deploy given number of workers. --targets Add targets to the platform. @@ -213,6 +215,7 @@ def with_args(self, args): self.paddles_repo = args.get('--paddles-repo') self.pulpito_repo = args.get('--pulpito-repo') self.ceph_cm_ansible = args.get('--ceph-cm-ansible') + self.libcloud_ssl_cert = args.get('--libcloud-ssl-cert') libcloud_config = args.get('--libcloud-config') if libcloud_config: self._libcloud_path = Path(libcloud_config).absolute() @@ -511,12 +514,10 @@ def prepare(self, remote): author="{{ lookup('env', 'USER') }}", #ceph_repo: https://github.com/ceph/ceph.git teuthology_branch="{{ teuthology_git_ref | default('master') }}", - - - # Uncomment 'libcloud_ssl_cert_file' for SUSE based openstack clouds, - # like ECP etc.: - # - #libcloud_ssl_cert_file: /usr/share/pki/trust/anchors/SUSE_Trust_Root.crt.pem + ) + if self.libcloud_ssl_cert: + teuthology_role_config_yaml.update( + libcloud_ssl_cert_file=self.libcloud_ssl_cert, ) if self.teuthology_repo: repo = Repo(self.teuthology_repo, 'master') @@ -591,10 +592,12 @@ def create_server(self): raise Exception(f'Keypair "{keypair_name}" was not found') logging.info(f'Found keypair with id: {keypair.id}') - userdata_path = Path(__file__).absolute().parent.joinpath('openstack/userdata-ovh.yaml.orig') - - with open(userdata_path) as f: - userdata = f.read() + userdata_file = self.args.get('--os-userdata') + if userdata_file: + userdata_path = Path(userdata_file) + else: + userdata_path = Path(__file__).absolute().parent.joinpath('openstack/userdata-ovh.yaml.orig') + userdata = userdata_path.read_text() params = dict( name=self.deployment_node,