I am assuming you cut out a line too early and that you are looping over
the oscap_resultfor the last line there. You also do not mention where and
how the network share is mounted. The fetch module copies the file from the
remote to the local node. So it is equivilant to running "scp
{{ansible_user}}@{{ansible_ssh_address}}:/tmp/*_oscap_results.html
/mnt/SCAP/{{ansible_hostname}}/tmp/". So make sure that /mnt/SCAP/ is
mounted on the node you are running ansible from and that you have the
permission to create files and directories there. You might also look at
the "copy" module with "remote_src: True" if the network share is mounted
on the remote node.
On Saturday, May 18, 2019 at 12:10:46 AM UTC+2, Andy Magana wrote:
>
> I am trying to get a playbook to run the open-scap scanner but I need
> those results on the remote host to be copied over to a network share I am
> trying something like this but getting "permission denied"
>
> - name: find it
> find:
> path: /tmp/
> patterns: '*_oscap_results.html,*_oscap_arf.xml'
> register: oscap_results
>
>
> - name: copy it
> fetch:
> src: "{{ item.path }}"
> dest: /mnt/SCAP/
>
> Thanks for any tips.
>
> Andy Magana
> Oklahoma City.
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/1dd7b0ec-9ca0-46a7-8aa0-323d14108fbb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.