From 2d9ac874730722f9e7fc3e1266e4aaf3bc80ff8f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <Joerg.Sachse@slub-dresden.de>
Date: Wed, 4 Aug 2021 09:00:16 +0200
Subject: [PATCH] feat: write IBMSP password file before first use and startup
 dsmcad service

---
 tasks/install_ibmsp_client.yml | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/tasks/install_ibmsp_client.yml b/tasks/install_ibmsp_client.yml
index e8ae4b7..204c50e 100644
--- a/tasks/install_ibmsp_client.yml
+++ b/tasks/install_ibmsp_client.yml
@@ -48,6 +48,25 @@
     - "dsm.sys"
   notify: restart dsmcad
 
+# - based on Michail Angelos Simos' Ansible Role:
+#   https://github.com/mikesimos/tsm-client.git
+# - dsmc CLI arg ducumentation can be found at:
+#   https://publib.boulder.ibm.com/tividd/td/TSMC/GC32-0789-01/en_US/HTML/ans5000016.htm#HDRCMD6036
+- name: write password file
+  command:
+    #use: dsmc set password       <Old PW>               <New PW>
+    cmd: "dsmc set password {{ ansible_hostname }} {{ ansible_hostname }}"
+    creates: "/etc/adsm/TSM.sth"
+  register: dsmc_result
+  failed_when: (dsmc_result.rc != 0) and (dsmc_result.rc != 8)
+  notify: restart dsmcad
+
+- name: Start dsmcad service. This service triggers regular checks for backup schedules on the IBMSP server.
+  systemd:
+    name: "dsmcad.service"
+    state: started
+
+# check is run as a logrotage PreCmd, so no Cronjob/Timer is required
 - name: install check-backup scripts
   block:
     - name: install Git (required by Ansible builtin Git module)
-- 
GitLab