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
32 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 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
60 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
42 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
217 views
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
360 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
68 views