Organize roles - Ansible roles

0 votes

I have two hosts - host1 and host2

I need few packages to be installed on host1 and few on host2

host1

  • rpm A
  • rpm B
  • rpm C

host2

  • rpm A
  • rpm B

How do I organize my roles to achieve this?

Mar 13, 2019 in Ansible by Ruth
719 views

1 answer to this question.

0 votes

One of the ways is to use a generic packages role and pass the rpm to install to the role as a var

generators-playbook
   - roles:
       - { role: packages, packages: ["rpmA","rpmB"] }
executor-playbook
   - roles:
       - { role: packages, packages: ["rpmC"] }
answered Mar 13, 2019 by Haider

Related Questions In Ansible

+1 vote
2 answers

What is the difference between ansible playbook and roles?

Hi, Roles: Roles containing certain vars_files, tasks, and handlers ...READ MORE

answered Jan 21, 2020 in Ansible by vivek
• 530 points
21,878 views
0 votes
1 answer

Why do people use Ansible roles?

Ansible roles are basically like functions in ...READ MORE

answered Mar 12, 2019 in Ansible by Yamini
563 views
0 votes
1 answer

Error while running playbook consisting of roles - Ansible

You get this error because ansible was ...READ MORE

answered Mar 12, 2019 in Ansible by William
2,710 views
0 votes
1 answer

Ansible roles change workflow order by moving handlers.

Flush handlers with meta: flush_handlers before the task that ...READ MORE

answered Mar 12, 2019 in Ansible by William
905 views
+15 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,059 views
+2 votes
1 answer
0 votes
1 answer

Install multiple roles - Ansible

You'll need a requirements.yaml file which will ...READ MORE

answered Jan 10, 2019 in Ansible by Rishi
2,153 views
0 votes
1 answer

Install ansible galaxy roles

Here is a very basic example that ...READ MORE

answered Jan 10, 2019 in Ansible by Disha
841 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP