Re: [ansible-project] New releases: ansible-core 2.14.0 - C'mon Everybody

2022-11-07 Thread Nico Kadel-Garcia
On Mon, Nov 7, 2022 at 11:19 AM Matt Martz  wrote:
>
> Hi all- we're happy to announce the general release of:
>
> - ansible-core 2.14.0
>
>
> How to get it
> -
>
> $ python3 -m pip install --user ansible-core==2.14.0

For RHEL, this does not work on RHEL 7. python 2.7 is the default, and
the python3 package is python 3.6, too old to use.

For RHEL 8. RHEL 8 needs:

RHEL 8 needs this:

sudo dnf module enable python39
# because RHEL chose to use modularity for python, despite the
problems it causes
sudo dnf install python39 python39-pip
pip3.9 install --user ansible-core==2.14.0

The "python3" instructions work for RHEL 9 and Fedora, which have
recent enough python releases by default.

And I have, as so often lately, updated my RPM building tools at
https://github.com/nkadel/ansiblerepo/ . Building docs associated with
the packages requires an up-to-date sphinx, which is not available as
RPMs for RHEL 7 or RHEL 8, and I'm not going down the conflicting
dependency rathole to build those up. I'm a bit disappointed that Red
Hat does not publish a python39-sphinx for RHEL 8, but it's more work
than I want to take on.

-- 
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/CAOCN9rwvG5JtGdUxM40Hf-921T9W%3D%3DiSsif75-iktSCjiuUMOw%40mail.gmail.com.


Re: [ansible-project] [ISSUE] Ansible for VMware, deploy vms and update them

2022-11-07 Thread Mike Tipton
I was wondering if you figured out the "*I'll need to right-click on each 
VMs and set the network to "connected" since it doesn't do this 
automatically, i'll need to figure this out.*" part and update you with my 
findings as I ran into this as well.

It was as simple as adding perl to my base template as it is needed to do 
the customization after deployment.

Cheers,
Tipton

On Wednesday, August 24, 2022 at 12:07:44 AM UTC-4 mgma...@gmail.com wrote:

> I'll keep adding with my findings, might save people some time.
>
> Wrote playbook:
> - hosts: localhost
>   gather_facts: false
>   vars_files:
> - all_config.yml
>
>   tasks:
> - name: Gathering info from vms
>   community.vmware.vmware_vm_info:
>
> hostname: "{{ vcenter_hostname }}"
> username: "{{ vcenter_username }}"
> password: "{{ vcenter_password }}"
> validate_certs: False
> folder: "/Datacenter/vm/deployments/ubuntu"
>   delegate_to: localhost
>   register: vm_info
> - debug:
> var: name_ip
>   vars:
> name_ip: "{{ vm_info.virtual_machines|
>  items2dict(key_name='guest_name',
>value_name='ip_address') }}"
>
> which will spit out this:
>
> TASK [debug] 
> 
> ok: [localhost] => {
> "name_ip": {
> "Ubuntu 22.04 VDI Template": "192.168.1.122",
> "server01": "192.168.1.181",
> "server02": "192.168.1.114",
> "server03": "192.168.1.117"
> }
> }
>
> I think i'm getting close. Took me a whole 3 hours to figure this part.
>
> Now I need to save this into the ansible inventory (I think?) and run the 
> apt update and apt upgrade against those vms.
> On Tuesday, August 23, 2022 at 7:15:20 PM UTC-4 TheReal MVP wrote:
>
>> I'm getting close :)
>>
>> I created this playbook after finding the vmware_vm_info module
>>
>> - hosts: all
>>   gather_facts: false
>>   become: false
>>   tasks:
>> - name: Gathering info from vms from '{{ folder }}'
>>   community.vmware.vmware_vm_info:
>> hostname: 192.168.1.51
>> username: admini...@vsphere.local
>> password: password
>> validate_certs: False
>> folder: "/Datacenter/vm/deployments/ubuntu"
>>   delegate_to: localhost
>>   register: vm_info
>> - debug:
>> msg: "{{ vm_info }}"
>>
>> I'll get a dump of information from all 4 machines inside the folder 
>> specified.
>>
>> Now I need to find a way to extract the IP from it and save it somewhere 
>> to use it to connect to them :)
>>
>>
>> On Tuesday, August 23, 2022 at 2:03:47 PM UTC-4 dhevanyo...@gmail.com 
>> wrote:
>>
>>> Just use terraform
>>>
>>>
>>> On Tue., Aug. 23, 2022, 11:08 a.m. TheReal MVP,  
>>> wrote:
>>>
 Hi there,
 I've been banging my head with this for some time now and I can't 
 figure it out.

 I'm using Ansible the vmware commnity plugins to deploy 4 VMs from a 
 template and they all have DHCP running. Ultimately, I want to be able to 
 grab the IPs from all 4 VMs, connect to them and run some commands 
 (possibly update them and push my main ansible ssh key).

 *config.yml*
 vcenter_hostname: 'FQDN-of-my-vcenter'
 vcenter_username: 'admini...@vsphere.local'
 vcenter_password: 'MyPassword'
 vcenter_datastore: 'Storage'
 vcenter_datacenter: 'Datacenter'
 vcenter_folder: 'deployments/ubuntu'
 vcenter_datastore: 'Storage'

 guest_id: 'Ubuntu64'
 guest_network_1: 'VM Network'
 guest_network_2: 'Docker'
 guest_wait_for_ip_address: 'yes'
 guest_state: 'poweredon'

 # - Prepare VMs information
 machine_user: user
 machine_initial_user: root
 machine_initial_password: P@ssw0rdP@ssw0rd

 *ansible.cfg*
 # config file for ansible -- http://ansible.com/
 # ==

 # nearly all parameters can be overridden in ansible-playbook
 # or with command line flags. ansible will read ANSIBLE_CONFIG,
 # ansible.cfg in the current working directory, .ansible.cfg in
 # the home directory or /etc/ansible/ansible.cfg, whichever it
 # finds first

 [defaults]

 # some basic default values...
 library= ./library

 # additional paths to search for roles in, colon separated
 roles_path= ./roles

 [inventory]
 #Nothing in here

 My playbook
 *deploy-vm.yaml*
 root@user-ubuntu:/opt/ansible/multiple_vm# more deploy-vm.yaml
 ---
 - hosts: all
   gather_facts: false
   vars_files:
 - config.yml
   roles:
  - deploy-vm

 */roles/deploy-vm/tasks/main.yaml*
 ---
 # Deploy a VM from a template using Ansible 'vmware_guest' module
   - name: Deploying VMs
 community.vmware.vmware_guest:
   h

Re: [ansible-project] Question about community.general.opentelemetry callback

2022-11-07 Thread 'Felix Fontein' via Ansible Project
Hi,

unfortunately you did not mention which version of community.general
you are using. For opentelemetry-api 1.13.0 you need community.general
5.8.0, since that contains a bugfix which allows the opentelemetry
callback to work with that version. (It removed some helper function
that the plugin was using, see
https://github.com/ansible-collections/community.general/blob/stable-5/CHANGELOG.rst#bugfixes.)

Cheers,
Felix




On Mon, 7 Nov 2022 18:15:36 -0300
Daniel Barros  wrote:

> Yes, it's strange.
> 
> They are installed in that path
>  pip list -v | grep opent
> opentelemetry-api  1.13.0
>  /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip
> opentelemetry-exporter-otlp1.13.0
>  /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip
> opentelemetry-exporter-otlp-proto-grpc 1.13.0
>  /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip
> opentelemetry-exporter-otlp-proto-http 1.13.0
>  /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip
> opentelemetry-instrumentation  0.34b0
>  /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip
> opentelemetry-proto1.13.0
>  /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip
> opentelemetry-sdk  1.13.0
>  /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip
> opentelemetry-semantic-conventions 0.34b0
>  /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip
> 
> But I was able to make it work using a container on AWX. I'll try to
> reinstall my venv and packages to work locally.
> Thanks for your tips!!
> 
> On Mon, Nov 7, 2022 at 2:56 PM Matt Martz  wrote:
> 
> > Maybe also take a look at `pip list -v` to see the paths of where
> > those python libraries are installed.  And make sure they are
> > in /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages/
> >
> > On Mon, Nov 7, 2022 at 11:52 AM Dick Visser 
> > wrote: 
> >> That seems right.
> >> I don't know what it could be then.
> >>
> >> On Mon, 7 Nov 2022 at 10:58, Daniel Barros
> >>  wrote:
> >>  
> >>> Hi man.
> >>>
> >>> This is the entire output
> >>>
> >>> ansible --version
> >>> ansible [core 2.13.2]
> >>>   config file = None
> >>>   configured module search path =
> >>> ['/home/daniel/.ansible/plugins/modules',
> >>> '/usr/share/ansible/plugins/modules']
> >>>   ansible python module location =
> >>> /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages/ansible
> >>>   ansible collection location =
> >>> /home/daniel/.ansible/collections:/usr/share/ansible/collections
> >>>   executable location =
> >>> /home/daniel/py_venvs/ansible_2.13/bin/ansible python version =
> >>> 3.9.13 (main, May 23 2022, 22:02:02) [GCC 7.5.0] jinja version =
> >>> 3.1.2 libyaml = True
> >>>
> >>> On Saturday, October 29, 2022 at 12:49:36 PM UTC-3
> >>> dnmv...@gmail.com wrote:
> >>>  
>  On Fri, 28 Oct 2022 at 17:23, Daniel Barros
>   wrote:
>   
> > Hi man, thanks for the time.
> >
> > Please see the information as requested
> >
> > ansible --version
> > ansible [core 2.13.2]
> >  
> 
>  This is not the entire output. It should like this like this:
> 
>  ansible [core 2.11.7]
>    config file = /Users/dick.visser/git/
>  github.com/dnmvisser/tienhuis_ansible/ansible.cfg
>    configured module search path =
>  ['/Users/dick.visser/.ansible/plugins/modules',
>  '/usr/share/ansible/plugins/modules']
>    ansible python module location = /Users/dick.visser/git/
>  github.com/dnmvisser/tienhuis_ansible/venv/lib/python3.9/site-packages/ansible
>    ansible collection location =
>  /Users/dick.visser/.ansible/collections:/usr/share/ansible/collections
>    executable location = /Users/dick.visser/git/
>  github.com/dnmvisser/tienhuis_ansible/venv/bin/ansible
>    python version = 3.9.9 (main, Jan 25 2022, 23:02:06) [Clang
>  13.0.0 (clang-1300.0.29.30)]
>    jinja version = 3.0.3
>    libyaml = True
> 
> 
>   
> > pip --version
> > pip 22.3 from
> > /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages/pip
> > (python 3.9)
> >
> > python --version
> > Python 3.9.13
> >
> > On Fri, Oct 28, 2022 at 12:20 PM Dick Visser 
> > wrote:
> >  
> >> What does 'ansible --version' say?
> >> And 'pip --version'
> >>
> >>
> >>
> >> On Fri, 28 Oct 2022 at 16:58, Daniel Barros
> >>  wrote:
> >>  
> >>> Hi group, good day, how are you?
> >>>
> >>>
> >>>
> >>> I have a question about using community.general.opentelemetry
> >>> to send data to APM.
> >>>
> >>> I have set my ansible.cfg like this.
> >>>
> >>>
> >>>
> >>> [defaults]
> >>>
> >>> callbacks_enabled = community.general.opentelemetry
> >>>
> >>>
> >>>
> >>> [callback_opentelemetry]
> >>>
> >>> e

Re: [ansible-project] Question about community.general.opentelemetry callback

2022-11-07 Thread Daniel Barros
Yes, it's strange.

They are installed in that path
 pip list -v | grep opent
opentelemetry-api  1.13.0
 /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip
opentelemetry-exporter-otlp1.13.0
 /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip
opentelemetry-exporter-otlp-proto-grpc 1.13.0
 /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip
opentelemetry-exporter-otlp-proto-http 1.13.0
 /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip
opentelemetry-instrumentation  0.34b0
 /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip
opentelemetry-proto1.13.0
 /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip
opentelemetry-sdk  1.13.0
 /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip
opentelemetry-semantic-conventions 0.34b0
 /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages pip

But I was able to make it work using a container on AWX. I'll try to
reinstall my venv and packages to work locally.
Thanks for your tips!!

On Mon, Nov 7, 2022 at 2:56 PM Matt Martz  wrote:

> Maybe also take a look at `pip list -v` to see the paths of where those
> python libraries are installed.  And make sure they are
> in /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages/
>
> On Mon, Nov 7, 2022 at 11:52 AM Dick Visser  wrote:
>
>> That seems right.
>> I don't know what it could be then.
>>
>> On Mon, 7 Nov 2022 at 10:58, Daniel Barros 
>> wrote:
>>
>>> Hi man.
>>>
>>> This is the entire output
>>>
>>> ansible --version
>>> ansible [core 2.13.2]
>>>   config file = None
>>>   configured module search path =
>>> ['/home/daniel/.ansible/plugins/modules',
>>> '/usr/share/ansible/plugins/modules']
>>>   ansible python module location =
>>> /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages/ansible
>>>   ansible collection location =
>>> /home/daniel/.ansible/collections:/usr/share/ansible/collections
>>>   executable location = /home/daniel/py_venvs/ansible_2.13/bin/ansible
>>>   python version = 3.9.13 (main, May 23 2022, 22:02:02) [GCC 7.5.0]
>>>   jinja version = 3.1.2
>>>   libyaml = True
>>>
>>> On Saturday, October 29, 2022 at 12:49:36 PM UTC-3 dnmv...@gmail.com
>>> wrote:
>>>
 On Fri, 28 Oct 2022 at 17:23, Daniel Barros 
 wrote:

> Hi man, thanks for the time.
>
> Please see the information as requested
>
> ansible --version
> ansible [core 2.13.2]
>

 This is not the entire output. It should like this like this:

 ansible [core 2.11.7]
   config file = /Users/dick.visser/git/
 github.com/dnmvisser/tienhuis_ansible/ansible.cfg
   configured module search path =
 ['/Users/dick.visser/.ansible/plugins/modules',
 '/usr/share/ansible/plugins/modules']
   ansible python module location = /Users/dick.visser/git/
 github.com/dnmvisser/tienhuis_ansible/venv/lib/python3.9/site-packages/ansible
   ansible collection location =
 /Users/dick.visser/.ansible/collections:/usr/share/ansible/collections
   executable location = /Users/dick.visser/git/
 github.com/dnmvisser/tienhuis_ansible/venv/bin/ansible
   python version = 3.9.9 (main, Jan 25 2022, 23:02:06) [Clang 13.0.0
 (clang-1300.0.29.30)]
   jinja version = 3.0.3
   libyaml = True



> pip --version
> pip 22.3 from
> /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages/pip (python
> 3.9)
>
> python --version
> Python 3.9.13
>
> On Fri, Oct 28, 2022 at 12:20 PM Dick Visser 
> wrote:
>
>> What does 'ansible --version' say?
>> And 'pip --version'
>>
>>
>>
>> On Fri, 28 Oct 2022 at 16:58, Daniel Barros 
>> wrote:
>>
>>> Hi group, good day, how are you?
>>>
>>>
>>>
>>> I have a question about using community.general.opentelemetry to
>>> send data to APM.
>>>
>>> I have set my ansible.cfg like this.
>>>
>>>
>>>
>>> [defaults]
>>>
>>> callbacks_enabled = community.general.opentelemetry
>>>
>>>
>>>
>>> [callback_opentelemetry]
>>>
>>> enable_from_environment = ANSIBLE_OPENTELEMETRY_ENABLED
>>>
>>>
>>>
>>> And then environment variables like this.
>>>
>>> OTEL_EXPORTER_OTLP_ENDPOINT=http://elk-server:8200
>>>
>>> OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer xx"
>>>
>>> OTEL_SERVICE_NAME=ansible
>>>
>>>
>>>
>>> I have also installed the telemetry python packages
>>>
>>> pip list | grep opentele
>>> opentelemetry-api  1.13.0
>>> opentelemetry-exporter-otlp1.13.0
>>> opentelemetry-exporter-otlp-proto-grpc 1.13.0
>>> opentelemetry-exporter-otlp-proto-http 1.13.0
>>> opentelemetry-instrumentation  0.34b0
>>> opentelemetry-proto1.13

Re: [ansible-project] Question about community.general.opentelemetry callback

2022-11-07 Thread Matt Martz
Maybe also take a look at `pip list -v` to see the paths of where those
python libraries are installed.  And make sure they are
in /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages/

On Mon, Nov 7, 2022 at 11:52 AM Dick Visser  wrote:

> That seems right.
> I don't know what it could be then.
>
> On Mon, 7 Nov 2022 at 10:58, Daniel Barros 
> wrote:
>
>> Hi man.
>>
>> This is the entire output
>>
>> ansible --version
>> ansible [core 2.13.2]
>>   config file = None
>>   configured module search path =
>> ['/home/daniel/.ansible/plugins/modules',
>> '/usr/share/ansible/plugins/modules']
>>   ansible python module location =
>> /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages/ansible
>>   ansible collection location =
>> /home/daniel/.ansible/collections:/usr/share/ansible/collections
>>   executable location = /home/daniel/py_venvs/ansible_2.13/bin/ansible
>>   python version = 3.9.13 (main, May 23 2022, 22:02:02) [GCC 7.5.0]
>>   jinja version = 3.1.2
>>   libyaml = True
>>
>> On Saturday, October 29, 2022 at 12:49:36 PM UTC-3 dnmv...@gmail.com
>> wrote:
>>
>>> On Fri, 28 Oct 2022 at 17:23, Daniel Barros 
>>> wrote:
>>>
 Hi man, thanks for the time.

 Please see the information as requested

 ansible --version
 ansible [core 2.13.2]

>>>
>>> This is not the entire output. It should like this like this:
>>>
>>> ansible [core 2.11.7]
>>>   config file = /Users/dick.visser/git/
>>> github.com/dnmvisser/tienhuis_ansible/ansible.cfg
>>>   configured module search path =
>>> ['/Users/dick.visser/.ansible/plugins/modules',
>>> '/usr/share/ansible/plugins/modules']
>>>   ansible python module location = /Users/dick.visser/git/
>>> github.com/dnmvisser/tienhuis_ansible/venv/lib/python3.9/site-packages/ansible
>>>   ansible collection location =
>>> /Users/dick.visser/.ansible/collections:/usr/share/ansible/collections
>>>   executable location = /Users/dick.visser/git/
>>> github.com/dnmvisser/tienhuis_ansible/venv/bin/ansible
>>>   python version = 3.9.9 (main, Jan 25 2022, 23:02:06) [Clang 13.0.0
>>> (clang-1300.0.29.30)]
>>>   jinja version = 3.0.3
>>>   libyaml = True
>>>
>>>
>>>
 pip --version
 pip 22.3 from
 /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages/pip (python
 3.9)

 python --version
 Python 3.9.13

 On Fri, Oct 28, 2022 at 12:20 PM Dick Visser  wrote:

> What does 'ansible --version' say?
> And 'pip --version'
>
>
>
> On Fri, 28 Oct 2022 at 16:58, Daniel Barros 
> wrote:
>
>> Hi group, good day, how are you?
>>
>>
>>
>> I have a question about using community.general.opentelemetry to send
>> data to APM.
>>
>> I have set my ansible.cfg like this.
>>
>>
>>
>> [defaults]
>>
>> callbacks_enabled = community.general.opentelemetry
>>
>>
>>
>> [callback_opentelemetry]
>>
>> enable_from_environment = ANSIBLE_OPENTELEMETRY_ENABLED
>>
>>
>>
>> And then environment variables like this.
>>
>> OTEL_EXPORTER_OTLP_ENDPOINT=http://elk-server:8200
>>
>> OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer xx"
>>
>> OTEL_SERVICE_NAME=ansible
>>
>>
>>
>> I have also installed the telemetry python packages
>>
>> pip list | grep opentele
>> opentelemetry-api  1.13.0
>> opentelemetry-exporter-otlp1.13.0
>> opentelemetry-exporter-otlp-proto-grpc 1.13.0
>> opentelemetry-exporter-otlp-proto-http 1.13.0
>> opentelemetry-instrumentation  0.34b0
>> opentelemetry-proto1.13.0
>> opentelemetry-sdk  1.13.0
>> opentelemetry-semantic-conventions 0.34b0
>>
>>
>>
>> But still getting this error, does anyone have some ideas?
>>
>> Appreciate it
>>
>>
>>
>> [WARNING]: Skipping callback 'community.general.opentelemetry',
>> unable to load due to: The `opentelemetry-api`,
>> `opentelemetry-exporter-otlp` or `opentelemetry-sdk` must be
>> installed to use this plugin
>>
>>
>>
>> --
>> 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/5c9d6031-c456-454b-8832-9e315b011981n%40googlegroups.com
>> 
>> .
>>
> --
> Sent from Gmail Mobile
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups

Re: [ansible-project] Question about community.general.opentelemetry callback

2022-11-07 Thread Dick Visser
That seems right.
I don't know what it could be then.

On Mon, 7 Nov 2022 at 10:58, Daniel Barros 
wrote:

> Hi man.
>
> This is the entire output
>
> ansible --version
> ansible [core 2.13.2]
>   config file = None
>   configured module search path =
> ['/home/daniel/.ansible/plugins/modules',
> '/usr/share/ansible/plugins/modules']
>   ansible python module location =
> /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages/ansible
>   ansible collection location =
> /home/daniel/.ansible/collections:/usr/share/ansible/collections
>   executable location = /home/daniel/py_venvs/ansible_2.13/bin/ansible
>   python version = 3.9.13 (main, May 23 2022, 22:02:02) [GCC 7.5.0]
>   jinja version = 3.1.2
>   libyaml = True
>
> On Saturday, October 29, 2022 at 12:49:36 PM UTC-3 dnmv...@gmail.com
> wrote:
>
>> On Fri, 28 Oct 2022 at 17:23, Daniel Barros 
>> wrote:
>>
>>> Hi man, thanks for the time.
>>>
>>> Please see the information as requested
>>>
>>> ansible --version
>>> ansible [core 2.13.2]
>>>
>>
>> This is not the entire output. It should like this like this:
>>
>> ansible [core 2.11.7]
>>   config file = /Users/dick.visser/git/
>> github.com/dnmvisser/tienhuis_ansible/ansible.cfg
>>   configured module search path =
>> ['/Users/dick.visser/.ansible/plugins/modules',
>> '/usr/share/ansible/plugins/modules']
>>   ansible python module location = /Users/dick.visser/git/
>> github.com/dnmvisser/tienhuis_ansible/venv/lib/python3.9/site-packages/ansible
>>   ansible collection location =
>> /Users/dick.visser/.ansible/collections:/usr/share/ansible/collections
>>   executable location = /Users/dick.visser/git/
>> github.com/dnmvisser/tienhuis_ansible/venv/bin/ansible
>>   python version = 3.9.9 (main, Jan 25 2022, 23:02:06) [Clang 13.0.0
>> (clang-1300.0.29.30)]
>>   jinja version = 3.0.3
>>   libyaml = True
>>
>>
>>
>>> pip --version
>>> pip 22.3 from
>>> /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages/pip (python
>>> 3.9)
>>>
>>> python --version
>>> Python 3.9.13
>>>
>>> On Fri, Oct 28, 2022 at 12:20 PM Dick Visser  wrote:
>>>
 What does 'ansible --version' say?
 And 'pip --version'



 On Fri, 28 Oct 2022 at 16:58, Daniel Barros 
 wrote:

> Hi group, good day, how are you?
>
>
>
> I have a question about using community.general.opentelemetry to send
> data to APM.
>
> I have set my ansible.cfg like this.
>
>
>
> [defaults]
>
> callbacks_enabled = community.general.opentelemetry
>
>
>
> [callback_opentelemetry]
>
> enable_from_environment = ANSIBLE_OPENTELEMETRY_ENABLED
>
>
>
> And then environment variables like this.
>
> OTEL_EXPORTER_OTLP_ENDPOINT=http://elk-server:8200
>
> OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer xx"
>
> OTEL_SERVICE_NAME=ansible
>
>
>
> I have also installed the telemetry python packages
>
> pip list | grep opentele
> opentelemetry-api  1.13.0
> opentelemetry-exporter-otlp1.13.0
> opentelemetry-exporter-otlp-proto-grpc 1.13.0
> opentelemetry-exporter-otlp-proto-http 1.13.0
> opentelemetry-instrumentation  0.34b0
> opentelemetry-proto1.13.0
> opentelemetry-sdk  1.13.0
> opentelemetry-semantic-conventions 0.34b0
>
>
>
> But still getting this error, does anyone have some ideas?
>
> Appreciate it
>
>
>
> [WARNING]: Skipping callback 'community.general.opentelemetry', unable
> to load due to: The `opentelemetry-api`,
> `opentelemetry-exporter-otlp` or `opentelemetry-sdk` must be installed
> to use this plugin
>
>
>
> --
> 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/5c9d6031-c456-454b-8832-9e315b011981n%40googlegroups.com
> 
> .
>
 --
 Sent from Gmail Mobile

 --
 You received this message because you are subscribed to a topic in the
 Google Groups "Ansible Project" group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/ansible-project/sB3WiogfqxU/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 ansible-proje...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CAF8BbLaTBWay_OrwwA%2BPyB%3DoaObV7paJ80Q%3Db%3DXOftqNXd5UeQ%40mail.gmail.com
 

[ansible-project] File location path not working in ansible-navigator vs ansible-playbook

2022-11-07 Thread cary.c...@gmail.com
We are testing out current playbooks we have developed with 
ansible-playbook and are having issues when defining a file path location 
in our include_vars: section of the playbook

e.g this works in ansible-navigator but we get the error path not found in 
ansible-navigator.  We get this error when running in an ee or against 
ansible engine in navigator.

- name: include vars
  include_vars:
file: ../sds.yml
name: appconfig

Can anyone clarify what navigator is doing differently to cause this error?

Thanks



-- 
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/6980162b-52ea-40ec-b553-e6741ffbda3bn%40googlegroups.com.


[ansible-project] netbox inventory fails with message: object has no attribute '_vars'

2022-11-07 Thread heinz6...@gmail.com
Hi.,

I have a new setup of netbox on ubuntu.
- netbox install according to setup
- apt install ansible pynetbox

ansible.cfg:
[inventory] 
enable_plugins = host_list, auto, yaml, netbox.netbox.nb_inventory

netbox_inventory.yaml:
plugin: netbox.netbox.nb_inventory 
api_endpoint: https://localhost 
token:  12345

ansible-inventory -vvv -llist -i netbox_inventory.yaml
fails with the error message:
[WARNING]:  * Failed to parse /root/netbox_inventory.yaml with 
ansible_collections.netbox.netbox.plugins.inventory.nb_inventory plugin: 
'InventoryModule' object has 
no attribute '_vars' 
 File "/usr/lib/python3/dist-packages/ansible/inventory/manager.py", line 
289, in parse_source 
   plugin.parse(self._inventory, self._loader, source, cache=cache) 
 File 
"/root/.ansible/collections/ansible_collections/netbox/netbox/plugins/inventory/nb_inventory.py",
 
line 1953, in parse 
   self.templar.available_variables = self._vars 
[WARNING]: Unable to parse /root/netbox_inventory.yaml as an inventory 
source

Any ideas?

Michael

-- 
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/f99733f5-6268-4d9d-a03d-e17d3c6059c1n%40googlegroups.com.


[ansible-project] New releases: ansible-core 2.13.6

2022-11-07 Thread Matt Martz
Hi all- we're happy to announce the general release of:

- ansible-core 2.13.6


How to get it
-

$ python3 -m pip install --user ansible-core==2.13.6

The release artifacts can be found here:

* ansible-core 2.13.6
Wheel:
https://files.pythonhosted.org/packages/8d/15/fb1db37ad9583724c6f378f7c9d77da3a56c5ebe0f8c470947c078b4e2f2/ansible_core-2.13.6-py3-none-any.whl
Source:
https://files.pythonhosted.org/packages/27/82/d3f91d2bff791291c6fa5eddd0a338546ca4a63d5c4bf80ca1f44f6a438d/ansible-core-2.13.6.tar.gz


Checksums
-

# ansible_core-2.13.6-py3-none-any.whl: 2076597 bytes
SHA256 (ansible_core-2.13.6-py3-none-any.whl) =
e31fd550a5ea9423f1fc1391de6b41bb0d264a83bbfc9c7edfef0f78b7624fd3
# ansible-core-2.13.6.tar.gz: 13938462 bytes
SHA256 (ansible-core-2.13.6.tar.gz) =
31fe322b63290674a8f7386110df501f0044aa44890be3ab313a6e225b9a29cf


What's new
--

This release is a maintenance release containing numerous bugfixes.

The full changelog can be found here:

* ansible-core 2.13.6

https://github.com/ansible/ansible/blob/v2.13.6/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 28
November 2022. 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/CAD8N0v8xgFxBGkx7Z8MEa_iCySoXLqpeH%3DRWcbEmjDZ1Se3AcQ%40mail.gmail.com.


[ansible-project] New releases: ansible-core 2.14.0 - C'mon Everybody

2022-11-07 Thread Matt Martz
Hi all- we're happy to announce the general release of:

- ansible-core 2.14.0


How to get it
-

$ python3 -m pip install --user ansible-core==2.14.0

The release artifacts can be found here:

* ansible-core 2.14.0
Wheel:
https://files.pythonhosted.org/packages/ef/ef/0448f37c05769497e919c04eb668f379fbaeaf0c3188c01cd09c92253f76/ansible_core-2.14.0-py3-none-any.whl
Source:
https://files.pythonhosted.org/packages/ea/69/2c760df481d425b0ec3555c24d0adb441fca7ebbc22962e733c9c4e05f80/ansible-core-2.14.0.tar.gz


Checksums
-

# ansible_core-2.14.0-py3-none-any.whl: 2174719 bytes
SHA256 (ansible_core-2.14.0-py3-none-any.whl) =
b191d397c81514bd1922e00e16f0b8ec52e0bcb19b61cc4500085f5f92470cf2
# ansible-core-2.14.0.tar.gz: 13988948 bytes
SHA256 (ansible-core-2.14.0.tar.gz) =
fa48b481cb623bf79bb903f223097681a0c13e1b4ec7e78e7dd7d858d36a34b2


What's new
--

This release is a major release. The full changelog can be found here:

* ansible-core 2.14.0

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

Important Changes:

* Implement sidecar docs to support documenting filter/test plugins, as
well as non Python modules
* Proxy Display over queue from forks
* Move handler processing into new PlayIterator phase to use the configured
strategy
* Convert FieldAttribute to data descriptors to avoid complex meta classes
* Drop Python 3.8 support for controller
* Enforce running controller code with the Python locale and filesystem
encoding set to UTF-8
* Ensure stdin/stdout/stderr file handles are using blocking IO.
* Evaluate variables lazily to allow defined tests to properly detect when
dependent variables are undefined


What's the schedule for future maintenance releases?


The next batch of release candidates is planned to be released on 28
November 2022. 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_dQp_DBxhjRvFYujkNE3eDB2fLQ5_yJZJ5Zy48gV%2BqgQ%40mail.gmail.com.


Re: [ansible-project] a list of changes in handlers

2022-11-07 Thread Matt Martz
Add a register to the task making the changes, and then inspect the
registered var in the handler.

On Mon, Nov 7, 2022 at 8:50 AM gregory@gmail.com <
gregory.ediga...@gmail.com> wrote:

> Hello,
>
> Is that possible in handlers to have a list of files changed by task(s)
> calling it?
> If not, perhaps there is some tricks?
> Asking because I need to reload feeding changed (and only changed) files
> to a daemon.
>
> Thank you.
>
>
>
>
> --
> 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/4fe6ee09-968b-4d5e-b9d0-3cbfa815ad22n%40googlegroups.com
> 
> .
>


-- 
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/CAD8N0v8PHEV%2BSvJigaof%2BHrf2pPc_-H1hE8K%3Db9Tm5AS1SZ0Lg%40mail.gmail.com.


[ansible-project] a list of changes in handlers

2022-11-07 Thread gregory....@gmail.com
Hello, 

Is that possible in handlers to have a list of files changed by task(s) 
calling it?
If not, perhaps there is some tricks?
Asking because I need to reload feeding changed (and only changed) files to 
a daemon.

Thank you.  


  

-- 
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/4fe6ee09-968b-4d5e-b9d0-3cbfa815ad22n%40googlegroups.com.


[ansible-project] creating a csv file on localhost with lineinfile

2022-11-07 Thread dulhaver via Ansible Project
I want to create a csv with 3 values per host

the FQDN of the host, a string "postgres" and the stdout of a vairable I have 
defined

here is my playbook which I am testing againt 3 hosts which all have running 
postgres, so I expect/aim at 3 lines

###
---

- hosts: postgres
  vars_files: defaults.yml

  tasks:
- name: check services - postgresql.service
  ansible.builtin.command:
cmd: systemctl is-active postgresql.service
  register: pg_active
  ignore_errors: true

- name: print value of 'pg_active.stdout'
  ansible.builtin.debug:
msg: postgresql is "{{ pg_active.stdout }}"
  # when: pg_active.stdout == "active"

- name: check utf8 - postgres (if running)
  ansible.builtin.command:
cmd: /opt/db/postgres/postgresql/bin/psql -tAc "SHOW server_encoding;"
  when: pg_active.stdout == "active"
  register: pg_encoding
  become: true
  become_user: "{{ postgres_become_user }}"

- name: check utf8 - print value of 'pg_encoding.stdout'
  ansible.builtin.debug:
msg: "{{ pg_encoding.stdout }}"
  when: pg_active.stdout == "active"

- name: CSV - Create file and set the header
  delegate_to: localhost
  lineinfile:
dest: "./ignore/{{ ansible_play_name }}.csv"
line:
  hostname;dbms;encoding
create: yes
state: present

- name: write result to output.csv
  delegate_to: localhost
  lineinfile:
dest: "./ignore/{{ ansible_play_name }}.csv"
line: >
  {{ ansible_fqdn }};{{ ansible_play_name}};{{ pg_encoding.stdout }}
insertafter: EOF
  when: pg_active.stdout == "active"

###

This basically does what it should. However it creates an empty line between 
the hosts and does append entries if the output-file already exists.

I am aware that I can delete empty line with lineinfile but was wondering 
whether there is a way not net create them to begin with.

-- 
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/929395626.203636.1667826432948%40office.mailbox.org.


Re: [ansible-project] Question about community.general.opentelemetry callback

2022-11-07 Thread Daniel Barros
Hi man.

This is the entire output

ansible --version
ansible [core 2.13.2]
  config file = None
  configured module search path = ['/home/daniel/.ansible/plugins/modules', 
'/usr/share/ansible/plugins/modules']
  ansible python module location = 
/home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages/ansible
  ansible collection location = 
/home/daniel/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/daniel/py_venvs/ansible_2.13/bin/ansible
  python version = 3.9.13 (main, May 23 2022, 22:02:02) [GCC 7.5.0]
  jinja version = 3.1.2
  libyaml = True

On Saturday, October 29, 2022 at 12:49:36 PM UTC-3 dnmv...@gmail.com wrote:

> On Fri, 28 Oct 2022 at 17:23, Daniel Barros  wrote:
>
>> Hi man, thanks for the time.
>>
>> Please see the information as requested
>>
>> ansible --version
>> ansible [core 2.13.2]
>>
>
> This is not the entire output. It should like this like this:
>
> ansible [core 2.11.7] 
>   config file = /Users/dick.visser/git/
> github.com/dnmvisser/tienhuis_ansible/ansible.cfg
>   configured module search path = 
> ['/Users/dick.visser/.ansible/plugins/modules', 
> '/usr/share/ansible/plugins/modules']
>   ansible python module location = /Users/dick.visser/git/
> github.com/dnmvisser/tienhuis_ansible/venv/lib/python3.9/site-packages/ansible
>   ansible collection location = 
> /Users/dick.visser/.ansible/collections:/usr/share/ansible/collections
>   executable location = /Users/dick.visser/git/
> github.com/dnmvisser/tienhuis_ansible/venv/bin/ansible
>   python version = 3.9.9 (main, Jan 25 2022, 23:02:06) [Clang 13.0.0 
> (clang-1300.0.29.30)]
>   jinja version = 3.0.3
>   libyaml = True
>
>  
>
>> pip --version
>> pip 22.3 from 
>> /home/daniel/py_venvs/ansible_2.13/lib/python3.9/site-packages/pip (python 
>> 3.9)
>>
>> python --version
>> Python 3.9.13
>>
>> On Fri, Oct 28, 2022 at 12:20 PM Dick Visser  wrote:
>>
>>> What does 'ansible --version' say?
>>> And 'pip --version'
>>>
>>>
>>>
>>> On Fri, 28 Oct 2022 at 16:58, Daniel Barros  
>>> wrote:
>>>
 Hi group, good day, how are you?

  

 I have a question about using community.general.opentelemetry to send 
 data to APM.

 I have set my ansible.cfg like this.

  

 [defaults]

 callbacks_enabled = community.general.opentelemetry

  

 [callback_opentelemetry]

 enable_from_environment = ANSIBLE_OPENTELEMETRY_ENABLED

  

 And then environment variables like this.

 OTEL_EXPORTER_OTLP_ENDPOINT=http://elk-server:8200

 OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer xx"

 OTEL_SERVICE_NAME=ansible

  

 I have also installed the telemetry python packages

 pip list | grep opentele
 opentelemetry-api  1.13.0
 opentelemetry-exporter-otlp1.13.0
 opentelemetry-exporter-otlp-proto-grpc 1.13.0
 opentelemetry-exporter-otlp-proto-http 1.13.0
 opentelemetry-instrumentation  0.34b0
 opentelemetry-proto1.13.0
 opentelemetry-sdk  1.13.0
 opentelemetry-semantic-conventions 0.34b0

  

 But still getting this error, does anyone have some ideas?

 Appreciate it

  

 [WARNING]: Skipping callback 'community.general.opentelemetry', unable 
 to load due to: The `opentelemetry-api`,
 `opentelemetry-exporter-otlp` or `opentelemetry-sdk` must be installed 
 to use this plugin

  

 -- 
 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/5c9d6031-c456-454b-8832-9e315b011981n%40googlegroups.com
  
 
 .

>>> -- 
>>> Sent from Gmail Mobile
>>>
>>> -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "Ansible Project" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/ansible-project/sB3WiogfqxU/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to 
>>> ansible-proje...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/CAF8BbLaTBWay_OrwwA%2BPyB%3DoaObV7paJ80Q%3Db%3DXOftqNXd5UeQ%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Pro