- name: fix tstimeline_file_delete with protected
  gather_facts: no
  hosts: cteam-psa-2020-devel cteam-psa-2020-prod ema02-efre essmann-docportal eurogate-2020-devel eurogate-2020-prod fan fan-perfact-psa-devel fan-perfact-psa-validation haseke-psa-2018-devel haseke-psa-2018-validation haseke-psa-2018-prod hofmeister-psa-2018-devel hofmeister-psa-2018-prod hofmeister-gateway law-entw law-validation law-production liberty-gate meypack-meydata-15-prod meypack-meydata-15-ent meyra-prod mit-psa-2018-devel mit-psa-2018-prod nolte-prod nolte-validation nolte-devel ottokind pflanzenrichter pflanzenrichter-devel pflanzenrichter-validation polytex-psa-2018-devel polytex-prod siemens-devel siemens-prod-mirror siemens-validation spartherm-psa-2020-prod spartherm-psa-2020-validation spartherm-psa-2020-devel spartherm-sapproda spartherm-sapprodb spartherm-spbackup spartherm-saptesta spartherm-saptestb spartherm-clnodea spartherm-clnodeb spartherm-italienfile spartherm-prodctl spartherm-prodctl-devel spartherm-prodctl-validation spartherm-prodctl-2021 spartherm-prodctl-2021-devel spartherm-prodctl-2021-validation spartherm-spad1 spartherm-spad2 ssv-gateway-test welp-psa-2018-devel welp-psa-2018-validation welp-psa-2018-prod froneri-deos-mes-01 froneri-mes-dev-01 froneri-mes-dmz-01 froneri-mes-test-01 froneri-mes-test-02 froneri-mes-test-worker-01 froneri-mes-test-worker-02 froneri-mes-template froneri-mes-prod-01 froneri-mes-prod-02 froneri-mes-prod-03 froneri-mes-prod-worker-01 froneri-mes-prod-worker-02 froneri-mes-prod-worker-03 froneri-mes-prod-worker-04 froneri-mes-prod-worker-05 froneri-mes-prod-worker-06 brose-cobdx008 brose-cobdx006 brose-cobdx007 brose-detdx001tun brose-shadx001 brose-2020-devel ggp-DEGGPPERFACT01 ggp-DEGGPPERFACT02 hlkf-hlkfla11 hlkf-bre-la11 hlkf-eur-la11 hlkf-eur2-la11 hlkf-han-ins-la11 hlkf-han-nat-la11 hlkf-hlkfla11t hlkf-hlkflasim hlkf-hlx-la11 hora-saturn hora-titan kaehlig mohn-media-vpn-neu mohn-media-mpa-neu mohn-media-vpn-test mohn-media-mpa-test rheinzink rheinzink-devel rossmann-2020-prod rossmann-2020-devel schaeffler-mpa-server-2020-prod schaeffler-mpa-server-2020-devel sick-deags00733 sick-deags00734 sick-deags00735 sick-deags00736 sick-deags00740 sick-deags00745 swisskrono-mpax-2020-prod webasto webasto-devel webasto-mpax-us-2020 webasto-SCNSHAVPFC1 wemhoener-gatea wemhoener-gateb wemhoener-lxclu05 wemhoener-lxclu06 wemhoener-lxclu07 wemhoener-lxclu08 wemhoener-lx-nextcloud-1 wemhoener-lx-nextcloud-2 wemhoener-mpaserver-2020-prod wemhoener-mpaserver-2020-devel wemhoener-seclogo2 wemhoener-smbad1-2018 wemhoener-smbad2-2018 pl-schwarza pl-schwarzb pl-alpina pl-alpinb pl-creme pl-inventarisierung pl-cloud pl-indiengate pl-indienweiss pl-mexikogate pl-mexikoweiss pl-polengate pl-polenweiss pl-ungarngate pl-ungarnweiss pl-usagate pl-usaweiss pl-epsschwarza pl-espschwarzb pl-epsalpina pl-epsalpinb pl-seclogon-v2 pl-chinagate pl-chinaweiss ima-sna ima-mpa-server-2018-devel ima-mpa-server-2018-validation ima-mpa-server-2018-prod ima-proxy hennecke-2018-devel hennecke-2018-prod bm bm-devel fricke-sv110 fricke-sv111 fricke-svv112 fricke-svv113 biocircle-2020-prod biocircle-2020-devel harting-at-mpa-2018-devel harting-at-mpa-2018-prod harting-e-mpax-2018-devel harting-e-mpax-2018-prod harting-digtwin harting-crimp-2020 mediseal mediseal-devel mediseal-mpa-2020-prod ema-validation-2020 perfact-ema-2020-devel
  tasks:

  - name: copy fixfile to client
    tags: copyfile
    #become: true # must run as perfact
    ansible.builtin.copy:
      src: protect_tstimeline_file_delete.sh
      dest: /home/perfact/protect_tstimeline_file_delete.sh
      mode: '0755'


  - name: execute fixfile
    tags: executefixfile
    # become: true # must run as perfact
    shell: "/home/perfact/protect_tstimeline_file_delete.sh > /home/perfact/protect_tstimeline_file_delete.out 2>&1"
    args:
      chdir: /home/perfact
      creates: /home/perfact/protect_tstimeline_file_delete.out
      

# HINT: better use ansible.builtin.script
# ehich transfers a local script and executes it remotely

     
