Re: [ansible-project] Copy folder from one host to another

2021-12-09 Thread Stefan Hornburg (Racke)
On 10/12/2021 06:12, Lucas Possamai wrote: Hi all, I need to copy the content of a folder from one remote host to another remote host. The copy command needs to be executed as user "postgres". Folder to be copied from source: /data/postgresql/pg_xlog/ Destination: /data/wal_archive/ I tried

[ansible-project] Copy folder from one host to another

2021-12-09 Thread Lucas Possamai
Hi all, I need to copy the content of a folder from one remote host to another remote host. The copy command needs to be executed as user "postgres". Folder to be copied from source: /data/postgresql/pg_xlog/ Destination: /data/wal_archive/ I tried looking online but couldn't find anything

[ansible-project] Re: include_tasks and noop

2021-12-09 Thread flowerysong
I don't see any benefit to the proposed feature. If you want to skip an include based on a flag value, you can do that without adding complexity to the engine. - include_tasks: "{{ task_file }}.yml" when: task_file | default('noop') != 'noop' On Thursday, December 9, 2021 at 6:05:10 PM UTC-5

[ansible-project] Registered variable returns expected value but task is skipped

2021-12-09 Thread Lucas Possamai
I'm trying to only run a task if the previous task returned a 0 stdout. - name: Check if efs-utils is already installed ansible.builtin.shell: dpkg -l | grep efs-utils | wc -l register: is_installed ignore_errors: "{{ ansible_check_mode }}" when: efs_id != "" and not ansible_check_mode - name:

[ansible-project] Re: Ansible and SELinux Issues

2021-12-09 Thread Dan Linder
In my environment, I found that we had to add the “remote_tmp” variable and make it unique per user. I think you’re running into the same thing if you look at the error message from that point of view: Permission denied: unix_listener: *cannot bind to path: /root*/.ansible/cp/ If it’s

[ansible-project] include_tasks and noop

2021-12-09 Thread Omar
This is potential feature idea. I'm developing a small collection and as an extension points I expose various variable that refer to 'task files'. For example, I have a role named prepare with a task file named `_yum.yml` and I have a variable `repositories_tasks` with a default value

Re: [ansible-project] Re: Creating a fact array

2021-12-09 Thread Oluwole Leigh
Can you show a sample of user_show.results On Thu, Dec 9, 2021 at 2:04 PM lift...@gmail.com wrote: > For my testing, I'm calling the user_show IPA API via uri for the first 5 > items. The registered variable called "user_show" has the json value of > "user_show.results[X].json.result.result.Y"

[ansible-project] New releases: ansible-core 2.12.1, ansible-core 2.11.7, ansible-base 2.10.16

2021-12-09 Thread Matt Davis
Hi all- we're happy to announce the general release of: - ansible-core 2.12.1 - ansible-core 2.11.7 - ansible-base 2.10.16 How to get it - $ pip install ansible-core==2.12.1 --user or $ pip install ansible-core==2.11.7 --user or $ pip install ansible-base==2.10.16 --user The

Re: [ansible-project] Re: Creating a fact array

2021-12-09 Thread lift...@gmail.com
For my testing, I'm calling the user_show IPA API via uri for the first 5 items. The registered variable called "user_show" has the json value of "user_show.results[X].json.result.result.Y" (where X is 0 for the first user, 1 for the second, etc; and Y is the user property (uid, firstname,

Re: [ansible-project] Re: Creating a fact array

2021-12-09 Thread Oluwole Leigh
Hi, I wanted to know why you are using item to retrieve results - "{{ user_show.results[item|int].json.result.result.uid[0] }}" . since item is useful when you have a loop running. Is it not possible to retrieve the result using json_query or the map filter ?If that can be done , then we

RE: [Impersonation?] Re: [ansible-project] Issue on Ansible Playbook Run When Calling WinRM - ConnectionError ('Connection aborted.', OSError("(104, 'ECONNRESET')",))

2021-12-09 Thread Panos Eracleous
If I could narrow down exactly which change is causing the problem I can wrap it up/run it separately. The problem is that it’s not easily reproducible and the task it actually fails on (win_regedit) is pretty innocuous. If I could get Ansible to error/carry on it would also be a start. But the

Re: [ansible-project] Issue on Ansible Playbook Run When Calling WinRM - ConnectionError ('Connection aborted.', OSError("(104, 'ECONNRESET')",))

2021-12-09 Thread Dick Visser
Without any knowledge of windows at all, connection abortion after/during a task that changes something with Tcpip\Parameters in its name... sounds like sawing off the branch that you're sitting on. In that sense I'm surprised it doesn't happen all the time. Isn't there a way to have such a

[ansible-project] Issue on Ansible Playbook Run When Calling WinRM - ConnectionError ('Connection aborted.', OSError("(104, 'ECONNRESET')",))

2021-12-09 Thread Panos Eracleous
We're currently using Ansible 2.9.15 through Tower 3.8.0. We're seeing an issue when targeting new builds on Window Server 2016 through WinRM. The issue happens at the start of the Playbook and soon after a Join Domain + Reboot Step. It often happens in this order - although there are some

Re: [ansible-project] Iterate host definitions into single file

2021-12-09 Thread Stefan Hornburg (Racke)
On 09/12/2021 11:36, Chris Jefferies wrote: Racke, One glitch that I did not understand... I must add: host: all instead of just hosts: icinga.example.com ... and run with all hosts defined in the playbook.  I was only using icinga.example.com (the false name of my server).  Now I must

Re: [ansible-project] Iterate host definitions into single file

2021-12-09 Thread Chris Jefferies
Racke, One glitch that I did not understand... I must add: host: all instead of just hosts: icinga.example.com ... and run with all hosts defined in the playbook. I was only using icinga.example.com (the false name of my server). Now I must add: when: "{{inventory_hostname ==

Re: [ansible-project] Iterate host definitions into single file

2021-12-09 Thread Stefan Hornburg (Racke)
On 09/12/2021 10:07, Chris Jefferies wrote: Racke, *ansible_play_hosts* - I did not know about this *magic* variable, as they call it.  I'll test but I assume that the attributes come with it. Then you describe defining a task with: run_once: yes delegate_to: localhost I see run_once in the

Re: [ansible-project] Iterate host definitions into single file

2021-12-09 Thread Stefan Hornburg (Racke)
On 09/12/2021 08:19, Chris Jefferies wrote: I use ansible a lot for work and for my home lab.  I love it. I keep needing an approach that so far has stumped me, so asking here for advice. I want to create a single file (an icinga2_hosts.conf) which has a separate collection of attributes