Better put a `-n` on that `sort`.

On Tuesday, September 20, 2022 at 5:13:40 AM UTC-4 dulh...@mailbox.org 
wrote:

> this is how I manged this in the end. probably the solution suggested by 
> @Vladimit Botka is more scientific but I could not indorporate the find 
> operation required with the rest of the suggestion
>
>
> ###################################################################################################
> - name: detect port number for new service & put it into the 
> "pg_service_port" variable
> ansible.builtin.shell:
> cmd: "current_port=$(grep 'PGPORT=' .*.env | cut -d= -f2 | sort | tail -1) 
> && new_port=$((current_port+1)) && echo $new_port"
> chdir: /opt/db/postgres/bin/
> register: pg_service_port
> become: true
>
> - name: Print "pg_service_port.stdout" value
> ansible.builtin.debug:
> # var: pg_service_port
> msg: "{{ pg_service_port.stdout }}"
>
> ###################################################################################################
>
> I use "{{ pg_service_port.stdout }}" later on for defining the port# of 
> the new postgres service
>
> thks everybody for the input. I learned a lot, even though I do not use 
> everything ini this particular case yet.
>
>
>
> > On 09/19/2022 5:34 PM CEST dulhaver via Ansible Project <
> ansible...@googlegroups.com> wrote:
> > 
> > 
> > > On 09/19/2022 4:25 PM CEST Todd Lewis <uto...@gmail.com> wrote:
> > > 
> > > do this:
> > > 
> > > loop: "{{ found_files.files | map(attribute='path') | map('basename') 
> | list }}"
> > 
> > great, that works. So one part of the puzzle is solved, thx
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Ansible Project" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to ansible-proje...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/1197590870.58407.1663601642760%40office.mailbox.org
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/53826e41-1c48-4a5b-93c5-cfa75de00486n%40googlegroups.com.

Reply via email to