Q&A
実施したいこと
リモート先のAというユーザーでWINRMでアクセスし、Bというユーザーの権限付きのフォルダの中のファイルをansibleサーバーにフェッチしてくる。
下記実施内容です。
user: Bの権限付きフォルダの中身を一時的にAでもアクセスできる場所にコピーして、そのファイルをansibleサーバーにフェッチするというyamlを書いております。
- name: copy file to everyone touch folder win_copy: src: C:\Users\{{ user }}\AppData\Roaming\test dest: C:\{{ uuid[0] }} remote_src: yes vars: ansible_become: yes ansible_become_method: runas ansible_become_user: test ansible_become_password: test - name: fetch filezilla config files fetch: src: C:\{{ uuid[0] }}\{{ item.filename }} dest: /home/test/playbooks/ansible/ flat: yes with_items: "{{ file_list.files }}"
C:\Users\B\AppData\Roaming\testへのアクセスが拒否されました。となります。
どのように権限の設定をすればよろしいでしょうか?