小编use*_*691的帖子

多个 aws 帐户的 Datadog AWS 集成

我有两个 AWS 账户,我能够使用 Terraform 为第一个账户设置 AWS 集成,但是当我尝试为我的第二个账户创建 AWS 集成时出现错误。

我创建了一个具有内联策略的角色,但我们没有设置跨帐户。

! Datadog is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::xxxxxxxxxx:role/DatadogAWSIntegrationRole. See http://docs.datadoghq.com/integrations/aws/
Run Code Online (Sandbox Code Playgroud)

信任关系:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::xxxxxxxxxxxx:root"
      },
      "Action": "sts:AssumeRole",
      "Condition": {
        "StringEquals": {
          "sts:ExternalId": "xxxxxxxxxxxxxxxxxxxxxxxxxx"
        }
      }
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

谁能指导我如何解决这个错误?

amazon-web-services amazon-iam datadog

2
推荐指数
1
解决办法
2470
查看次数

如何在 dsl 中使用 jenkins 插件获取用户名和密码?

我是 jenkins 新手,我正在尝试使用凭证插件在 dsl 中使用凭证

模板.xml

<com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl>
      <scope>GLOBAL</scope>
      <id>PROD</id>
      <description>prod credentials</description>
      <username>prod</username>
      <password>{{ encrypted_password_prod }}</password
</com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl>
Run Code Online (Sandbox Code Playgroud)

我已在 jenkins 中将凭据定义为 username with password 。上述加密值保存在ansible中。

我的问题是我应该如何在我的 dsl 中调用它们

Map credentials = [:]

credentialsBinding {
                    credentials.each { key, value ->
                        string("${key}", "${value}")
                    }


.credentials(["TF_VAR_username": "PROD" ,"TF_VAR_password" : "password_prod"])
Run Code Online (Sandbox Code Playgroud)

错误:

22:11:16 致命:凭证“PROD”的类型为“带密码的用户名”,其中预期为“org.jenkinsci.plugins.plaincredentials.StringCredentials”

jenkins jenkins-plugins jenkins-job-dsl jenkins-groovy

2
推荐指数
1
解决办法
1万
查看次数

zcat 在 ansible-playbook 中失败

我正在尝试导入失败的架构,请建议我解决此错误

- name: Import the initial schema
  command: zcat /usr/share/doc/zabbix-server-mysql-3.2.5/create.sql.gz | mysql -uzabbix -p zabbix

TASK: [zabbix-server | Import the initial schema] *****************************
failed: [10.100.140.120] => {"changed": true, "cmd": ["zcat", "/usr/share/doc/zabbix-server-mysql-3.2.5/create.sql.gz", "|", "mysql", "-u", "zabbix", "-p", "zabbix",   "zabbix"], "delta": "0:00:00.003563", "end": "2017-05-01 11:03:46.004996", "rc": 1, "start": "2017-05-01 11:03:46.001433", "warnings": []}
stderr: gzip: invalid option -- 'u'
Try `gzip --help' for more information.
Run Code Online (Sandbox Code Playgroud)

我的日志显示 zabbix.users 不存在

3862:20170501:112105.959 using configuration file: /etc/zabbix/zabbix_server.conf
  3862:20170501:112105.962 [Z3005] query failed: [1146] Table 'zabbix.users' doesn't exist [select …
Run Code Online (Sandbox Code Playgroud)

zabbix zcat ansible

1
推荐指数
1
解决办法
1173
查看次数

检查文件的真实性

我具有下载脚本文件的角色,如何在执行之前使用md5sum检查文件的真实性?

- name: Add xx official repository for ubuntu/debain
  get_url:
     url:  https://script.deb.sh
     dest: /opt/script.db.sh

- name: Execute the script
  script: /opt/script.db.sh
Run Code Online (Sandbox Code Playgroud)
  • 我想在下载文件之前检查真实性-这可以在ansible中实现吗?

ansible ansible-2.x

1
推荐指数
1
解决办法
2108
查看次数