Execute ansible playbook periodically

0 votes
I have an ansible playbook which has two plays. I want to execute that twice periodically one after the other. Is that possible?
Jan 17 in Ansible by Harsh
95 views

1 answer to this question.

0 votes

You could use include_role, according to the documentaion:

  • Loads and executes a role as a task dynamically. This frees roles from the roles: directive and allows them to be treated more as tasks.
  • Unlike import_role, most keywords, including loops and conditionals, apply to this statement.
  • This module is also supported for Windows targets.
- name: 'Include role'
  include_role:
    name: '{{ roles}}'
answered Jan 17 by Kevin

Related Questions In Ansible

0 votes
1 answer

How do I execute a shell script and then use the result in ansible

This can work out for you: - name: ...READ MORE

answered Apr 11, 2018 in Ansible by shubham
• 6,890 points
755 views
0 votes
1 answer

Permission denied when running ansible playbook through jenkins

Jenkins uses it's own user to execute ...READ MORE

answered Jun 25, 2018 in Ansible by DareDev
• 6,810 points
654 views
0 votes
1 answer

devops , how to create user using ansible playbook

root doesn't need a password to switch ...READ MORE

answered Jul 16, 2018 in Ansible by Kalgi
• 2,620 points
106 views
0 votes
1 answer

ansible playbook: using multiple variables in loops

Use an indexed hostname, and then define ...READ MORE

answered Jul 16, 2018 in Ansible by DareDev
• 6,810 points
4,375 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
147 views
0 votes
1 answer
0 votes
1 answer

Execute a command using ansible playbook

Hey @Reshma, You can use the URI ...READ MORE

answered Jan 17 in Ansible by Sameer
170 views
0 votes
1 answer