On a Red Hat 8.3 machine I try to use this ansible code: But I get an error: I think maybe the lookup(‘dig’) doesn’t search in the right place… However I think I do in fact have dnspython installed: More info: Answer Converting comment to answer. When you use the pip3 command it references the Python 3.6 version you have
Tag: ansible
Issue connecting to cisco ios switch with custom menu enabled
I am trying to connect to a Cisco [Cisco IOS Software, C2900 Software (C2900-UNIVERSALK9-M), Version 15.4(3)M3] switch via ansible/python. But I am facing issue because we have enabled a menu when we connect to vty. Is there any working sample someone can point me towards where I could pass thru this menu and run commands as usual? Thanks Answer You
Why it is possible to use a split filter in ansible?
It might look like a weird question by, I really would like to understand this. I am new to Ansible, and I am trying to understand how I could figure out that I can use a filter called split. As I understand, the Ansible filters are builtin inside Jinja2 engine. On the project website there is nothing about split filter.
Ansible seems to be ignoring variable in when conditional when it is overridden with “-e” from the command line
I’m working on an Ansible playbook that uses a when condition, and I was trying to test the scenario where there is a default value specified as a play variable, which can then be selectively overridden from the command line using the -e argument to ansible-playbook. But this is not working as I would expect, and I’m not seeing any
Disable metacharacters in regular expressions
Perl has Q and E operators in its regular expression toolkit: Does such a facility exist in Python? I am aware of the in operator to do literal string comparison, but my usecase is that I’m using the lineinfile Ansible module which relies on Python’s regular expression library. I’d like something like this (if you can see the intent even
Ansible get search domain from DNS in Ansible facts [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 1 year ago. Improve this question How can I use the search domain in a variable? When I use
Encountering ‘dict object’ has no attribute ‘results’ with Ansible despite previous checks indicating it does exist
I am using Ansible and I am encountering an issue that I do not understand or know how to solve. Hopefully someone can help me. The problem occurs with a failed_when conditional: My task is: In attempting to debug, I have written the following: where, I think, the important information here is: I am new to Ansible, perhaps that is
Ansible: Add values in nested dictionary among them selves and insert into another dictionary
I am iterating over the following dictionary of dictionaries and want to add the values of nested dictionary and insert them into another dictionary. master_nodes I am trying something like this and struggling to devise a solution. What I am trying achieve in total_master Answer This could be one option: gives Another flavour, gives
Problems changing Ansible_Python_Interpreter
How can I change my ansible_python_interpreter value on Ubuntu? I downloaded and installed Python 2.7.12 from tar, and now it’s running by default outside of Ansible But when I try to set the variable, Ansible shows that it’s still using that newer version of Python (I need to use this older version to test) Answer It’s not possible to configure
I am having some issue while creating VM from ansible
I am using Ansible version2. 2.9.9 and Python version 3.6.9; and I have installed requests modules too but every time I run my code I ger error of Mo Module name requests, I have changed the ansible_pythin_interpreter to python 3 as well but it didn’t heled me. Please go through my code and help me here. I have uploaded my