Inchdev.github_deploy_key

角色名称

此角色允许您使用 GitHub API 向您的 GitHub 存储库添加或删除 SSH 密钥: https://developer.github.com/v3/repos/keys/

要求

角色变量

可以传递给此角色的变量及其简要说明如下:

github_deploy_key_readonly: true # 部署密钥是否为只读

github_api_url: https://api.github.com/repos/{{github_repository}}/keys # 不应被覆盖,用于解析 GitHub API URL

deploy_key_operation: present # present: 添加密钥,absent: 删除密钥

github_deploy_key_name: ansible-generated # 您的密钥标题

github_deploy_key: ssh-rsa foobar # 您的密钥内容(必填)


# 您可以使用用户名和密码进行身份验证(如果未启用两步验证):
github_username: myUsername
github_password: myPassword

# 或使用更推荐的方式,身份验证令牌,您可以在这里创建: https://github.com/settings/tokens

github_access_token: myAccessTokenThatIsSuperLongAndUsuallyInTheVault

依赖关系

示例剧本

- hosts: servers
  roles:
    - role: github_deploy_key
      vars:
        github_repository: owner/repo_name
        github_access_token: myAccessTokenThatIsSuperLongAndUsuallyInTheVault
        github_deploy_key: ssh-rsa tototata
        github_deploy_key_readonly: false

- hosts: servers
  roles:
    - role: github_deploy_key
      vars:
        github_repository: owner/repo_name
        github_username: myUsername
        github_password: myPassword
        github_deploy_key: ssh-rsa tototata

- hosts: servers
  roles:
    - role: github_deploy_key
      vars:
        deploy_key_operation: absent
        github_repository: owner/repo_name
        github_deploy_key_id: 4242
        github_access_token: myAccessTokenThatIsSuperLongAndUsuallyInTheVault

许可

BSD

作者信息

https://github.com/Uelb

安装
ansible-galaxy install Inchdev.github_deploy_key
许可证
Unknown
下载
127
拥有者