Re: [ansible-project] Mail Callback

2018-09-07 Thread Martin Krizek
The traceback you're getting says "unexpected keyword argument 'flags'". That argument was added in Python 2.7 which is also the minimal Python version supported by Ansible on the controller side. M. -- You received this message because you are subscribed to the Google Groups "Ansible Project"

Re: [ansible-project] Mail Callback

2018-09-07 Thread Martin Krizek
On Fri, Sep 7, 2018 at 1:15 PM Martin Krizek wrote: > > The traceback you're getting says "unexpected keyword argument > 'flags'". That argument was added in Python 2.7 which is also the > minimal Python version supported by Ansible on the controller side. But that's be

Re: [ansible-project] Tower license query

2019-06-07 Thread Martin Krizek
Hello, please contact official support for questions about your license - https://docs.ansible.com/ansible-tower/3.3.1/html/installandreference/updates_support.html#support Thanks, Martin On Fri, Jun 7, 2019 at 8:24 AM rajthecomputerguy wrote: > > Hi Team, > > We bought tower license two

Re: [ansible-project] Re: I can't edit jira issue with ansible

2019-06-07 Thread Martin Krizek
Or just use 'implicit localhost' - https://docs.ansible.com/ansible/latest/inventory/implicit_localhost.html. On Fri, Jun 7, 2019 at 1:16 PM Jonathan Lozada De La Matta < jloza...@redhat.com> wrote: > probably need connection: local or delagate_to: localhost in the playbook > > On Fri, Jun 7,

Re: [ansible-project] tower ansible template: how to pass parameters to a python script

2019-06-11 Thread Martin Krizek
Hello, for passing parameters to the script please see the first example on https://docs.ansible.com/ansible/latest/modules/script_module.html#examples. If you want to pass those parameters from variables then yes you need to use Jinja2. Thanks, Martin On Mon, Jun 10, 2019 at 4:45 PM Gilles

Re: [ansible-project] remote module (vmware_guest_find) does not support check mode

2019-06-11 Thread Martin Krizek
Hello, how are you running 'ansible-playbook' command? If you are passing "-C" or "--check" then the message is expected; you might want to create a feature request for vmware_guest_find to support check_mode. Otherwise it might be a bug. Thanks, Martin On Mon, Jun 10, 2019 at 5:30 PM Kishore

Re: [ansible-project] Re: loop

2019-06-12 Thread Martin Krizek
Hello, you can find an example of using `first_found` with `loop` here: https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html#selecting-files-and-templates-based-on-variables. Thanks, Martin On Wed, Jun 12, 2019 at 2:39 PM Ryad karkar wrote: > > Hi, > > You can see one

Re: [ansible-project] Simple Math with String to Int

2020-03-02 Thread Martin Krizek
On Tue, Mar 3, 2020 at 3:15 AM M F wrote: > > Hi All, > > Im having trouble with setting a fact, doing some math, and having the result > be an INT > > To start, i set the base Var > > set_fact: SOMENUMBER = 8 > > Ansible stores this value as a String > > Later, i need to divide that number by 2

Re: [ansible-project] ignore -has no attribute

2020-01-23 Thread Martin Krizek
Use "default" filter: https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#defaulting-undefined-variables Example: - hosts: localhost gather_facts: no vars: d: key: value tasks: - debug: msg: "{{ d.missing_attr | default('default_value') }}" On

Re: [ansible-project] authorized_key : How to put default value or bypass it

2020-01-23 Thread Martin Krizek
Just skip the item when ssh_key is not available (`false` in your example): - name: "add public keys to users" authorized_key: user: '{{ item.name }}' key:'{{ item.ssh_key }}' with_items: '{{ user }}' when: item.ssh_key On Thu, Jan 23, 2020 at 9:25 AM Hieronymus

Re: [ansible-project] Re: Help with meta end_host

2020-01-28 Thread Martin Krizek
Hello, I have opened a pull request that should fix the issue at https://github.com/ansible/ansible/pull/66851. Thanks! Martin On Tue, Jan 28, 2020 at 12:59 PM Aleksandr Smirnov wrote: > > I could just confirm such behavior, seems it's a bug in meta: end_host, what > such action does not

Re: [ansible-project] Ansible when logic to determine whether to use yum or dnf to install packages on ansible_os_family='RedHat'

2020-02-18 Thread Martin Krizek
On Tue, Feb 18, 2020 at 11:30 AM Vladimir Botka wrote: > > On Tue, 18 Feb 2020 01:25:18 -0800 (PST) > Donald Jones wrote: > > > Up until now I've been making a logic decision with my ansible roles based > > upon the ansible_os_family, to run the appropriate module for yum > > ('RedHat') or apt

Re: [ansible-project] ternary clarification needed

2020-03-26 Thread Martin Krizek
On Thu, Mar 26, 2020 at 7:55 AM Davide Scrimieri wrote: > > Hello, > > Whenever a ternary is used are both conditions evaluated regardless ? > > For example, I want to convert "my_other_var" to an object only if it is > passed as as string, otherwise I don't want to touch the object, and leave

[ansible-project] ansibot starts auto-closing collection issues and pull requests in ansible/ansible

2020-08-12 Thread Martin Krizek
Greetings Ansible Community, The change [0] to enable ansibot [1] to auto-close issues and PRs that have the `needs_collection_redirect` label [2] in ansible/ansible repository was just merged. In addition to closing, bot will also post a comment explaining the reason and a link to a collection

Re: [ansible-project] Use lookup/dynamic variable names in jinja2 template

2020-06-24 Thread Martin Krizek
You can use the varnames lookup to get variable names that match given pattern: https://docs.ansible.com/ansible/latest/plugins/lookup/varnames.html On Wed, Jun 24, 2020 at 12:33 PM Willem Bos wrote: > > Hi, > > The playbook below should generate a file with the content: > a,b > ssh_host_key >

Re: [ansible-project] Use lookup/dynamic variable names in jinja2 template

2020-06-25 Thread Martin Krizek
.. > TASK [debug] *** > ok: [localhost] => { > "msg": [] > } > ... > > Regards, > Willem. > > > On Wednesday, June 24, 2020 at 2:39:52 PM UTC+2, Martin Krizek wrote: >> >> You can use the varnames lookup to get variable names that match gi

Re: [ansible-project] Use lookup/dynamic variable names in jinja2 template

2020-06-25 Thread Martin Krizek
for being such a noob, but accessing vars/lists/dicts/etc. always gives > me major headaches :-) > > Regards, > Willem. > > > > > > On Thursday, June 25, 2020 at 2:19:03 PM UTC+2, Martin Krizek wrote: >> >> Sorry, I misread your example and missed that the var

Re: [ansible-project] short-circuit eval in templated string works only sometimes?

2021-05-18 Thread Martin Krizek
On Sun, May 16, 2021 at 1:55 AM Scott Mcdermott wrote: > > Hello, why does short circuit only works for the first two cases: > > - hosts: localhost > become: false > vars: > ivar: '{{hostvars[inventory_hostname].dne}}' > tasks: > - debug: > msg: "works: {{'foo' or dne}}" >

Re: [ansible-project] Security updates

2021-05-25 Thread Martin Krizek
On Tue, May 25, 2021 at 7:00 AM Dick Visser wrote: > > Hi > > Regarding ansible release information, I don't see any dedicated security > announcement mailing list. > Also the functionality that GitHub offers through the project's security > advisory page seems to be unused: >