Hello Graeme,
One way is to make playbook which include
role and run that playbook everyday or some days using cron job.
so playbook look like:
run.yml
hosts: all
roles:
- security role
then cron job will be:
12 10 00 12 ansible-playbook run.yml
or other way is to write bash script for it.
On Monday, October 30, 2017 at 12:56:16 PM UTC-4, Graeme Crawford wrote:
>
> Hi,
>
> I'm wondering if there is an easy way to enforce that a certain role would
> be run for every host in every inventory file, without explicitly having to
> call the role from a playbook and without needing to run a command from the
> CLI to do it.
>
> My thinking is that I'd have a security role, that hardens a host and that
> if anyone else came along and created a new inventory and a new playbook
> and didn't include the security role, even when they ran a playbook against
> their new host, the security role would be run anyway.
>
> It may not be the best idea, but I am just wondering if it is possible,
> perhaps by doing something in the ansible.cfg file, (nothing is jumping out
> at me at the moment).
>
> Any feedback would be much appreciated.
>
> Thanks,
> Graeme
>
--
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/08ce8ff4-83e3-4018-84e4-897d20235fae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.