On Tue, Apr 23, 2019, at 8:22 PM, Naren wrote:
> Continuation to previous updated issue...
>
> What I observed is - ansible is always picking "last" group in the test.ini
> file
>
If a single host is in multiple groups, the last definition of a variable wins.
When you specify a group to
Continuation to previous updated issue...
What I observed is - ansible is always picking "last" group in the test.ini
file
I have changed the order of groups, below is the complete contents of .ini
file
$ cat test.ini
[root]
host1 ansible_user=root
[mt]
host1 ansible_user=applmgr
[db]
host1
Provided my inventory file at the end
Below 3 commands are returning same output, that is, "applmgr" user's
information rather than their corresponding "ansible_user" info
1) ansible -i test.ini db -m shell -a 'id;pwd;ls;hostname'
2) ansible -i test.ini mt -m shell -a 'id;pwd;ls;hostname'
3)
Thanks so much, it worked
however, still having issue with a specific group, let me re-review and
see..
Thanks again and Regards,
Naren
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Development" group.
To unsubscribe from this group and stop
Thanks so much, it worked
however, still having issue with a specific group, let me re-review and
see..
Thanks again and Regards,
Naren
On Tuesday, April 23, 2019 at 11:50:08 PM UTC+5:30, Matt Martz wrote:
>
> Do you have `ansible_user` defined in your `hosts.ini` file? If so, the
>
So this is a very corner case to support, not something I think we
should do in main code, since 'single inventory' host is the
exception, not the rule.
As for running the playbook to get vars used, this might be misleading
as the vars defined and used can change dynamically per run, so it
will
Do you have `ansible_user` defined in your `hosts.ini` file? If so, the
inventory var will win over the CLI value. See
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable
On Tue, Apr 23, 2019 at 12:55 PM Naren wrote:
>
I am expecting "id" command to show the user details passed to "-u >
uid=500(oracle) gid=500(dba) groups=500(dba)
$ ansible -i hosts.ini db -u *oracle* -m shell -a id
host1 | SUCCESS | rc=0 >>
uid=500(oracle) gid=500(dba) groups=500(dba)
$ ansible -i hosts.ini db -u *applmgr* -m shell -a id
Brian, thanks for the reply.
In this case, there will always be only a single item in the inventory
(a container) so I don't worry about scalability/performance right
now.
The workflow I am aiming for here is the following:
1. Write a playbook
2. Stuff container image metadata into vars
3.
No, callbacks were never intended to access ALL vars, just to receive
specific events and each one should have the proper information
associated with it. Consider that ALL vars means the full inventory,
every host and every variable associated to that host, on top of any
other variables defined in
10 matches
Mail list logo