---
  - name: Check if PEM files are present
    stat:
      path: "/etc/pki/ca-trust/source/anchors/GSF_root_chain_CA.pem"
    register: PEM_file

  - name: copy PEM file from master to agent
    copy:
      src: "data/GSF_root_chain_CA.pem"
      dest: /etc/pki/ca-trust/source/anchors/GSF_root_chain_CA.pem
      owner: root
      group: root
      mode: u=rw,g=r,o=r
      backup: yes
    when: not PEM_file.stat.exists
    notify: update-ca-trust

  # - name: command update-ca-trust
  #   command: update-ca-trust
  #   when: not PEM_file.stat.exists


  - debug:
      msg:
        - "pas de traitement pour {{inventory_hostname}}, PEM deja present"
    when:  PEM_file.stat.exists
