Skip to content

Commit

Permalink
deploy: add --libcloud-ssl-cert and --os-userdata options
Browse files Browse the repository at this point in the history
Signed-off-by: Kyr Shatskyy <[email protected]>
  • Loading branch information
Kyr Shatskyy committed Jan 10, 2022
1 parent dfe85dc commit d1d50a2
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions teuthology/deploy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
--domain <domain> Target nodes domain name
-C, --teuthology-config <path> Use teuthology-config on deployment node
-L, --libcloud-config <path> Extra teuthology yaml file
--libcloud-ssl-cert <path> Path to libcloud ssl cert file, for example:
/usr/share/pki/trust/anchors/SUSE_Trust_Root.crt.pem
--dispatcher <jobs> Deploy dispatcher with given job limit.
--workers <num> Deploy given number of workers.
--targets <num> Add targets to the platform.
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d1d50a2

Please sign in to comment.