Re: [ansible-devel] Re: [FEATURE REQUEST] Custom path for group_vars and host_vars in ansible.cfg

2024-07-26 Thread Brian Coca
You can just develop your own "vars plugin" that does this, the
current host_vars/group_vars is implemented via the host_group_vars
plugin included in core
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/host_group_vars_vars.html.
You can even disable the one shipped with core in favor of your own.
-- 
------
Brian Coca (he/him/yo)

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7fAAko8QgR0a0Uzu9SXDJ58m1GFoiwXSpEf56XdxsMKyA%40mail.gmail.com.


Re: [ansible-devel] Accessing inventory variables from custom connection plugin

2023-08-16 Thread Brian Coca
forgot to add, you might want to look at httpapi (netcli, netconf)
plugins, which are a variant on normal connection plugins that uses a
'local execution' and then passes the connection to the module.

Another option is 'turbo' mode from module utils which can cache
connections and cloud libraries.


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7f_9RGGb4wtx4%3DWj5Z9oGwheRVRiQg1S4j738sq6vu-OA%40mail.gmail.com.


Re: [ansible-devel] Accessing inventory variables from custom connection plugin

2023-08-16 Thread Brian Coca
I'm not sure what you are trying to do, but it looks like you are
trying to instantiate a connection plugin from a module, this is not
normally how things work.

Connection plugins are provided the vars they declare in config when
they are loaded from the task executor, trying to load/create it from
the module you bypass all this.
Also modules do not have any data not explicitly passed to them, as
they are designed to run on the 'target' and you don't want to
disclose on 'hostA' all the secrets for hostsB to hostsX, so of course
they do not have access to the variables you need.

If this was possible in 2.9, which it was not, it would have been a
major bug and security issue.

The 'working' example you show seems to get a full dictionary of the
parameters passed to the module via the 'endpoint' option, I don't see
any other way that would work.

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7du0my%3DhqMVh%2BOygJJy4NbyUMwa_uJnQ7hnnKFM8e8vTA%40mail.gmail.com.


Re: [ansible-devel] Re: Using Ansible how to connect Oracle DB on Linux & run command "show pdb" to display oracle pluggable DB, "shutdown immediate" to stop DB and start DB

2023-07-24 Thread Brian Coca
Several things seem to be off with your output, it looks like a
recursive copy into itself, aside from that, the base error does not
seem to match the commands shown:

'cmd': ucat: No such file or directory", "cut: fields are numbered
from 1", "Try 'cut --help' for more information.

Looks like typo in a shell command/script (meant `cat`?) or `ucat` is
not in the PATH


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7d4wFwzx7iX2KYBEcOrsxrU3ogmaUqesA5XLyGgqsDTdA%40mail.gmail.com.


Re: [ansible-devel] sshconnection vs terminal vs httpapi vs shell plugins

2023-07-10 Thread Brian Coca
That is not something I feel i can give advice on as I don't know the
product well and have no idea about your resource availability and
objectives.

Context is everything and as an outsider I barely have a sliver of it
nor will you be able to give me enough in a few emails to give you
relevant advice.


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7fSgMQ5oZoGHSJCSKcozjsyPv4nYJTMoU_N6uKrY7uTBA%40mail.gmail.com.


Re: [ansible-devel] sshconnection vs terminal vs httpapi vs shell plugins

2023-07-06 Thread Brian Coca
shell plugins are basically for dealing with common commands in
different shell environments, i.e create a temp dir, figure out the
remote user home, etc

terminal plugins are really regex for matching prompts when not using
a shell, they are for use with netcli/net_conf plugins

httpapi/netcli/netconf plugins are "secondary connection pluigins"
that are designed to run the module under 'local' connection and have
the 2nd (true) connection to the device available to the module
itself, for it to send commands over and receive feedback (where they
might need to match against the terminal plugin).

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7d4rBWQLM7VxnAbvFhJDz4jzVZ9AWYKMNybCnZfvPYXWA%40mail.gmail.com.


Re: [ansible-devel] ansible_failed_task logs private variables

2023-06-13 Thread Brian Coca
There is no concept of 'private variables' in Ansible, we do have
'no_log' for module parameters (or at a task level, but this does not
seem to be this case). The `no_log` at the module level will handle
any returns or log data from the module, but does not affect any
variables that had been fed into it.

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7cdKS1egWrcjBJGPYAOuxZmJCvnGnav623fVYPrQrKBbQ%40mail.gmail.com.


Re: [ansible-devel] Inventory group not getting created when using add_host and one of the iteration of task fails.

2023-03-06 Thread Brian Coca
it is not really effective until the 'next play' as modifying the
current play's data is very problematic.

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7fppTQy4r8bTe_wn%2B6X4ozSnRDmKfZYA%3DKVXZr6%2BykvCA%40mail.gmail.com.


Re: [ansible-devel] How to have ansible collection installed in the "edit mode"?

2023-02-22 Thread Brian Coca
ls -l ~/.ansible/collections/ansible_collections/
total 20
lrwxrwxrwx 1 bcoca bcoca   54 Oct  7  2021 bcoca ->
/home/bcoca/work/collections/ansible_collections/bcoca

On Wed, Feb 22, 2023 at 3:45 PM Brian Coca  wrote:
>
> symlinks do work, but you still need an ansible_collections/ dir
> before your collection
>
>
>
>
> --
> --
> Brian Coca



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7cBZAQYmCPfcAo%2BW1H5q1U7E4ztx8_MjY50HP4Rq-K9pg%40mail.gmail.com.


Re: [ansible-devel] How to have ansible collection installed in the "edit mode"?

2023-02-22 Thread Brian Coca
symlinks do work, but you still need an ansible_collections/ dir
before your collection




-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7cNsccmPRYWqKExOWn1Q%3Da7E2iSgXpEjXOa16MjcsK%2BVg%40mail.gmail.com.


Re: [ansible-devel] ansible roles and custom module structure

2023-02-21 Thread Brian Coca
sorry, wrong link before
https://docs.ansible.com/ansible/latest/dev_guide/developing_module_utilities.html



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7cg9UAOunUi0YnFtLS2ku3KjrZtZBVEXO%3DAV-16RPeoyA%40mail.gmail.com.


Re: [ansible-devel] ansible roles and custom module structure

2023-02-21 Thread Brian Coca
That won't work as modules can only rely on code in themselves and
module_utils, this is because they are designed for remote execution
so Ansible creates a 'package' to deliver on the remote host and
execute. It is not feasable to follow any/all imports of code as you
can end up with something unusable, hence the limitation to only
depend on code in module_utils/.
https://docs.ansible.com/ansible/latest/reference_appendices/module_utils.html


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7dTe9sh6ndknN%2BjXJjm8u2GndCDgVkGnbfEWKqEnpCXKg%40mail.gmail.com.


Re: [ansible-devel] The future of deep collection folder structures

2023-02-21 Thread Brian Coca
While we support the deep structures, we do not recommend their use,
having more small more targeted collections is generally better than
having one huge one. community.general itself is an exception as it
was a dumping ground for all the old core plugins that could not find
a home in their own collection.
-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7fCO%3DbWu2UF0D17Qsq-gQsp%2B1rUncKH3N%3DHxpqB9RHVsQ%40mail.gmail.com.


Re: [ansible-devel] YAML File check

2023-01-12 Thread Brian Coca
Most yaml linters will only tell you if the file is valid YAML and to theri
opinion/spec, which is not always what Ansible uses, we relly on pyyaml
which is following YAML 1.1 spec.

You have ansible-lint as a general tools, but if you just want a quick test
for playbooks `ansbile-playbook --syntax-check playbook.yml `, for vars
files i would use `ansbile -m include_vars `, for roles `ansbile -m
import_role ...`

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7d64xPMLN2Pg4DtAvy7awUe4AEYaT4OtVtBaVG7_%3DND_A%40mail.gmail.com.


Re: [ansible-devel] how to run command that cannot create files?

2022-11-08 Thread Brian Coca
Also, if the built in command does not do exactly what you want, you
are free to create your own custom version, it just not make sense for
this in the core offering.

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7d%3DqEALt%2BhQaQku9qZWU1uM%2BaihRaNKkGoJHms2QhJHLw%40mail.gmail.com.


Re: [ansible-devel] how to run command that cannot create files?

2022-11-08 Thread Brian Coca
Tracking files that are not the normal side effect of a command are a
poor way to track if a command was executed, the best way is to track
the expected side effect of such a command (creates/removes does this
by assuming those files are created/removed by the command's
execution). There are other side effects that you can track, but hard
to build them all into the command/shell modules (open port/service
running/package installed/etc)  but there are plenty of other actions
that can query this.
-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7dXu8pEBMU4PnhbYStTLp2B8T2A-mFG76EbPu62UXOK9Q%40mail.gmail.com.


Re: [ansible-devel] edit/create encrypted vars in python script (vault encrypt_string)

2022-08-31 Thread Brian Coca
Modules should not have direct access to vault secrets, but you can
provide them to module options via the unvault/vault filters: (last
ones in section)

https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#hashing-and-encrypting-strings-and-passwords
-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7dRX82Oc147NujazFEheocccrkwKPgOq7FA_f7SQVoK%2Bw%40mail.gmail.com.


Re: [ansible-devel] how to read the ansible.cfg file variables in ansible custom modules

2022-08-03 Thread Brian Coca
It is possible, just not via the variable, do `import sys;
sys.version_info < (3, 0)`, since that will reflect the python the
script is running under.

--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7eVkbanBhv9YFiwAj9XaFNdX9n_KQn4z%2BL-CnEt0ejaoQ%40mail.gmail.com.


Re: [ansible-devel] Share data between lookup plugin instances

2022-08-03 Thread Brian Coca
There is no facility to do this, you would have to save/read a file
like the password lookup does.
Another option is to have a task that does the login and registers the
token into a variable (via register: or returning ansible_facts).

FYI, each lookup does not have it's own python instance, but each
task/host has it's own fork.

------
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7eY5H53k1Mmin9asWc6nsBL9ETRsynqg%3D7uFCxU1QwMCw%40mail.gmail.com.


Re: [ansible-devel] Support for functions for complex expressions

2022-07-14 Thread Brian Coca
Mostly i was thinking for the use of in templates, the only other
thing i can think of is using 'intermediate vars' to keep reusable
expressions and then creating their input when needed:

- play:
  vars:
  merged_list: "{{ (lookup('vars', *query('varnames',
merge_pattern$')) + [testlist_initial_value]) |
flatten(levels=merge_flatten_levels|default(1)) }}"


 -  name: also works with 'vars' in other scopes, using set_fact to
get 'static value'
   set_fact:
   mylist: '{{merged_list}}'
   vars:
 testlist_initial_value: [10,11]
 merge_pattern: '^.+_merge_list'
  a_merge_list: [1,2,3]
  b_merge_list: [4,5,6]


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7c1aBURhLfx9sNYcXn_gqAodJdEcyC2KBKQxu%2BreUCYzA%40mail.gmail.com.


Re: [ansible-devel] Re: A more extensible ActionModule: Split _configure_module

2022-07-14 Thread Brian Coca
A few things:

- It is not just the 'python interpreter', modules can be written in
any language or even be binaries, modules that 'ship with Ansible' are
Powershell and Python, but that is not a limitation of the engine,
which makes it even harder to deal with.

- As much as 'per command granular permissions' would be nice to have,
it is almost impossible given the nature of the dynamic payload and
the reliance on systemcalls other than shell

- I had a working branch with something close to what you desire, but
using 'sudo cached credential initiator' + sudo wrapper in
'run_command' , this did not work well and basically only covered
shell/command modules when the playbook author did exactly what was
expected from them by the fine grained permissions ... which they
could do just by sudo themselves (- shell: sudo ...) in the play
instead of using become, so it never went anywhere.

This is something we have been considering for years, and after many
attempts we have not found something worthwhile merging into core. I
would argue the closest we can get to this is doing something like the
mitogen project, running the become plugins themselves at the remote
via a temporary agent, but then this also limits us to python in many
respects and removes several abilities (changing
become/connection/interpreter settings per loop item, for example).
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7cJgP7xg4%3DLWg-ZMStq-FGY%3DXtJWrK8YDpjHM8dO_gu%2BQ%40mail.gmail.com.


Re: [ansible-devel] Re: A more extensible ActionModule: Split _configure_module

2022-07-13 Thread Brian Coca
I understand the request, but the push is to separate those concerns
as both from a security and simplicity perspective, action plugins
should not be able or care about 'become settings', much less take
part in manipulating module input.

Also note that while run_command is used by some modules, the vast
majority use APIs instead of running commands, so become is more
geared to running the modules themselves vs what the modules might
shell out to do. So while what you ask for is not w/o reason, it is a
niche use for a minority of modules and pushes against the desired
design for most other use cases.


------
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7fR2MgBj_PdLyPF8GP%2BjoAfk1r01iSpr5wiBhNNEJ_zfg%40mail.gmail.com.


Re: [ansible-devel] Support for functions for complex expressions

2022-07-13 Thread Brian Coca
Jinja2 has this already, macros
https://jinja.palletsprojects.com/en/2.10.x/templates/#macros

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7eJMoUVCENCnseyM4NGhRq%3DRPw0Ob1xg9ZFftwda4UtYg%40mail.gmail.com.


[ansible-devel] Re: A more extensible ActionModule: Split _configure_module

2022-07-12 Thread Brian Coca
Actually I was already thinking of spliting _modify_module, for one, it 
should not need/handle/know about become_kwargs and we should eliminate the 
passing of these, which is kind of the opposite direction of your 
proposal.  

As for action plugins, they already do too much and have too much 
information for their needs, we are looking at moving these things into a 
more generic/changeable 'executor' that should handle those parts and leave 
the 'action plugin' to just coordinate local and remote actions w/o having 
to deal with the details as they do now.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/905081cc-ea59-4574-aabe-0d21d38a22efn%40googlegroups.com.


Re: [ansible-devel] Looking for generic execute "once-only" practise for Automations

2022-05-11 Thread Brian Coca
Many ways, just an example:
 - in a handler update a host_vars/.yml with the list of users
already synced, notify when sync tasks run/change
 - add to sync role/block/tasks a conditional based on the variable
cdreated `when: username not in already_processed_users`



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7cNAt6P9%3DLU_%3D8bMPWnzphekqeqzJ7X2KOXmy3%2B%3DzL23Q%40mail.gmail.com.


Re: [ansible-devel] Merging GPLv3 and AGPL licensing in a module development

2022-04-27 Thread Brian Coca
To clarify, this requirement was part of the ansible package up to
version 2.9 and the split to collections and it is still a requirement
for ansible-core, but not for the current ansible package which is
community maintained and includes ansible-core + a set of selected
collections.



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7eUw9dYV%2Bd1GfY%2BPMDepfo-4FaKLhvtKM4WnUUF3XZTLA%40mail.gmail.com.


Re: [ansible-devel] KeyError: 'module_blacklist'

2022-02-21 Thread Brian Coca
you have `module_rejectlist`, but it requires `module_blacklist`




-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7esmSFDUWo3ih%3DguoBG%3DxOBUX5_0n947s82ue%2B0gS%3DWVw%40mail.gmail.com.


Re: [ansible-devel] Make an SSH connection and run a command from within the playbook

2022-01-28 Thread Brian Coca
Other than the modules themselves, not really, they use
https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/connection.py
to establish a connection via the 'ansible-conneciton' tool (which is
what actually uses the connection plugin), which exposes a socket to
the module, the module then uses jsonrpc to send/read commands sent
over that socket, which ansible-connection relays to the remote target
(while not copying any code to it).

General docs to develop these types of plugins:
 
https://docs.ansible.com/ansible/latest/network/dev_guide/developing_plugins_network.html

main dev guide
https://docs.ansible.com/ansible/latest/dev_guide/index.html

more communication channels (see network working group, they are most
likely to have better answers about this type of development )
https://docs.ansible.com/ansible/latest/community/communication.html

------
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7evJD0XtD3sR%3DHioQcSiGe-8UtSWAVDJtoxcRKjpe07ng%40mail.gmail.com.


Re: [ansible-devel] Make an SSH connection and run a command from within the playbook

2022-01-27 Thread Brian Coca
The cliconf/network_cli plugins do this, they handle the connection
internally in the module and use ssh/paramiko/libssh to interact with
the target


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7c1w3-wmnVTWbSe-ZSLwzg9x6d5mgrVHE9w%2BGjwcS_QkA%40mail.gmail.com.


Re: [ansible-devel] Classifying authentication errors within modules as an error instead of unreachable

2021-11-04 Thread Brian Coca
You can do this now w/o waiting for a new feature.

- block:
- win_ping:
  ignore_unreachable: true
  register: ping

-  name: this forces a recoverable fail
   assert:
that:
   - not ping['unreachable']|default(False)
   - # depending on connection plugin, you can inspect ping['msg']
for the specific auth errors you can rescule

rescue:
   - action: do stuff here



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7e6mCWQPvHLTkX2fsn2aY%2BkmD1i-%3DdN0WfoujFyo%2B9oPA%40mail.gmail.com.


Re: [ansible-devel] Ansible 2.9 as "critical fixes only", however, Ansible 2.9 as the only widely available distributed release?

2021-10-28 Thread Brian Coca
The core team has mostly only released packages to pypi, the Ansible
site and a PPA, never to the downstream distributions. We stopped
adding packages to our site as they were not really used and most of
the distributions had their own packages already. It made more sense
when we were still a new project that most distros didn't know about,
much less included in their repos, that is not the case anymore.
Especially now that it is almost trivial to create your own package if
needed with existing tools, just point at pypi or github for the
sources.

I'm not sure where you get your numbers about 2.9 being the 'current'
used by most, it's not even the 'current' available in many distros:

Gentoo: ansible-base 2.11.6 (this is really ansible-core but i think
packager didn't want to deal with name changes every version)
Arch: ansilbe 4.7.0-1 (community package, which includes ansbile-core 2.11.6.)
ubuntu (20.04 focal: 2.9.6
ubuntu (21.04)  hirsute: 2.10.7 (which is ansible-base)
ubuntu (21.10) impish:  2.10.7
debian bullseye: 2.10.7
freebsd 13: 2.9.23  (14 is due soon, not sure what they are using yet)

Those are just the ones I have at hand, I'm pretty sure you'll find
others with 2.9, 2.10 and 2.11 just depending on how aggressive the
distros are at updating versions and their own release schedules. As
for @sivel, he responded mostly with RH/fedora/Centos as that is what
he mostly deals with daily, I deal with the ones above, so that is
what I can respond to easily.

In the end the decision about not updating 2.9 comes to a policy,
which was created due to limited core resources, we cannot maintain X
versions forever, specially since the value of X changes depending on
who is asking, I still get requests to update 1.7 and 1.9.  We also
cannot revise it any time a distro chooses to stay on a specific
version (for example,Debian was pinning a version due to licensing in
some files not passing their tests), it just does not scale.

This policy has been clearly stated and in place for many years (you
can check the versioned documentation, it is in git after all) and I'm
confident that our record would speak against any perceived bias, as
long as you are willing to examine all the facts.


--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7e%2BTQ48YVNHt_5u3DU8sD9oGYpwf4mG7a29NMXWR1rXRQ%40mail.gmail.com.


Re: [ansible-devel] When is ansible_mounts defined?

2021-08-26 Thread Brian Coca
ansible-core 2.11 and 2.12 have many of the improvements

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7dktxb4iVVRrACvp%2BH%2Bb6N4PNNSyAv9Rp0GNLc-HOzAoQ%40mail.gmail.com.


Re: [ansible-devel] When is ansible_mounts defined?

2021-08-26 Thread Brian Coca
well, 90% of what the timeout does is monitor the mounts (almost
nothing else has these kind of issues, except networking queries ..
dns ...)

Recent version of ansible are much more verbose and informative about
the mounts, so you should get both warnings and the ansbile_mounts
var, with the ;mount + error message specific to each mount.

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7dnxvmjC47W_B%3DapoN6bmsdnDFOcbNvu2WFJcWVb1yHNA%40mail.gmail.com.


Re: [ansible-devel] When is ansible_mounts defined?

2021-08-26 Thread Brian Coca
short answer: when ansible fact gathering ran and was able to get
mount information

long answer: basically what the short answer said, but here are some
reasons Ansible was not able to get the information
- not running fact gathering
- fact gathering user not having proper permissions for reading mount info
- timeout issues when accessing mount information (common with
shared/network filesystems)
- the OS is lying to the standard tools used (commonly happens with containers)
- INJECT_FACTS_AS_VARS is set to false, in which case the info will be
in ansible_facts['mounts'] (its always there, inject just adds the
ansible_mounts alias)

To find out what exactly is happening i recommend running fact
gathering directly on the targets that you see are missing
ansible_mounts (unless it is the 'inject' issue, which is controller
configuration).


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7fpm9LiRFzXWLyidsEXzCeNT9DePDXJTzhNc9VQqPWh%3DA%40mail.gmail.com.


Re: [ansible-devel] Machine readable duration

2021-08-03 Thread Brian Coca
I was not aware of the datetime bug (was thinking to_datetime &
strftime), but it is still simple to do in jinja:

   - debug: msg='{{seconds}}'
 vars:
   d: "{{res['delta'].split(':')}}"
   seconds : "{{ d[0]|int * 3600 + d[1]|int * 60 + d[2]|float }}"


--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7dV2ert73qq0yva%2BfUKFQtX5TBNNs-o4u5Y-Q9tGaimuQ%40mail.gmail.com.


Re: [ansible-devel] How to define hosts when you integrate Ansible into external system

2021-07-02 Thread Brian Coca
You also have --limit , which avoids playbook rewrites and  per run
custom inventories


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7dFb_W1inZ%2ByDXYDDEzofFYTbewnh7toWfCqzd%2BLVk4vQ%40mail.gmail.com.


Re: [ansible-devel] python api return code. when task fails

2021-06-24 Thread Brian Coca
tasks do not use return codes, their status is reflected in the return
data dictionary as keys.

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7e0Hqc6J0Xxr14ziaKd91sX1F%3Di0Q2WJbAPrX9KCEAK6Q%40mail.gmail.com.


Re: [ansible-devel] Maximum stdout_lines in ansible

2021-06-24 Thread Brian Coca
no actual limit in code, you might be limited by resources or other
external factors.


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7cJ6MqKb8dPZNGhdbS5z5XGPMsuujP%2BuBT8HQ2snp-NwQ%40mail.gmail.com.


Re: [ansible-devel] How to document support for check mode for a module

2021-06-09 Thread Brian Coca
Just added this for 2.12 (still not final)
https://github.com/ansible/ansible/pull/73707

Also see https://github.com/ansible/ansible/pull/74331
-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7cLcR2%3DYjx9qctxKL6hac_J3o7ZrUjcTxCbZw_t%2BDBnRQ%40mail.gmail.com.


Re: [ansible-devel] Fixing architecture-specific gaps in ansible core facts?

2021-06-07 Thread Brian Coca
Well, 2 diff 'performance' considerations, target and controller, yes
filter and ignore will be the same on that side, but this is also a
problem on some targets in which accessing a fact can hang or take
very long time .. think badly performant nfs mount. Even then, target
performance can also affect the controller by occupying the forks for
too long and delaying  the play in general.

-- 
------
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7dEJX3UNMeJ4MMBSwZxKbvZWFMWBFxTzYa4LPygTmcwtQ%40mail.gmail.com.


Re: [ansible-devel] Fixing architecture-specific gaps in ansible core facts?

2021-06-07 Thread Brian Coca
I was not going to use 'filter' for that since this is an 'after
gathering' feature,  but a more 'proactive' ignore capability for each
subsystem, filter just removes the transmission of the data back to
the controller, not the actual gathering of it.

The issue with ignore, it is very dependant on the method/code used to
do the gathering, which can vary by platform, OS, distro, distro
version, etc. I have not found a good way to handle that yet.

--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7fgxqap%3DVJ5ar5-Mjvuvq781%2BO3VPva7arF9p_PGLekSA%40mail.gmail.com.


Re: [ansible-devel] Fixing architecture-specific gaps in ansible core facts?

2021-06-04 Thread Brian Coca
For now module_utils/facts/ is best place to add these.

In the long run, I hope to be able to make a bunch of 'facts modules'
and eventually deprecate 'setup.py'.
Many of the changes to fact gathering have been moving in this direction:
  - gather_facts action is now responsible for the play's gather_facts
(normally still calls setup module)
  - gather_facts supports configurable set of modules (network_os
resolution already built in)
  - gather_facts can run multiple modules in parallel




-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7dRGV-gw86qO1JUsenWi9DxFRkKD6F_bLyC66SMf0WAxA%40mail.gmail.com.


Re: [ansible-devel] "yes" as string (not boolean)

2021-05-27 Thread Brian Coca
https://hitchdev.com/strictyaml/why/implicit-typing-removed/ <= its
the opposite of yours, but same issue


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7eexTS_xf41-CBaVCpKVVvXmmy1vKHbChicKD5UgB%2Bacw%40mail.gmail.com.


Re: [ansible-devel] "yes" as string (not boolean)

2021-05-27 Thread Brian Coca
Depends, this can happen at many points and for diff reasons,  in
general `|string` filter when you consume it  ensures it is a string,
if it is happening at YAML boundry quote it or use !!str


--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7cJ1MvYEmxpJ5s1FASTsN8gUAqV-9AZN5%3DXV58q4nhkmw%40mail.gmail.com.


Re: [ansible-devel] Do we need StrageyBase._results_lock?

2021-03-24 Thread Brian Coca
note that loops are within the same subprocess, while tasks each
require their own, so there are very different performance profiles

On Wed, Mar 24, 2021 at 10:02 AM Matt Martz  wrote:
>
> I won't have time until sometime later, but note that I had 100 actual debug 
> tasks, not a loop of 100 items.
>




-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7ctUaOtr6dveLztvvHDvy1qSfKRsv7F4DNK0SbJtqXe%2BA%40mail.gmail.com.


Re: [ansible-devel] How do you find which module version is included with an Ansible release

2021-03-16 Thread Brian Coca
Up to 2.9 there is no independent version of modules included in
Ansible, after 2.10 and moving into collections you can see the
'collection version' .. but no module version yet.


-- 
------
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7dKH8EsnD-dA_mZH_4%2BVy7YbSCPnjTQE_vbvtr_pWYvgw%40mail.gmail.com.


Re: [ansible-devel] inheriting from other modules

2021-01-22 Thread Brian Coca
Just to confirm, what Andreas describes is correct, any 'shared' code
must be in module_utils, modules cannot rely on other module's code as
ONLY the current module code (+ module_utils references) is shipped to
the remote.

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7eATAZTQ5p_Q%2BQA8N9%2BqBDYfhAi8Fjva4KnSx25WRWNRQ%40mail.gmail.com.


Re: [ansible-devel] Multiple vault password

2020-07-27 Thread Brian Coca
Yes, here are the docs:
https://docs.ansible.com/ansible/latest/user_guide/vault.html#multiple-vault-passwords
-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7ehxWrHVvyfHpe1AM7waKfWgwStUU9eM88%3DOLkNQUp%3DKw%40mail.gmail.com.


Re: [ansible-devel] print volume group with highest number

2020-06-17 Thread Brian Coca
Something like this will sort the keys and use the last one.

- debug: msg={{ansible_lvm.vgs[(ansible_lvm.vgs.keys()|sorted|list)[-1]]}}

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7ecyFaUQw9yV_y8e%3DO_xwKYF%3D1BR0mJjKrApy6VKqyRNQ%40mail.gmail.com.


Re: [ansible-devel] Ansible - Unable to reach the host getting Errno 101 Network is unreachable

2020-03-30 Thread Brian Coca
not a development question. Use ansible-project ML or go to #ansible
on freenode.

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7daGJo-TLG57YX%3D_a2vDrraomM4j5QJXRgALb6KJ5daRA%40mail.gmail.com.


Re: [ansible-devel] Become plugin

2020-03-30 Thread Brian Coca
It needs a specific subdir for each plugin type, otherwise there would
be name conflicts across plugins.

See 
https://docs.ansible.com/ansible/latest/dev_guide/developing_locally.html#local-plugins




-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7e_%2B3Gu_mnQkbArxq0mJ0-RARHCh7wOPtdJ4Sg_wrtT5Q%40mail.gmail.com.


Re: [ansible-devel] custom module is failing with MODULE FAILURE\nSee stdout/stderr for the exact error" rc:0

2020-01-17 Thread Brian Coca
because ansible expects a single JSON document as a response on STDOUT
of the module .. if you do print statements .. you are probably
breaking that requirement, hence the error.



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7fUS2BVkYJLZvi%3DnQa%3D4uPyPQKyvq%2Bnp%3D7jNW9hmD%3DTig%40mail.gmail.com.


Re: [ansible-devel] query on action plugins

2020-01-15 Thread Brian Coca
client_data is not a var, its a module option, those are not the same
thing and are not supposed to be conflated. Options are populated FROM
vars via templating, they are not vars themselves.


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7crUMecLneotBAuuhqBf6Knui%3DOHsg%3DM8zmgNjAPiinrg%40mail.gmail.com.


Re: [ansible-devel] ERROR! the field 'hosts' is required but was not set

2020-01-02 Thread Brian Coca
remove the - in front of tasks, it is 'starting a new play' and that
one is missing 'hosts:'

also this is more of a question for ansible-project.

On Fri, Dec 27, 2019 at 2:48 PM Anand Solomon  wrote:
>
> I am getting the "ERROR! the field 'hosts' is required but was not set" 
> error, and my playbook is as follows. I am trying to run a sql script 
> (record.sql) from the ansible control server to the DB server.
>
> ---
> - hosts: DBServer
> - tasks:
> - name: Execute table.sql using sqlplus
>   shell: |
> export ORACLE_HOME={/u01/app/oracle/product/12.2.0.1/dbhome_1}}
> $ORACLE_HOME/bin/sqlplus -s tstsch/tstsch@dbname @record.sql
>   environment:
> ORACLE_HOME: "{{/u01/app/oracle/product/12.2.0.1/dbhome_1}}"
> PATH: "{{$PATH:$ORACLE_HOME/bin}}"
>   args:
> chdir: "{{/home/ansible}}"
>   become: true
>   become_method: su
>   become_user: oracle
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ansible Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to ansible-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-devel/7e095851-01b6-4a1c-b824-0df893cfbc8b%40googlegroups.com.



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7e%2B0Fj8ohq-DW%2BWb6RcGCB-Z%2BYZa63t0ygQy-zmFffG4A%40mail.gmail.com.


Re: [ansible-devel] Re: ecs_tag

2019-11-12 Thread Brian Coca
You might want to try the aws working group
https://github.com/ansible/community/tree/master/group-aws, probably a
more focused audience to express interest on this.

The irc channel is most likely to get you a  more immediate response.

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7c6wTYF6ONjo-SPTu%3DmEbYqiozkCkPojoM%3DGdA0BcaDFw%40mail.gmail.com.


Re: [ansible-devel] Re: facts gathering question

2019-11-11 Thread Brian Coca
defining the collector is not enough, you need to call it with all the
other collectors see 'default_collectors.py'


-- 
------
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7eQZhhjv7-ee4XTVPZsgWqbsQjRcZEFRWZW352cMRMpyQ%40mail.gmail.com.


Re: [ansible-devel] Re: access to host_vars and group_vars from new Inventory plugin

2019-11-11 Thread Brian Coca
You have access to host and group vars defined by previous inventory
sources, but the host_vars/group_vars files are not available, since
those are processed after all inventory is defined.

You could call the vars plugins directly but it is not something I advise.



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7efZqHQckRuSG4VdB89LcvDtn%3D55n5NtaApJWuz721GyQ%40mail.gmail.com.


Re: [ansible-devel] Bypassing no_log for a specific output (dumps of zabbix modules)

2019-08-27 Thread Brian Coca
i don't think that is exclusive to zabbix and those using 'admin' as a
password deserve 'some weirdness' imho.


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7fLC9tXFgJfrT1FvTQ5BTQbqVnOxzFBQRBoLQMUKoQm4A%40mail.gmail.com.


Re: [ansible-devel] Is changing the default setting of TRANSFORM_INVALID_GROUP_CHARS a good idea?

2019-08-23 Thread Brian Coca


On Friday, August 23, 2019 at 9:23:45 AM UTC-4, Jeff Geerling wrote:


> It feels like the war on dashes has spilled over from roles (then 
collections) to now group naming conventions.
I can empathize with the 'feeling' but the reality is that this has more to 
do with underlying tools used (jinja2, python imports) than what core devs 
want.

> Ansible end users should not have the mental burden of having to deal 
with (in this case, seemingly arbitrary) variable naming character 
decisions.
The choice is between that and the mental burden of 'knowing how to avoid 
errors in templates' when using 2 'default' features, dashes in names and 
Jinja2 dot notation. We took the option we thought would be most helpful to 
users (not have a exception trap waiting to happen) and calculated that 
having a setting would be minor inconvenience to those that use dashes and 
a way for them to be informed of said trap.


> When I saw this in the Ansible output after upgrading to 2.8.x, I was at 
first confused (because of the wording of the message), 
yes, this was my mistake and has since been corrected and clarified.


> then bewildered by the fact that dashes are in a sense made 'second class 
citizens' in inventory group names.
This was always the case, it was just not uniform across inventory sources, 
the change was 'making it known' to all users and deprecating the default 
'wild west' that depended exclusively of inventory source used, some even 
did sanitization partially and inconsistently within the source itself.

> I mean, I would definitely go for dropping the dot object key access 
syntax in documentation entirely (and spend a week or so cleaning up all 
references)
This was the first solution proposed and it was overwhelmingly shot down.

>  but anything would be better than continuing to burden long-time Ansible 
users with deprecation after deprecation of heavily used 
syntax/conventions, on every Ansible release.
This is something we have been struggling with as if we don't deprecate it 
we keep a broken/incomplete functionality and the 'new way' that covers and 
fixes most of the previous issues is not adopted unless there is something 
pushing users. Then there is the maintenance aspect, some of the 'old way' 
ends up crippling the new features or fixes we want due to the constraint 
of keeping backwards compatibility. 

This is why feedback is important and we continue to listen, learn and 
adapt, we would also benefit from more people attending the IRC meetings 
where these things get proposed, voted on and 
decided. https://github.com/ansible/community/tree/master/meetings

-- 
-- 
Brian Coca 

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/99132737-da6d-4db7-b1da-03385af1a95c%40googlegroups.com.


Re: [ansible-devel] Bypassing no_log for a specific output (dumps of zabbix modules)

2019-08-14 Thread Brian Coca
if no_log could be bypassed and runtime, it would trigger a CVE ... so
the way to test the modules is to disable no_log in the module code
itself.


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7cP6uuVy%3D8coN5pnSktN2j%2BSSbiw24L8gcVJyZ503FrCQ%40mail.gmail.com.


Re: [ansible-devel] Importing a yaml file in ansible-playbook.

2019-08-08 Thread Brian Coca
the file lookup https://docs.ansible.com/ansible/latest/plugins/lookup/file.html


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7f_TBjeCdSr6TNbe5NQC1oiP%3DXND%2BtPxheXW_4Nhu3j7g%40mail.gmail.com.


Re: [ansible-devel] Is changing the default setting of TRANSFORM_INVALID_GROUP_CHARS a good idea?

2019-08-07 Thread Brian Coca
> I'm really sad that a change with the potential to affact a very large user 
> group was made without proper documentation. I know that developers have the 
> curse of knowledge but when the behaviour changes the documentation has to be 
> changed, too. Well, an issue is open for that. Let's see when it could be 
> solved.

We knew it would affect a good chunk of users, its always a balancing
act, what is the right thing to do? how many people will this
inconvenience?  is there a less intrusive solution?
Again, I think aside from the 'future' inconvenience of having to 'opt
in' to this feature, most of the problem was a misunderstanding on the
behaviour going away permanently.


> I hope you could keep your promise:
me too, just to confirm, no one has made the case to do otherwise,
most of the problem was confusion due to a bug (deprecation always
showed, now fixed) and my poor wording of warnings and docs (which is
still being worked on).




-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7dJ20m7%3DxjOstOfB3jh4U6MB5Kn6zfiy3ktfVv6yGHMWA%40mail.gmail.com.


Re: [ansible-devel] Is changing the default setting of TRANSFORM_INVALID_GROUP_CHARS a good idea?

2019-08-05 Thread Brian Coca
>What I have not understand yet, do hyphens and dash causes confusion and 
>support cases or only the use of dots and colones etc.? Would it be possible 
>to only ban the chars that are causing the most of the trouble?

Most of the issues have to do with the hyphen, there are incidents
with the dots also (I've even seen `@groupname` once)  but if we are
only going to ban the characters after people hit the issue i still
think it is a bad experience for the new user.

>In my environmen we are using dash/hyphen in almost every group name and we 
>won't change it. So I have to keep track and change the default every time I 
>setup a new environment. For me that's unfortunate. But if I have to do it I 
>would expect to >have information on how to do so in documentation, 
>configuration files, porting guides, etc.

I know this is an inconvenient, I wish I had a better solution, but
keeping the things as they were before is IMHO a worse inconvenience
to many users, one I cannot really fix as it is a feature from a
project we depend on (Jinja) and a very popular one at that. My first
suggestion was to 'not promote dot notation in our documentation', but
that got very strong resistance and was rejected. My second suggestion
on making it a user configurable expression to sanitize the names was
also rejected . In the end we voted to force all inventory to go
through the same standard sanitation, at least I did insist on keeping
a toggle to bypass it, but the current default (backwards compatible)
had to be deprecated in favor of the 'safe default'.

We also looked (and are still looking) at other solutions, mostly
internal name replacement, but this is not something I expect to work,
even if it does it might have other major consequences.
If anyone has a solution that fixes all the underlying issues w/o
creating a burden on any of the users, we are more than happy to
listen, 'revert this cause it affects me' is not a solution as it
keeps the original problem.



--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7fFzbQ95z6R6U%2Bc-4d8Pj-CY%3DgT-aVkP8RNsOxZTVPfsw%40mail.gmail.com.


Re: [ansible-devel] conditionally give value to src of win_copy

2019-06-11 Thread Brian Coca
first, this conditional is wrong:
`when:  "{{ ansible_architecture }} == 64-bit"`

should be:
`when:  ansible_architecture == "64-bit"

alos you can just do:


src: "{{ (ansible_architecture == '32-bit')|ternary('phoenix_x86',
'phoenix_x64') }}"


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACVha7d8a%2BT218UcT4sovZVTfkJzXhF8f2Cn5DfBD01q-SU64A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Need help on how to generate a configuration file and use it to start my client

2019-05-01 Thread Brian Coca
Use the template action, it is almost always the right answer to the
question 'how do i generate a file'.

https://docs.ansible.com/ansible/latest/modules/template_module.html


-- 
------
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Can callback plugin access all Ansible vars?

2019-05-01 Thread Brian Coca
I don' t know, it feels like you are trying to force a workflow
AGAINST the base design, at that point i would suggest a) change the
workflow or b) use a different tool that actually supports that
approach

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Can callback plugin access all Ansible vars?

2019-04-23 Thread Brian Coca
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 only work if you purposefully avoid generating any variable
dynamically.

I would not say the API is unstable, just that it is not for public
consumption, so we make no guarantee that we won't change it tomorrow
to fit our needs.

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Can callback plugin access all Ansible vars?

2019-04-23 Thread Brian Coca
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 play, this gets unwieldly fast.

Strategies do have access to vars, but mainly focused on 'current task
+ host' , it is possible to expand that to ALL variables, but I don't
know why you want them again this can be huge and impose both RAM and
processing botlenecks.



--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Running tasks on GCP hosts using service account

2019-04-04 Thread Brian Coca
You probably need to set the remote user to an account that allows
login, one way would be `ansbile_user: the account`




-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Is there way to access variables from inventory plugin?

2019-03-29 Thread Brian Coca
W/o a definition of what you mean by access, the answer is 'yes'.


------
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Testing inventory plugins

2019-03-11 Thread Brian Coca
Also there is a bug with 'adjacent' directories for inventory plugins,
this should fix it https://github.com/ansible/ansible/pull/51177

-- 
------
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] display_args_to_stdout=true - Is it possible to suppress internal args?

2019-03-11 Thread Brian Coca
no, modules can only return the data, they have no control on display,
that happens at the callback level.

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Want to know ansible keyword

2019-02-19 Thread Brian Coca
Ansible does not have this feature, but specific modules do, for
example, the copy and template modules will show 'changed' if the file
had to be updated (not just content but permissions also), they will
also return 'diff' information (if requested, i.e --diff ).

--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Re: I can access ansible_ssh_pass but not ansible_become_pass?

2018-11-28 Thread Brian Coca
it really has it's own section
https://docs.ansible.com/ansible/latest/user_guide/playbooks_prompts.html


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Re: I can access ansible_ssh_pass but not ansible_become_pass?

2018-11-26 Thread Brian Coca
or use vars_prompt to get those kind of passwords?



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Re: I can access ansible_ssh_pass but not ansible_become_pass?

2018-11-23 Thread Brian Coca
I would actually remove ansible_pass/ansible_ssh_password to avoid
accidental disclosures.

Why do you need this information in the play?


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] host unreachable

2018-11-14 Thread Brian Coca
there is no need to register as the host failing the ping will be
removed from the play.



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] host unreachable

2018-11-13 Thread Brian Coca
1 play before your normal play:


hosts: hosta,hostb
gather_facts: False
tasks:
   - ping:
   - group_by: key=rechable

hosts: reachable


--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Regression using variables availabe after gathering facts when specifying environment

2018-11-09 Thread Brian Coca
or just add 'default' for when fact gathering runs:

PIP_INDEX_URL: "{{ 'https://mirrors.aliyun.com/pypi/simple' if
(ansible_domain|default('')).startswith('cn') else
'https://pypi.org/simple' }}"


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] tracking state between module calls

2018-10-22 Thread Brian Coca
not sure if this is what you want/need but aside from normal vars you
can also use 'stats'
https://docs.ansible.com/ansible/latest/modules/set_stats_module.html

-- 
------
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Ansible Python API: how to transfer files to remote in ansible custom module

2018-10-03 Thread Brian Coca
>zipped up with copy.py and sent over to remote before copy.py is called by 
>ansible on remote.  Which make complete sense, the modules are only executing 
>on remotes, the files they use must be made available to them by ansible 
>framework before they are invoked.

This is incorrect, the copy action plugin asks the connection plugin
to push the file to the remote before executing the module (which is
part of the zip as well as any dependencies it has in module_utils).
Both of these transfers should be using the same directory though, we
try to limit the number of temp dirs created/used.


> I did come cross _transfer_file from normal action ActionBase, looks like 
> action is where it happens, but developing an custom actions seem to be an 
> overkill for such a common user case, and i dont want to reinvent wheels.

This is the correct method to use, this in turn calls the connection
plugin method for file transfers.
If you don't want to use directly, look at the template action plugin,
it just calls the copy action plugin when it needs to copy the files,
you could do the same in this case.

--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Ansible Python API: how to transfer files to remote in ansible custom module

2018-10-02 Thread Brian Coca
It would help if you gave more information about what you are trying
to accomplish as implementations might vary depending on that.
-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Connecting through terminal emulation

2018-09-18 Thread Brian Coca
I'm not sure a connection plugin makes sense, since it requires
transfer of files to/from the target, though possible via the terminal
i don't think this is a good approach.

One option to send commands is using the expect module  (delegated to
the host having terminal access) to handle commands and prompts as
they happen

Another is creating something like the telnet action plugin that will
handle the communication directly and allow you to send commands (its
mostly a specialized 'expect').

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] When can we remove the prohibition on requests?

2018-09-13 Thread Brian Coca
It is not a question about pet peeves, its a question about the installed base.

Python 2.7 was released much longer than 5 yrs ago and we still
support it and even 2.6, not because we like to, but because the
existing install base still has those versions.
The requests lib has been present for a long time, used by many apps
and installed in many systems, a less popular library is not even as
close to be as problematic.

I don't see that as disingenuous, just dealing with the reality that
production systems don't get updated at anything close to the
frequency developers update their workstations and development
environments. This has always been a frustration that has affected
developers and administrators, 1/2 the reason everyone
virtualizes/jails/contains applications, but as a system tool we don't
have the luxury to control the execution environment, so we need to
balance the existing base vs the maintainability and the feature set
we want to provide.

That said, I never thought an outright ban was reasonable and I'm
still a firm believer on being specific about versions, at the very
least in the documentation. Not just on requests, but any library that
has an installed base that will conflict with the latest version being
used. Thankfully that tends to be a short list, mostly related to
technology that is still in its 'fast evolution' phase.
-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] When can we remove the prohibition on requests?

2018-09-13 Thread Brian Coca
I have a lot of mixed thoughts on this one,

I've always encouraged module authors to avoid requests due to 1.x but
even 2.x version incompatibilities, but I was unaware we banned them
until this thread was started (we should update the docs).
Even though the development of 'requests' has been much more stable
for the last few years, the 'installed base' has a very long memory
and not everyone can update to the latest from pip, which is what most
developers target/test. This is also why I insist on 'version
checking' when i see `import requests` on any module or it stated as a
dependency .. the same goes for docker.py, anyone that has looked at
those modules can see the proliferation of version comparison
statements. There are a few libraries that fall into this category,
mostly due to rapidly changing landscapes in tech.

Another thing to consider is that the controller tends to be much
newer OS/Software than the targets (user workstation vs servers) and
that even those versions might differ vastly, so modules/plugins that
require requests on the controller should be less problematic than
those that execute on the remote target. We already have plenty of
modules/plugins that depend on requests, but mostly due to depending
on an API specific library that uses requests internally.

I'm not a fan of banning, but I can see @sivel's point on avoiding
unnecessary dependencies when we have alternatives that cover the same
needs.
For those that were not already using related tools and had the
libraries already installed, installing new dependencies manually is
already a burden, I would prefer not to add to it.
Should we then expand this criteria to any/all libraries? What is the
threshold?
Taken to the absurd extreme, every library can be eliminated as a
dependency until we get into C bindings and such .. even then we can
work around those by using 'pure python' implementations.
Whatever we decide, we should also clearly document it, not just add a
check that makes it fail in CI.

In the end, I'm fine with removing the ban. I would still 'strongly
recommend' to any authors on review to use the existing alternative,
specially if they want to be included in Ansible's distribution. And,
if they cannot avoid it, be very clear about the versions required,
both in code and in docs.


--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] needs_triage label

2018-09-10 Thread Brian Coca
All issues get that label initially, we do have a bot assigning labels
but there are value judgement that are very hard to write into code,
so we require 'humans' to look at every new issue and confirm and/or
amend the labeling the bot has done as well as evaluate the urgency of
an issue and deal with them accordingly.

Once this evaluation has happened, the 'human' can remove the label to
confirm that the rest of the labeling is correct and does not need
reclassification.

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Need help with set_fact at playbook level.

2018-09-04 Thread Brian Coca
Just use vars: keyword.

vars:
  int_serial_mode: '{{(serial_mode is defined)|ternary(3, 1)}}'


-- 
------
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Questions regarding inventory plugins

2018-08-27 Thread Brian Coca
To clarify, unlike inventory scripts, inventory plugins don't 'return'
a format, they update the inventory itself.




-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] How can i include entire shell script block in ansible playbook

2018-08-09 Thread Brian Coca
This is a question for ansible-project, in any case, use the script module



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] detachable ansible

2018-08-06 Thread Brian Coca
or at the async keyword, it works as you describe.

one point, Ansible never copies vars to the target, it only passes the
info to the options the module requires, no more, no less.

modules don't deal with vars handling/templating, the core engine
does, modules only deal with the input in their options.



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] include_vars: Option for preserving existing variables from being overwritten

2018-04-12 Thread Brian Coca
You would still have issues with set_fact, vars:, vars_prompt,
register, vars_files and inline vars to include and roles, as
inventory is not very high in the precedence.


One way to avoid this is to have client provide extra vars, which has
highest precedence, instead of inventory.

Another way is you provide your vars in a role as defaults/main.yml,
which has the lowest precedence, instead of include_vars.



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Re: complete ansible command line verbose like display using the python API

2018-04-03 Thread Brian Coca
In this case you seem to be missing code to handle the
v2_runner_on_unreachable event.



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Re: Status of GCE modules

2018-03-29 Thread Brian Coca
We normally caution against autogeneration for a few reasons:

- Any time someone else contributes to the module, it breaks the next
autogenerated update, you need to create a process to syncronize
contributions in.
- Options normally are made as passthroughs to the API, this tends to
create modules that are not very user friendly, closer to programming
functions than a declarative state
- Error messaging is mostly the same as the API's, which is fine for
programmers, but not most users
- The documentation quality tends to suffer, mostly just reflects the
API docs, again sufficient for most programmers but not for other
users
- Issues get filed against the generated code, not the generator, this
can create a lot of work  as it is 'complex double bookeeping'. Which
goes contrary to the main reason to autogenerate the modules,  to
minimize the developer workload.


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Re: Examples of diverse large and inventories

2018-03-27 Thread Brian Coca
@Josiah, you might want to look into the new inventory plugins, you
can just specify a file with the diff credentials as the inventory
source.

--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Set fact based on particular condition of list variable not working

2018-03-23 Thread Brian Coca
You dont need moustaches in conditionals:

 when: builds[item] == pkgversion



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] get_config in Ansible 2.5.0 API

2018-03-23 Thread Brian Coca
I'm writing the new docs, but the short, DONT use get_config, use
self.get_option('passwordstate_uri') after you define the option in
the DOCUMENTATION variable inside the lookup

in this example
https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/lookup/redis.py#L7

you can see how to define ini entries and env vars that the lookup can consume.

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Ansible API how to use "get_config" in Ansible 2.5.0

2018-03-23 Thread Brian Coca
You don't use get_config, you use self.get_option('optoinname'), see
shipped plugins for how to define options inside the DOCUMENTATION=
variable for the config system to automatically recognize them.


-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] How can I make this work?

2018-03-22 Thread Brian Coca
you need to specify the file, which is contained in the 'item'
variable produced by the loop:

- replace:
   dest: "/home/ansible/cloning/{{item}}"
regexp: "{{ansible_hostname}}"
replace: "{{ansible_system}"
  with_filetree: "/home/ansible/cloning/"

-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] What's wrong with my PR ?

2018-03-05 Thread Brian Coca
No, that is quite normal, your PR is introducing a new module so it is
automatically classified as 'community' which means the core team will
not get involved unless someone brings it to their attention.
As per the community workflow, it depends on the current list of
maintainers (general and specific to the category) and their interest
in the plugin, after all this is mostly a volunteer effort.


The best place to get core involved is IRC, specifically the core
meetings 
https://github.com/ansible/community/issues?q=is%3Aopen+is%3Aissue+label%3Acore


------
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-devel] Reading INI inventory file from S3

2018-02-15 Thread Brian Coca
Writing the docs on how to write them is 'on my list'


-- 
------
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   >