[ansible-project] nested roles

2022-06-17 Thread John Petro
I have a question regarding nested roles.

Back Story:  I am doing some code reviews for some ansible code a coworker
has done.  I noticed that they are importing other roles into the role they
are working on.

Question:  I feel like this is not a good idea, that dependencies should be
taken care of at the playbook level, but I am having a difficult time
justifying why nesting roles is not necessarily a good idea, so I am
looking for some feedback to help me here.  I welcome your thoughts on
this...

--John

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


Re: [ansible-project] File date/time stamps

2022-06-17 Thread Vladimir Botka
On Fri, 17 Jun 2022 10:56:13 +0100
Antony Stone  wrote:

> I have a generic question about ansible, and the way it manages files on 
> target 
> (managed) systems.  They're all Linux systems.
> 
> I'm working in an environment where a colleague is running ansible scripts to 
> manage servers I work with, and I see that every time ansible runs, it 
> updates 
> date and time stamps on files it is managing, even when the content is 
> already 
> correct and isn't being changed.
> 
> Is this a standard feature of ansible and the way it does configuration 
> management, or does it suggest that there's something incorrect or at least 
> inefficient about the way it's being used here?

No. It's not a standard feature of Ansible. Just the opposite, in
most cases the goal is to make a playbook idempotent. There should be
no changes reported when running a playbook repeatedly.

It depends on the module and it might be configurable. For example,
the module *file* allows to preserve *access_time* and
*modification_time* because you might want to configure them depending
on your use case.
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/file_module.html

Try to find out which Ansible module(s) is/are causing the troubles.
The task should report 'changed: true'. For example, the task below
(running at localhost only)
  
- file:
state: touch
path: /tmp/test

will repeatedly report 'changed'

  TASK [file] 
  changed: [localhost]

The task will become idempotent when you set both *access_time* and
*modification_time* to 'preserve'

- file:
state: touch
path: /tmp/test
access_time: preserve
modification_time: preserve

To move on, it will be necessary to learn details.

-- 
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/20220617142423.2c8a62e9%40gmail.com.


pgpGZSeZSDni6.pgp
Description: OpenPGP digital signature


[ansible-project] File date/time stamps

2022-06-17 Thread Antony Stone
Hi.

I have a generic question about ansible, and the way it manages files on target 
(managed) systems.  They're all Linux systems.

I'm working in an environment where a colleague is running ansible scripts to 
manage servers I work with, and I see that every time ansible runs, it updates 
date and time stamps on files it is managing, even when the content is already 
correct and isn't being changed.

Is this a standard feature of ansible and the way it does configuration 
management, or does it suggest that there's something incorrect or at least 
inefficient about the way it's being used here?

I'm really not familiar with ansible myself, but I have used puppet in the 
past, and that didn't do this - if a file was already correct it did not get 
touched.

Thanks for any advice.


Antony.

-- 
Numerous psychological studies over the years have demonstrated that the 
majority of people genuinely believe they are not like the majority of people.

   Please reply to the list;
 please *don't* CC me.

-- 
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/202206171056.14153.Antony.Stone%40ansible.open.source.it.


Re: [ansible-project] interprete_python error..

2022-06-17 Thread dulhaver via Ansible Project


I am pretty new to Ansible myself, but based on the error message the 
first thing I would try was checking whether a package python-setuptools 
was installed on the 172.16.13.160 host.




On 17.06.22 07:55, 'Shivakumar Venkataswamy' via Ansible Project wrote:

Hi team,
I'm traying to install python modules.. during execute facing below 
error.. please help me out..


An exception occurred during task execution. To see the full 
traceback, use -vvv. The error was: ImportError: No module named 
pkg_resources
fatal: [172.16.13.160]: FAILED! => {"changed": false, "msg": "Failed 
to import the required Python library (setuptools) on 172.16.13.160's 
Python /usr/bin/python. Please read module documentation and install 
in the appropriate location. If the required library is installed, but 
Ansible is using the wrong Python interpreter, please consult the 
documentation on ansible_python_interpreter"}

--
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/3ddc914f-11b4-4996-98e2-6d5a3d76a444n%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/b11d9129-0292-25d9-112f-d5d7ae1112b9%40mailbox.org.


[ansible-project] Could not find imported module support code for community.vmware (AWX -13.0)

2022-06-17 Thread Aditya Chauhan
We are using virtual environment in AWX 13 and its running with “python3.6” 
& Dev AWX execution environment is “AWX EE 0.5.0 
”

We are receiving a failed message while executing job template in AWX 
(13.0) to connect VMware Vcenters, as per our initial observation this 
failed error message is receiving when unable to find module 
“community.vmware.vmware_datacenter_info”. 

Error message - fatal: [localhost]: FAILED! => {"msg": "Could not find 
imported module support code for version. Looked for either LooseVersion.py 
or version.py"}

We gone through the below Ansible documentation for 
"community.vmware.vmware_datacenter_info module – Gather information about 
VMware vSphere Datacenters" and requirements "python >= 2.7 & PyVmomi" 
exist on Linux server. 

https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_datacenter_info_module.html
 

 

We don’t find any other VMware data center info module other than community 
module. 

https://docs.ansible.com/ansible/2.9/collections/community/vmware/vmware_datacenter_info_module.html
 

 

Below collections are mentioned in requirements.yml file.

collections:

- community.general

- community.vmware

 

However the same job template is working fine in other AWX environment 
(19.0) on same server linux server.

 Appreciate any help on this issue.

FYI - We posted same query in AWX project so they responded to reach out to 
collection maintainers of vmware modules (AWX - Could not find imported 
module support code for community.vmware (AWX -13.0) (google.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/3a41296e-4cbb-4c41-aff5-3d7c09cc4cbcn%40googlegroups.com.