Quick question- how to run ansible-playbook on Saturday night at 12 PM and save the output in the amazon s3 bucket- “abc”?
Any update is appreciated!
Hello ,
You can schedule a ansible playbook via ansible tower by using schedule option. By using this you can schedule the job when to run.
Install aws Cli on your ansible master server and create aws credentials to communicate from ansible server to aws.
Once the setup is done. If you already have a existing s3 bucket then configure it or else create a new s3 bucket and integrate.
Regards,
Naveen
What environment are you in?
I have linux servers in a datacenter. I’d write a shell script to run the play, output to a file and copy the file to s3. Then I’d use cron to schedule the job. Of course, you’d need to use a passwordless ssh key or set up ssh-agent ahead of time to work with cron, which can be a little tricky.
So, basically how you’d schedule any task, with extra attention paid to the ssh auth.
I am in Ubuntu. Can you share template of your shell script {output to a file and copy the file to s3}. I can’t use ssh-agent as it involves windows workstations on-premises (outside aws). I tried to use it before but it’s a lot of overhead/un-reliable process.