From e254cfafe2b7c027ca3f30d67936cfc422259b44 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 1 Oct 2020 19:46:24 +0800 Subject: [PATCH] ceph-deploy-build: inject chacractl credentials otherwise we would have requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://chacra.ceph.com/binaries/ceph-deploy/test/c6ff0a05523cdeda86ebac732dd186620261dc01/centos/7/source/ when posting the created package to chacra Signed-off-by: Kefu Chai --- ceph-deploy-build/build/setup | 4 +++- ceph-deploy-build/config/definitions/ceph-deploy-build.yml | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ceph-deploy-build/build/setup b/ceph-deploy-build/build/setup index 7a0baed3..a1fa6a8c 100644 --- a/ceph-deploy-build/build/setup +++ b/ceph-deploy-build/build/setup @@ -24,5 +24,7 @@ fi pkgs=( "chacractl>=0.0.21" ) install_python_packages "pkgs[@]" +# ask shaman which chacra instance to use +chacra_url=`curl -u $SHAMAN_API_USER:$SHAMAN_API_KEY https://shaman.ceph.com/api/nodes/next/` # create the .chacractl config file using global variables -make_chacractl_config +make_chacractl_config $chacra_url diff --git a/ceph-deploy-build/config/definitions/ceph-deploy-build.yml b/ceph-deploy-build/config/definitions/ceph-deploy-build.yml index 6ff60a69..f071007f 100644 --- a/ceph-deploy-build/config/definitions/ceph-deploy-build.yml +++ b/ceph-deploy-build/config/definitions/ceph-deploy-build.yml @@ -45,3 +45,10 @@ - inject-passwords: global: true mask-password-params: true + - credentials-binding: + - text: + credential-id: chacractl-key + variable: CHACRACTL_KEY + - text: + credential-id: shaman-api-key + variable: SHAMAN_API_KEY -- 2.47.3