Sounds like you should just configure that one server directly and missed
the part of Ansible that allows managing specific host groups.

- hosts: name_of_server
  roles:
    - ...

What you have above, say if you had 500 hosts, would run each step 500
times and likely overwhelm that server.



On Fri, Oct 3, 2014 at 1:12 PM, Dmitry Makovey <[email protected]> wrote:

> I've got a case where I'd like to delegate contents of entire role over to
> another box. Adding "delegate_to" to every task seems strenuous and not
> reusable since I may use this role without delegation.
>
> My attempt at simulating what is done with { role: X, tags: A } did not
> succeed:
>
> $ cat roles/delegated_role/tasks/main.yml
> ---
>
> - name: Simple echo
>   shell: hostname
>   # delegate_to: "{{ central_server }}"
>
> $ cat test_delegate.yml
> ---
>
> - hosts: all
>   roles:
>   - { role: delegated_role, delegate_to: "{{ central_server }}" }
>
> yet invocation with
>
> $ ansible-playbook -vvv -u root -e 'central_server=foo.bar' -i inventory
> test_delegate.yml
>
> yields results obtained from the server mentioned and not from
> 'delegated_to'. Obviously uncommenting "delegate_to" line within a role
> yields desired results but that means I can't reuse and it's a copy-paste
> exercise to transfer a role into a delegated role.
>
> Am I doing it the wrong way? Am I applying a wrong pattern here or is
> there a different way to blanket-apply things like that?
>
> --
> 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 post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/d7b32c05-6ab4-4c98-a7b0-54779631371e%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/d7b32c05-6ab4-4c98-a7b0-54779631371e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzz9c0X6ZfiC0VDDy3-zAm9NAb3C4ews56hEZuEmXn05A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to