ansible

ansible molecule "python not found"

ansible molecule "python not found" Question: I have some ansible roles and I would like to use molecule testing with them. When I execute command molecule init scenario -r get_files_uid -d docker I get the following file structure get_files_uid ├── molecule │ └── default │ ├── converge.yml │ ├── molecule.yml │ └── verify.yml ├── tasks …

Total answers: 1

insert files lines into another depending regex filter in Ansible

insert files lines into another depending regex filter in Ansible Question: I would copy lines from a file /tmp/test1 to a file /tmp/test2 the /tmp/test1 contains: + : argument1 : ALL + : argument2 : ALL + : @test1 : ALL + : @test2 : ALL + : @test3 : ALL the /tmp/test2 contains: + …

Total answers: 1

Convert a string using regex_replace filter python and ansible

Convert a string using regex_replace filter python and ansible Question: i would convert all the lines here @catn@chickennapplenfruitnjuice into + : @cat : alln+ :@chicken: alln+ :apple : alln+ : fruit : allnjuice : all in other hand i would get this for every line + : value : all i would use regex_replace filter …

Total answers: 1

Can not run Ansible after installing python 3.10

Can not run Ansible after installing python 3.10 Question: Suddenly I cannot run ansible. Whenever I try any ansible command like ansible-playbook, ansible version, etc. it shows error `/Users/myusername/Library/Python/2.7/bin/ansible: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/: bad interpreter: No such file or directory`, Even if I let ansible run different python version, like ansible-playbook –version -e ‘ansible_python_interpreter=/usr/bin/python3, it shows the same …

Total answers: 1

Ansible – Member not found when using json_modify.py

Ansible – Member not found when using json_modify.py Question: I’m trying to modify the json public_ip_allocation_method value using json_modify.py. But I get the following error: "msg": "member ” not found in {‘name’: ‘Ubuntu915’, ‘private_ip_address’: ‘10.0.0.5’, ‘private_ip_allocation_method’: ‘Dynamic’, ‘primary’: True, ‘load_balancer_backend_address_pools’: None, ‘application_gateway_backend_address_pools’: None, ‘public_ip_address’: ‘/subscriptions/123456/resourceGroups/test-rg/providers/Microsoft.Network/publicIPAddresses/Ubuntu-915-test’, ‘public_ip_allocation_method’: None, ‘application_security_groups’: None}" } Playbook: – name: Get facts …

Total answers: 1

Ansible: The ipaddr filter requires python's netaddr be installed on the ansible controller

Ansible: The ipaddr filter requires python's netaddr be installed on the ansible controller Question: Docker container Alpine.3.13.1 apk add ansible succeeds however, executing playbooks that require ipaddr filter fails with: Ansible: The ipaddr filter requires python’s netaddr be installed on the ansible controller Ansible version: 2.10.5 (can do other versions if needed) ipaddr filter: Ansible …

Total answers: 3

Transforming any YAML file into Ansible inventory

Transforming any YAML file into Ansible inventory Question: I’m trying to create an Ansible Inventory file from an existing YAML file. Here is the yaml file I am talking about: – Fabric: AAA Hauteur: 20 Nom de l’equipement: AAA-BAT1 Role: BGW Salle: ‘1’ Travee: 4 Type de materiel: N9K-C9YTR – Hauteur: 20 Nom de l’equipement: …

Total answers: 1