- name: Install CA master
  shell: pkispawn -s CA -f /tmp/test_dir/ca.cfg

- name: Install KRA master
  shell: pkispawn -s KRA -f /tmp/test_dir/kra.cfg

- name: Install OCSP master
  shell: pkispawn -s OCSP -f /tmp/test_dir/ocsp.cfg

- name: Install TKS master
  shell: pkispawn -s TKS -f /tmp/test_dir/tks.cfg

- name: Install TPS master
  shell: pkispawn -s TPS -f /tmp/test_dir/tps.cfg

- name : Stopping pki-tomcat Instance
  shell: systemctl stop pki-tomcatd@pki-tomcat.service
  notify:
  - INC_CONSTANTS

- name: Enable SignedAudit for ca and kra subsystem
  replace: dest=/etc/pki/pki-tomcat/{{ item }}/CS.cfg regexp="log.instance.SignedAudit.logSigning=false" replace="log.instance.SignedAudit.logSigning=true"
  with_items:
    - ca
    - kra
    - ocsp
    - tks
    - tps


- name: Starting pki-tomcat Instance
  service:
    name: pki-tomcatd@pki-tomcat.service
    state: started
