Questions tagged [ansible]

Ansible is an open-source software platform for configuring and managing computers. It combines multi-node software deployment, ad-hoc task execution, and configuration management.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

Ansible variable register in two tasks either one or the other

I have an Ansible role that manipulates some Zabbix components. This role has this set of tasks to check the Zabbix Agent type (1 or 2) and version. - name: Check if Zabbix Agent 2 is installed ...
markfree's user avatar
2 votes
1 answer
32 views

How to troubleshoot API requests sent by Ansible module?

Here's the context : The following playbook (simplified to one task for this stackoverflow topic and for ease of use) got different results depends on where I launch it. It uses the nutanix.ncp galaxy ...
motorbass's user avatar
  • 343
1 vote
1 answer
30 views

AWX error X509 using custom EE image with pyopenssl

I'm currently setting up an AWX platform hosted on K8s cluster to get a proper UI + features for multi-user purpose. Context : I created an EE image pushed on a Nexus repository that AWX use in order ...
motorbass's user avatar
  • 343
0 votes
0 answers
17 views

not able to access apache 2 server running in vagrant from the host

I'm running apache2 inside the vagrant guest machine . Below is my vagrant file- # -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "ubuntu/...
Rajkumar Natarajan's user avatar
0 votes
0 answers
17 views

Ansible provider for Terraform roles support

I have an Ansible playbook with roles that I want to execute from Terraform. site.yaml --- - hosts: cluster gather_facts: yes become: yes roles: - role: prereq roles/prereq/tasks/main.yml ...
sctx's user avatar
  • 13
0 votes
0 answers
25 views

Ansible winrm Warning but ssh is used

I tested the last few days OpenSSH as connection method for windows hosts in Ansible, because we are a mixed environment and I want a similar approach for linux and windows. I tested for windows 10 ...
MaKaNu's user avatar
  • 101
1 vote
1 answer
46 views

macOS: Open GUI application over SSH not possible

I'm working on automating the installation of a macOS application using Ansible. I am installing the application by copying its .app folder from a .dmg image to the /Applications/ directory. After ...
letsinvestnow's user avatar
0 votes
2 answers
85 views

How to print a specific line from file based on UUID defined in variable?

I wanted to print the specific line from /etc/fstab based on UUID defined in a variable. But when I'm trying with below code it is not giving proper results. Code: --- - name: check hosts: all ...
Priyanka's user avatar
0 votes
1 answer
64 views

runas become returns Win32ErrorCode 1314: A required privilege is not held by the client

and thanks in advance for reading and support. I keep running into the error mentioned in title when using runas as become method from my Ansible controller towards Win10 Pro 22H2 host. I did my ...
ondrej5834's user avatar
0 votes
1 answer
59 views

ansible pause not working with when conditionals

example play: - name: WTF debug: msg: THIS WORKS "{{ inventory_hostname }} UPGRADE VAR IS "{{ upgrade }}" when: upgrade and inventory_hostname is regex("switch.*a") - ...
Dave0's user avatar
  • 23
0 votes
1 answer
83 views

Ansible playbook with 'async' outputs out of order when executing on multiple servers

I have a playbook that is suppose to run a script on 5-10 servers in parallel - name: Run script & cleanup ansible.builtin.shell: | ... bash {{ SCRIPT }} ... args: executable: /...
Subzero123's user avatar
0 votes
0 answers
24 views

Openstack ansible aio network configuration

I did a fresh install of OpenStack but am unable to connect them to the internet. Some informations around the environment: 1 physical nic, one vlan configured to be used as second nic. Mac-Addresses ...
Timo Scholz's user avatar
1 vote
1 answer
127 views

Write a variable with multiline content into an yml file but keep it as-is

The task: what works/what not Replacing/adding one-liners is working as expected A file sentry/config.yml has the following line(s) # ... # github-app.webhook-secret: 'GITHUB_WEBHOOK_SECRET' # Use ...
Josef Glatz's user avatar
0 votes
1 answer
79 views

How to share ansible variables between loop tasks

I'm trying to create a Fortinet FortiManager automation with their Ansible collection. I've created a dynamic ADOM creation task which runs in a loop and now I'm trying to run another dynamic tasks ...
cr0c's user avatar
  • 968
2 votes
0 answers
31 views

ansible-pull with --tags flag doesn't work

I have a playbook that includes a file containing this: - name: debug tags debug: msg: debug tags tags: - debugtags When I run the following command, I would expect that only this play ...
Ed Greenberg's user avatar
4 votes
1 answer
615 views

Ansible: Convert comma separated string with key:value pairs to dictionary

I'm launching a setup playbook for a docker-compose service (apache solr) via extra vars. Those vars are set while executing since this playbook should be flexible and multiple configurations exists ...
Josef Glatz's user avatar
0 votes
1 answer
113 views

kolla-ansible openstack bootstrap-servers failed on enabling ceph apt repository (ubuntu 22.04)

This is to deploy the recent kolla-ansible openstack. The problem happens since last week. I retested it on a good environment successfully deployed on 7/14/2023 and got bootstrap-servers failed ...
user1039217's user avatar
1 vote
0 answers
46 views

Ansible export to csv

I want to get a csv with a list of new updates in this form: testvm-001.localdomain,ImageMagick-6.9.11.27-4.el7 testvm-001.localdomain,ImageMagick-libs-6.9.11.27-4.el7 I have a code that will display ...
rk3dnp's user avatar
  • 21
1 vote
1 answer
89 views

Ansible update list

The task is to get a list of the latest updates. Approximately as the command issues dnf check-update Ansible code: tasks: - name: List Available Patches (Non-Kernel) dnf: list: updates ...
rk3dnp's user avatar
  • 21
0 votes
0 answers
48 views

Not able to execute shell commands in ansible control node

Need your suggestion pls. The below one is ansible file which calls an python file in the control node(localhost) and process an excel file which is also present in control node based on hostnames. ...
user984993's user avatar
0 votes
0 answers
32 views

Trigger a Ansible-Playbook when i create a VM in Netbox

Is it possible when i create a Virtual Machine in Netbox that can trigger an Ansible-Playbok what add stuff? for example Create the VM in CheckMK with the details whats written in Netbox. Thanks ...
Marvin Fratzke's user avatar
0 votes
1 answer
50 views

Want to Use Ansible Lineinfile Module to Insert Private IP Addresses from Hosts in the zookeeperservers Inventory Group

I need to modify a line in a configuration file with the private IP addresses of the hosts in the zookeeperservers inventory group. The config file is an .xml file. The key word in the config file is &...
David S's user avatar
0 votes
1 answer
61 views

How to specify an exclusion pattern in an inventory file

Is it possible to define a group with an exclusion pattern, when defining this group in an inventory file? group1: hosts: xxx-[1:100]: group2: hosts: xxx-2: xxx-37: # This should ...
jeb's user avatar
  • 355
2 votes
1 answer
97 views

Ansible-pull does not find vars in group_vars directory

I have an ansible structure that contains some roles. /usr/local/ansible playbooks roles role1 role2 tasks handlers ...
Ed Greenberg's user avatar
0 votes
0 answers
92 views

Passing variable to next playbook in awx workflow

I'm having difficulties with the following setup: AWX deployed in a self hosted k8s cluster Playbooks are using the AWX-EE Playbooks are executed in a workflow template as follows: START -> 1. ...
Marc's user avatar
  • 26
0 votes
1 answer
841 views

Ansible: ERROR! 'shell' is not a valid attribute for a Play

--- - name: Extract PS output. shell: "ps -ef | grep pmon" register: pmon - name: Display PS output. debug: msg: - "{{ pmon.stdout_lines }}" Error: ERROR! '...
Learner's user avatar
-1 votes
1 answer
126 views

"[Errno 2] No such file or directory: b'net'" when trying to use Ansible localhost to connect to a Windows Shared Folder

I am unable to use Ansible localhost (Linux) to connect to a shared folder on a Windows Server. I am getting [Errno 2] No such file or directory: b'net'. However, I have checked that my file path to ...
865296's user avatar
  • 3
0 votes
2 answers
223 views

Ansible error: The offending line appears to be:

I am getting code error in Ansible as below. please advise on this. ERROR! We were unable to read either as JSON nor YAML, these are the errors we got from each: JSON: Expecting value: line 1 column ...
Learner's user avatar
1 vote
1 answer
172 views

How to pass Variable from previous host to next target host play in ansible playbook

I want to pass variable called ssh_user from the first play on ansible playbook to next different host play. I have tried to use "set_fact" but seems like it's still can't retrieve variable ...
Mhd Ridho Swasta's user avatar
2 votes
1 answer
283 views

ERROR! unexpected parameter type in action Ansible Playbook

I have my playbook yml script below: --- - name: Download files from FTP hosts: localhost gather_facts: false vars_prompt: - name: target_host prompt: "Target Host IP: " ...
Mhd Ridho Swasta's user avatar
1 vote
1 answer
155 views

Practice of high frequency scheduled Ansible playbook runs

I'm fairly new to administrating servers with configuration managers such as Ansible. I plan on running playbooks automatically on a schedule (via something like Ansible Semaphore, or even just Cron) ...
corvus-migratorius's user avatar
0 votes
1 answer
407 views

Ansible: [WARNING]: The input password appears not to have been hashed

I'm facing an issue while using Ansible 2.9.27 on RHEL 7 to automate my infrastructure, specifically when working with encrypted passwords in my tasks. When utilizing the password option of the ...
sebelk's user avatar
  • 682
2 votes
2 answers
155 views

Convert lscpu output to row based format in excel/csv table format

I have the below data (lscpu output) for 1000 servers and I want the same in excel but in row format and not as in command output in columns 1.2.3.4 CHANGED Architecture: ...
Loki's user avatar
  • 21
0 votes
0 answers
22 views

How to import all projects defined in a metadata.yml file?

This is my first foray into anything AWX/Ansible, so please be gentle :) I've set up a new AWX instance in Kubernetes (using the AWX Operator), and am trying to import our existing job-templates from ...
Sagar's user avatar
  • 534
1 vote
1 answer
59 views

Ansible send hostnames in a list to python script

I wanted to send the hostnames from ansible role to python script. In my host file there are 2 hosts 1ld900 and 1ld901. my role as below --- - name:execute python script: writetoexcel.py {{ ...
user984993's user avatar
0 votes
0 answers
115 views

k8s cron job using helm chart and docker

Two Helm chart for managing db cron jobs and monitoring cron jobs separately . Which k8s components can i use ? as k8s deprecated CronJob kind from v1.25, https://kubernetes.io/docs/reference/using-...
Sakshi Jain's user avatar
0 votes
1 answer
600 views

How to force Ansible 'shell' task to change state with 'changed_when' condition?

I am running script with Ansible task which installs some repositories and my goal is to show changed state when running change mode to notify, that script will run if check mode will not be activated....
dorinand's user avatar
  • 319
1 vote
1 answer
263 views

Ansible: How to log performed changes on the Remote Server?

Ansible: How to log performed changes on the Remote Server? Ansible can show and log the performed changes (including file diffs) locally on the Control Node, e.g. TASK [example_task : file mode] *****...
sebix's user avatar
  • 4,323
0 votes
1 answer
210 views

Ansible: escaping special characters in a regexp loop

I been having problems getting this to work, can anyone provide any insights? - name Configuring rsyslog.conf playbook hosts: "{{host}}" tasks: - name: Configuring ...
Gene's user avatar
  • 15
0 votes
1 answer
43 views

Monit with Ansible - invalid mail format '#015'

I've been trying to install monit with an ansible playbook. I'm changing the monitrc file and when the playbook restarts monit, I get : Jun 8 08:00:30 myserver monit[1857462]: Starting daemon monitor:...
Ror's user avatar
  • 323
0 votes
1 answer
102 views

UNREACHABLE! => {"changed": false, "msg": "Data could not be sent to remote host

I have SSH access for a particular server, but when I am trying to run the playbook for that server. I am trying to do the deployment for that server but I'm facing an issue. fatal: [lapp999.corp.com]]...
Varun K M's user avatar
1 vote
1 answer
145 views

How can I shorten 'item' value in Ansible console output?

I'm struggling with the title for this question, so feel free to edit it to make it more meaningful. Let's say you have a task in Ansible and you register the output. For example: - name: Set up ...
user3629081's user avatar
1 vote
2 answers
292 views

Should I use my personal admin user or create a dedicated 'ansible' user for SSH in Ansible?

I'm starting learining and using ansible and struggling a bit with the user ansible uses for ssh. Is ansible supposed to use my personal admin user to ssh onto the invetory hosts and escalate ...
Alphabit's user avatar
-1 votes
2 answers
553 views

Override hosts variable of Ansible playbook without command line

Have 2 hosts my_host1, my_host2 This code work for my_host1, I also need run it for my_host2 Can be overridden hosts value on ansible main.yml task without changing string "hosts: my_host1" ...
tuytuy20's user avatar
1 vote
2 answers
647 views

ansible - couldn't resolve module/action 'amazon.aws.s3_object' / The module amazon.aws.s3_object was not found in configured module paths

Per requirements, I did installed all the required packages, however amazon.aws.s3_object is one of those things: couldn't be resolved/found was not found in configured module paths step(s), I used ...
alexus's user avatar
  • 13.1k
0 votes
1 answer
361 views

Permission denied (publickey) error when managing GCP machine via Ansible (running on GCP VM) despite successful SSH connection

I deployed two machines to GCP via Terraform. Let's call them control-host and target-host. I want to manage the target-host via Ansible installed on the control-host. Unfortunately, I keep getting ...
mångata's user avatar
  • 109
0 votes
1 answer
200 views

how to give permissions to postgres_exporter user with ansible?

I need to give some rights to my user postgres_exporter to scrape metrics from postgres to grafana I can do that on each server by sudo -iu postgres psql -c 'GRANT pg_read_all_settings TO ...
a1dude's user avatar
  • 11
0 votes
1 answer
379 views

Setting mysql using ansible in ubuntu remote machine

I have written one ansible playbook for installing MySQL server in ubuntu remote machine but is not working here is the yaml code --- - name: setting mysql in ubuntu hosts: web01 become: yes ...
Nikhil Chopra's user avatar
0 votes
1 answer
1k views

You should set the `loop_var` value in the `loop_control` option for the task to something else to avoid variable

My environment: # cat /etc/debian_version 11.7 # ansible-playbook --version ansible-playbook [core 2.13.1] config file = None configured module search path = ['/root/.ansible/plugins/modules', '/...
alexus's user avatar
  • 13.1k
0 votes
1 answer
70 views

Error tryng to retreive mount points and device of an host with ansible

Hi i'm trying to retreive some infos about hosts with ansible about mount points and device attached and a got an error . about the list object.. - name : Inventory hosts: localhost tasks: ...
Fluki's user avatar
  • 3

1
2 3 4 5
36