Questions tagged [ansible-module]

75 questions
0
votes
0 answers

Issue with podman module

I'm trying to use podman containers modules on my ansible 2.9.18 version but got an error. Command to install: ansible-galaxy collection install containers.podman Error message: "msg": "Could not find imported module support code for common. Looked…
0
votes
0 answers

Ansible fails to find imported module support code for pm2

I'm trying a to test if ansible is able to run the pm2 module on my local machine. I installed pm2 for ansible by using: sudo -H pip install ansible-modules-pm2 And this what my playbook looks like: --- - hosts: localhost connection: local …
0
votes
1 answer

for what reason is the string constantly inserted at the end of the file?

I want to insert a line with a user test999 before a construction site with a user test3 .I can't insert a line before another one, it is constantly inserted into the last one, for what reason can this happen? --- - hosts: app_stage become: yes …
Iceforest
  • 309
  • 1
  • 11
0
votes
0 answers

Ansible - recursive argument_spec

I'm trying to create a role with argument validation via the meta/arguments_spec.yml file, and I'd like a user to be able to pass in a tree of arbitrary depth as one of the arguments. In other words, a valid family_tree argument might look…
user3781737
  • 932
  • 7
  • 17
0
votes
0 answers

What is the parameter 'fragment' on win_xml module?

I have very limited knowledge on XML and not sure what does fragment parameter is used for. - name: Apply sslEnabledProtocols to Tomcat's server.xml community.windows.win_xml: path: C:\Tomcat\conf\server.xml xpath:…
Jess
  • 29
  • 7
0
votes
1 answer

How to get args for an ansible module written in bash?

I wrote an ansible module is bash. It is working fine, but if want to pass arguments to that module and read them in the bash module how can I do that .. please help - name: get top processes consuming high cpu gettopprocesses: …
user18791385
0
votes
1 answer

Ansible modules parameter syntax

Why is it that on the playbook.yml under the command task to be executed, some modules have a quotation mark while some does not? For example, if you check the syntax below, the module line is with embedded in a quotation mark but script is not. -…
blast
  • 49
  • 1
  • 1
  • 5
0
votes
0 answers

Custom Ansible Module - Info or Facts?

I have a VMware vCenter with several VMs. I want to use ansible to configure the network interfaces of the guest based on the network to which the VMware network interface is connected. Since the network interface names in the guest may not be named…
jay
  • 51
  • 7
0
votes
1 answer

How to pass multiple values to "with_items" through ad-hoc command?

Here is the example ansible-playbook, if I want to pass the values of {{ item.first }} and {{ item.second }} through ad-hoc command from the terminal. How can we do it ? Thanks in advance.. --- - hosts: localhost tasks: - name: Here we are…
Sashi K
  • 43
  • 5
0
votes
1 answer

Python PUT request always returning 401 Error despite working in Postman

So I'm trying to call a PUT request to create an inventory policy: https://learn.microsoft.com/en-us/rest/api/storagerp/blob-inventory-policies/create-or-update I'm using Ansible custom modules and Python to create it. Python def…
0
votes
1 answer

Lineinfile skip strings that already exists in the file

I am using lineinfile to add multiple host details in a file but some details were the same only different in hosts. I am looking for a way to prevent lineinfile to skip same line. Is that possible ?
grace
  • 1
  • 1
0
votes
0 answers

Playbook doesnt return any value

I am new to ansible and trying to write a new playbook which goes to a) A certain folder b) clean the env c)pulls the code d) and builds it Here is my playbook, help is deeply appreciated. :) - name: Shell examples hosts: all tasks: …
Jarvis
  • 41
  • 3
0
votes
0 answers

ansible: how to execute a custom module that is only installed on the delegate_to and not on the controller?

I ran into a (for me) unexpected issue with ansible when trying to execute the following: # myplaybook.ansible.yml - hosts: myhost2 tasks: - name: Execute pgsql query community.postgresql.postgresql_query: ... where myhost1 is the…
ppenguin
  • 155
  • 1
  • 11
0
votes
0 answers

Ansible ImportError: cannot import name 'prepare_multipart' Issue

I'm running the below uri module to find the status of jenkins page after a restart.But unfortunately i'n getting an error as Ansible ImportError: cannot import name 'prepare_multipart' Issue module: - name: result-test uri: url: "http://{{…
JPNagarajan
  • 802
  • 1
  • 12
  • 32
0
votes
1 answer

Problem while comparing two arrays due to unecessary chars

I have to two array from mysql query and I want to make a host comparison. For example, the result of mysql result is like list1 & list2. - name: set_fact: list1: - host: '[\"X.XXX.XX.XXX\"]' username: username1 - host:…