OS-Hardening

Hi All,

I have one OS-Hardening requirement, in that we have several steps for taking backup from the remote host, so based on that I have coupld of questions these are as follows,

  1. I want to take input from User while taking backup through Ansible.
  2. Playbook will check the user belongs to particular project or not then only the user should take backup.
  3. How to use Prompt module for this type of use case?
  4. I want to save user input while running playbook in some file, how to do that?

I am new to this tool, so don’t know whether it is valid question or not.

Looking forward for reply.

Thanks & Regards
Sumit Sahay

Sumit,

What type of backups are you capturing? If you just need to capture some remote files, I would recommend using the archive module and a “with_items” block of files to archive. You can then use the fetch module to pull that archive back.

As far as #2, if you’re talking about OS groups, then a simple conditional statement should suffice. Something like “when: {{ ansible_user }} in {{ group }}”.