snieking.keystore_truststore

Ansible 角色: Keystore Truststore

构建状态

这是一个用于创建带有自签名证书的 keystore 和 truststore 的 Ansible 角色。

要求

主机上需要安装 Java,并配置 JAVA_HOME。

主机上需要安装 OpenSSL。

主机上需要安装 Pip。请查看示例 Playbook。

角色变量

ca_path: /tmp/testCA
默认值: yes
证书颁发机构(Certificate Authority)应存在的目录。

trusted_ca_path:
默认值: no
应导入到 truststore 的可信证书颁发机构(认证文件)的路径。

expiration_days: 365
默认值: yes
证书的过期时间(以天为单位)。

common_name:
默认值: no

country:
默认值: no

state:
默认值: no

locality:
默认值: no

organization:
默认值: no

organizational_unit:
默认值: no

keystore_name: keystore
默认值: yes

truststore_name: truststore
默认值: yes

clean_up:
默认值: yes
在运行之前是否进行清理。当进行清理时,所有旧证书和 keystore 将被删除。

示例 Playbook

以下 Playbook 使用我们提供的配置创建并签署证书。CN、C、ST、L、O 和 ON 应根据需要进行设置。在服务中,我们可以配置证书应适用于哪些服务和备用名称。

- hosts: localhost
  connection: local
  vars_prompt:
    - name: "keystore_password"
      prompt: "请输入 keystore 的密码"
  pre_tasks:
    - name: 确保已安装 pip
      easy_install: { name: pip, state: latest }
      become: yes
  roles:
    - role: snieking.keystore_truststore
      trusted_ca_path: /my/trusted/ca-path/
      clean_up: no
      common_name: thecuriousdev.org
      country: SE
      state: Stockholm Country
      locality: Stockholm
      organization: thecuriousdev
      organizational_unit: blog
      alt_names:
        - "DNS.1  = testservice"
        - "DNS.2  = localhost"
        - "IP.1   = 127.0.0.1"

许可证

BSD, MIT

作者信息

Viktor Plane https://thecuriousdev.org

关于项目

An Ansible Role for creating a keystore and truststore with self-signed certificates.

安装
ansible-galaxy install snieking.keystore_truststore
许可证
Unknown
下载
372
拥有者