Category : ansible

I found the following problem on my Mac (BigSur – 11.6) Had installed ansible (using pip) and developing playbook/role for quite a while Installed pyenv and then installed python 3.9.7 When executing a simple playbook on remote linux machines I had the following error (‘module (ansible.legacy.setup) is missing interpreter line’ when executing the first simple ..

Read more

Consider the following Ansible task: – name: "Install Python packages" ansible.builtin.pip: name: – "foobar" extra_args: "–no-index –find-links=file://{{ role_path }}/files/pip/" This task installs a Python package from a pre-downloaded package file which is stored with the Ansible role. However, there is a gotcha here: if the path on disk where the Ansible role is located contains ..

Read more

as you can see from the code snippet below, ansible’s executable seems to be ignoring the ansible_python_interpreter variable. Without resorting to an inventory file (this is for a gitlab pipeline based on hashicorp’s packer – which calls ansible), how could I enforce ansible to use whatever python version I have? In this case, it’s an ..

Read more

I would like to use with_items to configure my interfaces in my switch but I have this error when I run my playbook. Can someone help me please ? Here is the output with -vvvv options: AttributeError: ‘list’ object has no attribute ‘startswith’ failed: [DTY] (item={u’int_name’: u’GigabitEthernet1/0/46′, u’vlan_id’: 400, u’desc’: u’Internet vers Routeur’}) => { ..

Read more

Im new to Anisble and been confused by the Ansible config file. I installed ansible on ubuntu 20.04 over apt like discribed in the offical docs I dont Understand why the config supposed the library and modules_utils in that path: [defaults] library = ~/.ansible/plugins/modules:/usr/share/ansible/plugins/modules module_utils = ~/.ansible/plugins/module_utils:/usr/share/ansible/plugins/module_utils But there are no Modules etc in /usr/share/ansible/plugins/modules! ..

Read more

I am running Ansible Sanity test and facing an issue with error message "ansible-format-automatic-specification: Format string contains automatic field numbering specification" error is hitting on below code. stserials.add(str(serial)) results[‘comment’] = ‘Server serial(s) {} removed completely.’.format(",".join(stserials)) may some one please help me to understand what is going wrong with the code. Source: Python-3x..

Read more

I’m having problems getting the ansible version to show when I run the command ansible –version What it returns are: ➜ ~ ansible –version ansible [core 2.11.6] config file = None configured module search path = [‘/Users/kristinabressler/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’] ansible python module location = /Users/kristinabressler/Library/Python/3.9/lib/python/site-packages/ansible ansible collection location = /Users/kristinabressler/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible python version ..

Read more