I put the setting in my ansible.cfg. I tend to use small roles and import
each role as needed in a playbook so I'm not sure how that would work with
just roles. If you are trying to use RH Satellite then that has a different
ansible.cfg than the standard (in /etc/foreman-proxy/ansible.cfg)

You can also put it in the playbook

  hosts: all
  strategy: free

I put the forks in the command-line as --forks 50 or whatever. There is a
small calculation that you can find on line (basically ncpus * 4 = number
of forks but also if you have a chunk of memory then you can increase it)

Regards
David

On Mon, 27 Jun 2022 at 12:16, Shweta Krishnan <[email protected]>
wrote:

> Hello David!
>
> Thank you for the link. Would this strategy and fork option work for roles
> as well?
> In the user guide, there was no mention of roles, that's why I asked.
>
> On Sunday, June 26, 2022 at 5:57:42 PM UTC-4 [email protected] wrote:
>
>> Morning Shweta,
>>
>> This is documented here
>> https://docs.ansible.com/ansible/latest/user_guide/playbooks_strategies.html
>>
>> Regards
>> David
>>
>> On Mon, 27 Jun 2022 at 06:16, Shweta Krishnan <[email protected]>
>> wrote:
>>
>>> New ansible user here.
>>>
>>> After deploying VMs, I want to run a folder called configs on the Jump
>>> server to components like Syslog, NTP etc. for post configurations.
>>>
>>> This is the structure of how files are in the config folder
>>> configs/
>>> ├─ hosts
>>> ├─ group_vars
>>> ├─ playbook.yml
>>> ├─ roles/
>>>        ├─ Ntp/
>>>                ├─ tasks/
>>>                ├─ vars/
>>>        ├─ Syslog/
>>>                ├─ vars/
>>>                ├─ tasks/
>>>
>>> This is how it is my main playbook - playbook.yml
>>> - name: Setup config for ntp
>>>  hosts: comp1
>>>  roles: - comp1
>>>
>>>  - name: Setup config for syslog
>>>  hosts: comp2
>>>  roles: - comp2
>>>
>>> Right now I run this command
>>>
>>> ansible-playbook -i hosts playbook.yml --limit "ntp,syslog"
>>>
>>> this runs the tasks sequentially. How can I execute this in parallel
>>> considering there is no dependency between the components?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/835db2cd-ba3f-4987-abef-98486d068b96n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/835db2cd-ba3f-4987-abef-98486d068b96n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>> if in trouble, or in doubt
>> run in circles, scream and shout
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/88ca0901-4bb6-45a5-ab00-9deb908c1cacn%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/88ca0901-4bb6-45a5-ab00-9deb908c1cacn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
if in trouble, or in doubt
run in circles, scream and shout

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2B8iFp6tv%2BzaoOdd8wsaG%2BQ4s6_GR57edMR-NEQkQREA4F-CaQ%40mail.gmail.com.

Reply via email to