Skip to content

List keystores, create facts JSON, and put that info under /etc/ansible/facts.d

License

Notifications You must be signed in to change notification settings

staylorx/ansible-role-keystore-facts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Role Name

This runs the Java keytool against keystores and creates fact files in the /etc/ansible/facts.d folder. Will automatically remove expired certs if you like. Will log to syslog if you like.

Installation

A requirements.yml file might have this in it:

  - src: https://github.com/staylorx/ansible-role-keystore-facts
    version: master
    name: staylorx.keystore-facts

Alternatively clone the repo into your roles folder which has its own charm.

Place a .gitmodules file in your git repo with this,

  [submodule "roles/staylorx.keystore-facts"]
    path = roles/staylorx.keystore-facts
    url = [email protected]:staylorx/ansible-role-keystore-facts.git
    branch = master

Requirements

The script assumes Java has been installed, specifically the keytool program.

Role Variables

A Java home with keytool in bin:

java_home: /usr/java/latest.

Automatically remove expired certs:

auto_cert_remove: false

Log to the system log with 'logger':

auto_cert_logger: true

A keystore list. The name is used in the fact file (viz., keystore-{{ item.name}}.fact).

    keystores:
      - name: DemoIdentity
        path: "/u01/app/oracle/middleware/wlserver_10.3/server/lib/DemoIdentity.jks"
        storepass: "DemoIdentityKeyStorePassPhrase"
      - name: DemoTrust
        path: "/u01/app/oracle/middleware/wlserver_10.3/server/lib/DemoTrust.jks"
        storepass: "DemoTrustKeyStorePassPhrase"
      - name: cacerts
        path: "/u01/jdk1.7.0_85/jre/lib/security/cacerts"
        storepass: "changeit"

Dependencies

No Ansible-Galaxy dependencies.

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: weblogic
  roles:
     - role: staylorx.keystore-facts
       auto_cert_remove: true

License

MIT

Author Information

An optional section for the role authors to include contact information, or a website (HTML is not allowed).

About

List keystores, create facts JSON, and put that info under /etc/ansible/facts.d

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages