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

2023-08-16 Thread 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

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

2023-08-16 Thread Brian Coca
. 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

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
rmation. 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

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

2023-07-10 Thread Brian Coca
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

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

2023-07-06 Thread Brian Coca
e 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

Re: [ansible-devel] ansible_failed_task logs private variables

2023-06-13 Thread Brian Coca
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

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

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

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 fro

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

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

2023-02-21 Thread Brian Coca
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 u

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

2023-02-21 Thread Brian Coca
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

Re: [ansible-devel] YAML File check

2023-01-12 Thread Brian Coca
--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 grou

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 Develo

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

2022-11-08 Thread Brian Coca
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

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

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. T

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

2022-08-03 Thread Brian Coca
, 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...@google

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

2022-07-14 Thread Brian Coca
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 an

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

2022-07-14 Thread Brian Coca
, 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&q

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

2022-07-13 Thread Brian Coca
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

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 e

[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

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

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

2022-04-27 Thread 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 vi

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

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

2022-01-28 Thread Brian Coca
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

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&q

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

2021-11-04 Thread Brian Coca
'] 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, sen

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
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 grou

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

2021-08-26 Thread Brian Coca
, 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-deve

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

2021-08-26 Thread Brian Coca
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

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 }}" --

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 fro

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 e

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 u

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

2021-06-07 Thread Brian Coca
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 fro

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

2021-06-07 Thread Brian Coca
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 u

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

2021-06-04 Thread Brian Coca
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

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 s

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

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

2021-03-24 Thread Brian Coca
op 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. T

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 "An

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

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

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 unsubs

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, sen

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

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 "An

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

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

2020-01-02 Thread Brian Coca
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 --

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

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 grou

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

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

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

2019-08-23 Thread Brian Coca
is 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 th

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 u

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, sen

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

2019-08-07 Thread Brian Coca
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, sen

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') }}" -- -

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 "An

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

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

2019-04-23 Thread Brian Coca
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

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

2019-04-23 Thread Brian Coca
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

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 grou

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 ans

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 unsubs

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

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

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 receiv

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 unsubs

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 fro

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 unsubs

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

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&q

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

2018-10-03 Thread Brian Coca
e, 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 becau

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

Re: [ansible-devel] Connecting through terminal emulation

2018-09-18 Thread Brian Coca
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

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

2018-09-13 Thread Brian Coca
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 Develo

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

2018-09-13 Thread Brian Coca
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

Re: [ansible-devel] needs_triage label

2018-09-10 Thread Brian Coca
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 "An

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 e

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 grou

Re: [ansible-devel] detachable ansible

2018-08-06 Thread Brian Coca
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 opti

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

2018-04-12 Thread Brian Coca
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 grou

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 fro

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

2018-03-29 Thread Brian Coca
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

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, sen

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

2018-03-23 Thread Brian Coca
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 ans

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

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

2018-03-05 Thread Brian Coca
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

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 ans

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

2018-02-14 Thread Brian Coca
Or you can just 'mount' s3 as a 'local drive' and point at it for inventory. If you still want to 'autodownload' you might want to use an inventory plugin instead of an inventory script. -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups

Re: [ansible-devel] Iterate over inventory groups in parallel

2017-12-20 Thread Brian Coca
This should give you the beginning of what you need "{{groups["names"]|product(groups["places"])|map('join',':')|list}}" -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Development" group.

Re: [ansible-devel] Compare files on two different remote hosts

2017-11-30 Thread Brian Coca
use slurp on 1 file then copy's 'content' option targetting the 2nd with the content of the first, in checkmode and with --diff. -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from

Re: [ansible-devel] Solaris 10 - '~' directory created in home directory - unarchive fails

2017-10-12 Thread Brian Coca
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. For more options, v

Re: [ansible-devel] PRs getting stale

2017-07-21 Thread 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. For more options, v

Re: [ansible-devel] Extending the system/svc module

2017-07-10 Thread Brian Coca
the underlying module to execute. This still relies on autodetection but can also be done via a `use` option to force a specific module, basic options must be compatible with service though. -- Brian Coca -- You received this message because you are subscribed to the Google Groups

Re: [ansible-devel] Implement snap package manager in ansible

2017-06-05 Thread Brian Coca
No one else is working on it afaik, so go ahead. -- 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-deve

Re: [ansible-devel] Re: Concurrent playbooks and synchronization

2017-05-31 Thread Brian Coca
need, I would not build this into Ansible iteslf as there are soo many tools out there that already do this and it is extremely context dependent. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubs

  1   2   >