Re: [ansible-project] split with multiple columns in debug

2023-02-28 Thread Veera
Thanks Vladimir  !!!

On Tuesday, February 28, 2023 at 12:41:46 PM UTC+5:30 Vladimir Botka wrote:

> On Mon, 27 Feb 2023 21:07:45 -0800 (PST)
> Veera  wrote:
>
> > load_avg: "{{ up_out.stdout_lines[0].split()[7:] }}"
>
> Given the registered variable *up_out*
>
> - command: uptime
> register: up_out
>
> Use the filter community.general.jc to parse the stdout. The utility
> *jc* "converts the output of many commands, file-types, and strings
> to JSON or YAML". For example,
>
> uptime: "{{ up_out.stdout|community.general.jc('uptime') }}"
>
> gives
>
> uptime:
> load_15m: 1.21
> load_1m: 1.84
> load_5m: 1.41
> time: 07:57:41
> time_hour: 7
> time_minute: 57
> time_second: 41
> uptime: 11 days, 18:12
> uptime_days: 11
> uptime_hours: 18
> uptime_minutes: 12
> uptime_total_seconds: 1015920
> users: 2
>
> The first three attributes come from "load average". Quoting from man
> uptime: "The averages are taken over the three time intervals." Now,
> the usage is trivial. For example,
>
> load_average: >
> {{ uptime.load_1m }},
> {{ uptime.load_5m}},
> {{ uptime.load_15m }}
>
> gives
>
> load_average: |-
> 1.84, 1.41, 1.21
>
> -- 
> Vladimir Botka
>

-- 
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/5e9ee466-5e48-4e6a-87f9-0e67834443a8n%40googlegroups.com.


Re: [ansible-project] Template module doesn't work with any kind of loop

2023-02-28 Thread Adrian Sebastian Dutu
Seems this is caused by the path in the src. You can't put anything there
except the file name, and it will look in playbooks/templates/filename. If
i try to put a path, it throws that error.
This behavior happens only with loops though.

Without loops, I can put a full or relative path in the src and it works.

On Wed, Mar 1, 2023 at 12:22 AM dutu.a...@gmail.com 
wrote:

> Hello,
>
> I'm having a textbook task (taken straight out from the documentation
> examples) using template and with_filetree:
>
> - name: axis pipeline
>   template:
> src: "{{ item.src }}"
> dest: "{{ logstash_home  }}/{{ item.path | splitext | first }}"
>   with_filetree: ../templates/logstash/pipelines/axis
>
> I get this error:
> AnsibleFilterError: dict2items requires a dictionary, got  'ansible.template.AnsibleUndefined'> instead.
>
> I get the same error with with_fileglob.
>
> I have also tried different types of loops, nothing works. Everything I've
> tried works fine with the copy module.
>
> So what is so special about the template module? It should work similarly
> with copy in terms of copying files, iterating over filesystem paths etc.
> I'm using ansible 2.9.
>
> --
> 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/430f0b89-4f27-486f-90bc-e38332eb2042n%40googlegroups.com
> 
> .
>

-- 
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/CAHd1FN4BYCDBq28ZjHc1SSpwO3HjYVQStrKwueK%2BZ3s1PudFmA%40mail.gmail.com.


[ansible-project] Template module doesn't work with any kind of loop

2023-02-28 Thread dutu.a...@gmail.com
Hello,

I'm having a textbook task (taken straight out from the documentation 
examples) using template and with_filetree:

- name: axis pipeline
  template:
src: "{{ item.src }}"
dest: "{{ logstash_home  }}/{{ item.path | splitext | first }}"
  with_filetree: ../templates/logstash/pipelines/axis

I get this error:
AnsibleFilterError: dict2items requires a dictionary, got  instead.

I get the same error with with_fileglob.

I have also tried different types of loops, nothing works. Everything I've 
tried works fine with the copy module.

So what is so special about the template module? It should work similarly 
with copy in terms of copying files, iterating over filesystem paths etc.
I'm using ansible 2.9.

-- 
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/430f0b89-4f27-486f-90bc-e38332eb2042n%40googlegroups.com.


[ansible-project] Ansible 7.3.0 has been Released!

2023-02-28 Thread Anwesha Das
Hello everyone,

We're happy to announce that the Ansible 7.3.0 package has been released!

Ansible 7.3.0 will include ansible-core 2.14 as well as a curated set of
Ansible collections to provide a vast number of modules and plugins.


How to get it
-

This pre-release is available on PyPI and can be installed with pip:

```
$ python3 -m pip install ansible==7.3.0 --user
```

The sources for this release can be found here:

Release tarball:
https://pypi.python.org/packages/source/a/ansible/ansible-7.3.0.tar.gz
SHA256: 56c2fd97487b2cc83e39e895d8dfad8b2a5df34d490394a15735ebcfdc45f5be

Wheel package: 
https://files.pythonhosted.org/packages/py3/a/ansible/ansible-7.3.0-py3-none-any.whl
SHA256: 5039bf0fe4cbb9dcc3dbefe464fe2fa7fe75d8548814f00c478d5fe90c3e3979

What's new in Ansible 7
---

* New command-line utility “ansible-community” is added in Ansible 7
to check the installed version of Ansible Community package.

```
$ ansible-community --version
Ansible community version 7.3.0
```

* Python wheels are now available for both Ansible 7 and ansible-core
2.14.x, resulting in significantly improved installation performance.

* In addition, Ansible 7 will no longer install some unnecessary files
from the included Ansible collections such as tests or hidden files &
directories in order to further improve installation performance and
reduce the size on disk. These files are still available in the source
tarball if necessary.

* The changelog for ansible-core 2.14 installed by this release of
ansible is available here:
https://github.com/ansible/ansible/blob/stable-2.14/changelogs/CHANGELOG-v2.14.rst

* Collections which have opted into being a part of the Ansible-7
unified changelog will have an entry on this page:
https://github.com/ansible-community/ansible-build-data/blob/main/6/CHANGELOG-v6.rst

* For collections which have not opted into the unified changelog, you
may find more information on https://galaxy.ansible.com or their
source repository.
For example, the community.crypto collection would be found at
https://galaxy.ansible.com/community/crypto and you can find a link to
the source repository under the "Repo" button at the top right.

What's the schedule for new Ansible releases after 7.3.0 ?
-

For the all future release dates please follow the Bullhorn. The
Bullhorn is our newsletter for the Ansible contributor community.

Please subscribe to receive it :
https://ansible.us19.list-manage.com/subscribe?u=56d874e027110e35dea0e03c1=d6635f5420

Read past issues on the official Bullhorn’s wiki page :
https://github.com/ansible/community/wiki/News#the-bullhorn

Porting Help
-

A unified porting guide for collections which have opted-in is available here:
https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_6.html

Getting collection updates from Ansible 7 with older releases of ansible-core
-

Ansible 6 includes ansible-core 2.14.x and users have expressed an interest
in getting collection updates as they ship in the Ansible "batteries
included" package while keeping an older version of ansible-core based
on their needs and requirements.

An ansible-galaxy requirements file based on the collections from
Ansible 6 has been made available for this use case:
https://github.com/ansible-community/ansible-build-data/blob/main/6/galaxy-requirements.yaml

Once the requirements file has been downloaded, the collections can be
installed by running:
"ansible-galaxy collection install -r galaxy-requirements.yaml"

On behalf of the Ansible community, thank you and happy automating!

Cheers,
Anwesha

-- 
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/CAHK8evge7XjfXmguu34VDQ9sCqzDeABgnD5BB2AtE7W6nZ4Yig%40mail.gmail.com.


[ansible-project] New releases: ansible-core 2.14.3, ansible-core 2.13.8

2023-02-28 Thread Matt Martz
Hi all- we're happy to announce the general release of:

- ansible-core 2.14.3
- ansible-core 2.13.8


How to get it
-

$ python3 -m pip install --user ansible-core==2.14.3
or
$ python3 -m pip install --user ansible-core==2.13.8

The release artifacts can be found here:

* ansible-core 2.14.3
Wheel:
https://files.pythonhosted.org/packages/99/88/b0c356252341560ad37b33cc8277f9c14364aa23383db11820f7579d/ansible_core-2.14.3-py3-none-any.whl
Source:
https://files.pythonhosted.org/packages/c3/80/0df5b69d11a0daf73bd9f4ba4c23c31954dbe024243263e5d5b9393c63b8/ansible-core-2.14.3.tar.gz

* ansible-core 2.13.8
Wheel:
https://files.pythonhosted.org/packages/48/ce/88f77cf767290a6b5f9e500a3f82dbea95e95cc5a20f8b930592815e5f48/ansible_core-2.13.8-py3-none-any.whl
Source:
https://files.pythonhosted.org/packages/f4/69/440cb950f26387f799eaf59a8666101d013f4e17cd288bbbcdbe7489872d/ansible-core-2.13.8.tar.gz


Checksums
-

# ansible_core-2.14.3-py3-none-any.whl: 2200643 bytes
SHA256 (ansible_core-2.14.3-py3-none-any.whl) =
a4b36bfdd7aa3534d449e9ae6a9fd82d8e513fda8caaf5d18e1e27d217151c8c
# ansible-core-2.14.3.tar.gz: 11516886 bytes
SHA256 (ansible-core-2.14.3.tar.gz) =
093a4bc4a1259eaeb56ea37ec1d33cf1836c88f39281d89197f8d3480e068a58
# ansible_core-2.13.8-py3-none-any.whl: 2102209 bytes
SHA256 (ansible_core-2.13.8-py3-none-any.whl) =
451be59d8494bc302ff3a70f4d079d64b069e10b482fe451a58e2e733be7b8c5
# ansible-core-2.13.8.tar.gz: 13985893 bytes
SHA256 (ansible-core-2.13.8.tar.gz) =
fef93e996596550c537275e6acc573f383d121d5cee990f0f1d02353618f9af9


What's new
--

This release is a maintenance release containing numerous bugfixes.

The full changelog can be found here:

* ansible-core 2.14.3

https://github.com/ansible/ansible/blob/v2.14.3/changelogs/CHANGELOG-v2.14.rst

* ansible-core 2.13.8

https://github.com/ansible/ansible/blob/v2.13.8/changelogs/CHANGELOG-v2.13.rst


What's the schedule for future maintenance releases?



The next batch of release candidates is planned to be released on 20 March
2023.
The next general availability release will be one week after.


Porting Help


If you discover any errors or if any of your working playbooks break when
you
upgrade, please use the following link to report the regression:

  https://github.com/ansible/ansible/issues/new/choose

In your issue, be sure to mention the version that works and the one that
doesn't.

Thanks!

-- 
Matt Martz
@sivel
sivel.net

-- 
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/CAD8N0v_5rPwEEbS3fPoyVwCdDvDfAphhLA9hBjJscW_K3Ht9Xg%40mail.gmail.com.


Re: [ansible-project] split with multiple columns in debug

2023-02-28 Thread 'Rowe, Walter P. (Fed)' via Ansible Project
Excellent find Vladimir! I just shared this with my team. I was unaware of 'jc'.

Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

On Feb 28, 2023, at 2:11 AM, Vladimir Botka  wrote:

On Mon, 27 Feb 2023 21:07:45 -0800 (PST)
Veera  wrote:

load_avg: "{{ up_out.stdout_lines[0].split()[7:] }}"

Given the registered variable *up_out*

 - command: uptime
   register: up_out

Use the filter community.general.jc to parse the stdout. The utility
*jc* "converts the output of many commands, file-types, and strings
to JSON or YAML". For example,

 uptime: "{{ up_out.stdout|community.general.jc('uptime') }}"

gives

 uptime:
   load_15m: 1.21
   load_1m: 1.84
   load_5m: 1.41
   time: 07:57:41
   time_hour: 7
   time_minute: 57
   time_second: 41
   uptime: 11 days, 18:12
   uptime_days: 11
   uptime_hours: 18
   uptime_minutes: 12
   uptime_total_seconds: 1015920
   users: 2

The first three attributes come from "load average". Quoting from man
uptime: "The averages are taken over the three time intervals." Now,
the usage is trivial. For example,

 load_average: >
   {{ uptime.load_1m }},
   {{ uptime.load_5m}},
   {{ uptime.load_15m }}

gives

 load_average: |-
   1.84, 1.41, 1.21

--
Vladimir Botka

--
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/20230228081123.140af349%40gmail.com.

-- 
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/D209028D-24B1-4996-86A2-83EA001FBDB3%40nist.gov.