Re: [ansible-project] loading tasks file based on ansible_fqdn value

2023-07-02 Thread dulhaver via Ansible Project
when: ansible_fqdn == "VM-0213.step.zrz.internal" does not create any error in the set_fact TASK. It does not set anything either unfortunately. Which, thinking of it, seems logical as we just compare the string ansible_fqdn with another string and not the value of the variale {{ ansible_fqdn

Re: [ansible-project] unable to connect to jenkins

2023-07-02 Thread Narmada Karthika
If the job already exist "item.jobs": [ { "fullname": "repo2", "jobs": [], "name": "repo2", "url": " https://url2/job/repo2/ " } On Sunday, July 2, 2023 at 5:36:32 PM UTC-7 Narmada Karthika wrote: > I am having hard time getting the when

Re: [ansible-project] unable to connect to jenkins

2023-07-02 Thread Narmada Karthika
I am having hard time getting the when condition work I have couple of application names have 2 separate jenkins urls. My playbook has to check if the job exists on both the urls and then create the new job. I am successful until checking and getting the data if the job exists or not. NOw when t

Re: [ansible-project] loading tasks file based on ansible_fqdn value

2023-07-02 Thread Todd Lewis
Or, better yet in my opinion, set the default value for "level" in group_vars/.yml, then for hosts which need a different "level" set that in an appropriately named host_vars file, like host_vars/VM-0213.step.zrz.internal.yml. This let's you expresses facts about hosts as data rather than as

Re: [ansible-project] loading tasks file based on ansible_fqdn value

2023-07-02 Thread Todd Lewis
There's a problem with your "when:" conditionals. First of all, throw out the second, because the strings that are "when:" expressions are already being evaluated in a Jinja2 context, so the mustaches shouldn't be there. In the first option, on this line: when: ansible_fqdn == VM-0213.step

[ansible-project] loading tasks file based on ansible_fqdn value

2023-07-02 Thread dulhaver via Ansible Project
hi, I want to take different sligthly routes in a playbook based on the particular remote. All remotes are in the same hosts group. I am trying to do this by setting a fact based on the ansible_fqdn value. Based on that fact ('keycloak' in my example here) I am including different tasks files

Fwd: Re: [ansible-project] separate logfile per target

2023-07-02 Thread dulhaver via Ansible Project
thx, that's what I was looking for. > On 06/30/2023 6:14 PM CEST Abhijeet Kasurde wrote: > > > Please check the tree callback plugins - > https://docs.ansible.com/ansible/latest/collections/ansible/builtin/tree_callback.html > This callback plugin logs on per-host basis. > > ``` > [defa