你怎么能failed_when基于stdout异步Ansible任务?我尝试过各种变化:
- name: Run command
command: arbitrary_command
async: 3600
poll: 10
register: result
failed_when: "Finished 'command'" in result.stdout
Run Code Online (Sandbox Code Playgroud)
这导致:
fatal: [localhost] => error while evaluating conditional: "Finished 'command'" in result.stdout
Run Code Online (Sandbox Code Playgroud) 使用 Google Cloud IAM api,我正在为服务帐户生成 PKCS12 私钥。默认情况下,密钥密码是“notasecret”。如何以编程方式将其更改为更安全的内容?
import com.google.api.services.iam.v1.model.*;
Iam iam = googleIamClient(googleAppCredentials()); // helper method
String name = "projects/" + projectId + "/serviceAccounts/" + serviceAccountEmail;
CreateServiceAccountKeyRequest req = new CreateServiceAccountKeyRequest();
req.setPrivateKeyType("TYPE_PKCS12_FILE");
ServiceAccountKey key = iam.projects().serviceAccounts().keys().create(name, req).execute();
// equivalent to: byte[] privateKeyByteData = Base64.getDecoder().decode(serviceAccountKey.getPrivateKeyData());
byte[] privateKeyData = key.decodePrivateKeyData();
// what now?
Run Code Online (Sandbox Code Playgroud)