Re: [ansible-project] Gather Data using ansible playbook

2021-11-20 Thread Nuno Jordão
The variable you set in the register is an Ansible structure, you cant use it directly like you did here: - name: lvm Extend shell: "/usr/bin/df -hT | grep {{ Mount_point }} | cut -d. -f1 | awk '{print $2}'" *register: fs* - name: 'Extend the FS' filesystem:

Re: [ansible-project] docker installation problems

2021-04-26 Thread Nuno Jordão
A playbook is a list of plays. Example: --- - name: play1 hosts: host1 tasks: - name: etc... - name: play2 hosts: host2 tasks: - name: On Mon, Apr 26, 2021 at 12:08 PM rebecca acheampong wrote: > > I wish i could separate them as you have told me but i am very new to >

Re: [ansible-project] Python_Interpreter_Error.

2021-03-10 Thread Nuno Jordão
Aren't the modules supposed to work with python 2.6? He is running the setup module... Probably the behaviour is different because the Ansible versions are different between the Ansible inside AWX and the Ansible in the server. That info is lacking from OP. As is the OS version of the managed

Re: [ansible-project] How to extract specific value from register output

2021-03-08 Thread Nuno Jordão
Hello, It's inside a "results" list. The result of a loop? In that case you need: {{ file_name.results[0].path }} to get the first element of the "results" list. If you have more, you need a loop to iterate it. Nuno Jordão On Mon, Mar 8, 2021 at 3:57 PM dudu.c...@gmai

Re: [ansible-project] Am I missing something or Ansible is uselessly verbose?

2021-03-02 Thread Nuno Jordão
Hello, "become: yes" means you need to become a different user than the user used to connect. By default "root" as is normally used to elevate privileges. "*become_user: postgres*" if you need a different user, other than connecting user or root. On Tue, Mar 2, 2021 at 12:25 AM Istvan Kis

Re: [ansible-project] Re: APT module to target only OS & not Application repo

2021-02-23 Thread Nuno Jordão
Hello, If you are trying to avoid certain known packages to be upgraded, you could try to pin them: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/dpkg_selections_module.html Nuno Jordão On Sun, Feb 21, 2021 at 9:49 PM esxi...@gmail.com wrote: > I am thinking like be

Re: [ansible-project] Constants in ansible playbooks

2021-02-16 Thread Nuno Jordão
but extra_vars are only defined as a command line parameter, right? On Tue, Feb 16, 2021 at 8:45 PM Brian Coca wrote: > extra_vars are not overridable and could be considered constants. > > -- > -- > Brian Coca > > -- > You received this message because you are subscribed to the Google

Re: [ansible-project] Dynamic dictionary key

2021-02-15 Thread Nuno Jordão
Hello, I am not sure it helps in your case, but I had success in past generating complex structures with a json template and importing it into a variable: set_fact: data: "{{ lookup('template', 'templates/data.json.j2') }}" It's much faster than doing combines and loops. Nuno Jord

Re: [ansible-project] How to copy files from src(ansible controller ) to dest ( target hosts)

2020-12-05 Thread Nuno Jordão
Hello, It may be more efficient to store the file in a central http repository and use "get_url" module to copy it to the target machine. Regards, Nuno On Sun, Dec 6, 2020 at 2:17 AM Prathap Dasari wrote: > Hi , > > How to copy the zip file size > 250 MB from src(ansible controller ) to >

Re: [ansible-project] fact_caching override in playbook?

2020-09-04 Thread Nuno Jordão
Maybe the clear_facts meta module and a new fact gathering may work in your case? https://docs.ansible.com/ansible/latest/modules/meta_module.html On Thu, Sep 3, 2020 at 10:41 PM nds.ap...@gmail.com wrote: > Hi Team, > > I have a project which uses ansible to run traffic tools on a given set

Re: [ansible-project] writing output to a csv file

2020-09-04 Thread Nuno Jordão
I'm glad it worked. Beware that, depending on your playbook and number of hosts, using only one fork may slow down it a lot. If you are using Ansible 2.9 the "throttle: 1" in the file writing task may be better. Nuno Jordão On Fri, Sep 4, 2020 at 11:53 AM SK wrote: > Thank Nuno,

Re: [ansible-project] writing output to a csv file

2020-09-03 Thread Nuno Jordão
Hello, If you are writing to the file in parallel into the localhost you may have concurrency issues. Try to use only one fork to see if it helps. Nuno Jordão On Thu, Sep 3, 2020 at 11:44 AM SK wrote: > Hi, > > Ansible version - 2.9 > > Facing issue in writing output to

Re: [ansible-project] How to retrieve arguments to ansible-playbook from ansible?

2020-07-15 Thread Nuno Jordão
Hello, Is this what you are looking for? https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html Nuno Jordão On Wed, Jul 15, 2020 at 3:04 PM Dick Visser wrote: > Hi > > As part of our deployment we are saving a file > /etc/deployment_status.json onto

Re: [ansible-project] Doubt regarding loops and conditionals

2020-02-19 Thread Nuno Jordão
. About the plugins, I dont think it is possible to use those in AWX. Thank you for your input. Regards, Nuno Jordão On Tue, Feb 18, 2020 at 7:22 PM Vladimir Botka wrote: > On Tue, 18 Feb 2020 14:45:34 + > Nuno Jordão wrote: > > > Some times I dont like to use the loop: &

Re: [ansible-project] Doubt regarding loops and conditionals

2020-02-18 Thread Nuno Jordão
bled by setting deprecation_warnings=False in ansible.cfg. skipping: [localhost] PLAY RECAP ***localhost : ok=0changed=0unreachable=0failed=0 skipped=6 rescued=0ignored=0

[ansible-project] Doubt regarding loops and conditionals

2020-02-17 Thread Nuno Jordão
etter one as allows to test the list before running loop, but should I trust it? It is the same in all versions of Ansible? Thank you for your help. Regards, Nuno Jordão -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscrib