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 in Ansible by Ruth
8 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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 by Haider

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer

Why do people use Ansible roles?

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

answered Mar 12 in Ansible by Yamini
29 views
0 votes
1 answer
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 in Ansible by William
12 views
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer

Install multiple roles - Ansible

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

answered Jan 9 in Ansible by Rishi
84 views
0 votes
1 answer

Install ansible galaxy roles

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

answered Jan 9 in Ansible by Disha
46 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.