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
97 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 in Ansible by vivek
• 530 points
6,793 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
113 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
326 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
181 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
809 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 9, 2019 in Ansible by Rishi
954 views
0 votes
1 answer

Install ansible galaxy roles

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

answered Jan 9, 2019 in Ansible by Disha
127 views