Skip to main content

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
4 votes
1 answer
241 views

Why does ansible reevaluate a variable on each access

I need to generate some unique id in ansible. The generation works but accessing the variable results in some "not expected" behaviour. The playbook is very simple: --- - hosts: localhost ...
Martin Garbe's user avatar
0 votes
0 answers
9 views

Xenserver Template Storage Dependency - VM Creation Issues on Different Hosts

I'm working with XenServer (XCP-ng) and have encountered an issue with VM creation from templates. Here's the scenario: Three storage repositories (SRs) on separate hosts (host1, host2, host3). A ...
Nitesh Dudhe's user avatar
-2 votes
0 answers
16 views

controller node openstack can't ping to instance

I have openstack infrastructure with manual instalation, My problem I can't ping internal ip of openstack instance. sudo ip netns exec qrouter-id ping internal ip instance ==> work for me but ...
ikbel kh's user avatar
2 votes
2 answers
78 views

Ansible: How to merge a list and dict into new nested dict

I'm trying to build reverse look-up (PTR) records for bind. I have a CSV file with IP and Hostname fields loaded into a dict (from read_csv), so I guess it's a list of dicts actually: ok: [localhost] =...
Matt Wagner's user avatar
1 vote
1 answer
71 views

I am getting an error in the ansible playbook file

I am trying to learn ansible and I have coded my first playbook but it gives me the error saying ERROR! We were unable to read either as JSON nor YAML, these are the errors we got from each: JSON: ...
nagesh naga's user avatar
-2 votes
0 answers
33 views

Good practice for storing AD users/groups in Ansible

I am trying to conver as much configuration as we have in our project into a code which we maintain in Ansible and I'd like to do it with Active Directory users. An easy approach in this case would be ...
Radosław Serba's user avatar
0 votes
1 answer
170 views

Building SAMBA AD DC container with Docker and Kubernetes gives wrong content to volumes

I am building a container for Kubernetes that runs a SAMBA Active Directory Domain Controller. I am doing the job through Ansible and the container is being deployed in a Kubernetes cluster (K3S). ...
Lasse Michael Mølgaard's user avatar
0 votes
0 answers
97 views

How to use regex_replace for backslash and double quotes in ansible playbook

In my ansible (2.15.x) project there is a customer parsed string (as extra-vars). This string is later passed to a python script in a win_shell command (The ansible host is a windows machine). So ...
Praveen Dinelka's user avatar
3 votes
2 answers
67 views

How can management efficiently handle 10 servers with the same stack?

I have a problem with my server structure. I have a scraper script on more than 10 servers. btw. This server is on a different provider, etc. Currently, I am installing the same library on each server,...
robokonk's user avatar
0 votes
1 answer
75 views

Why does this code generate an Ansible deprecation warning?

# Build a list of Adtran AP mac addresses found on directly connected switch ports - name: PARSE AND FILTER MAC ADDRESS-TABLE ansible.builtin.set_fact: macs: "{{ macs + [item] }}" ...
Appleoddity's user avatar
  • 3,872
0 votes
0 answers
138 views

Use yum or versionlock to ignore packages associated with a repository

I have a RHEL-8 bash script that installs several packages including ansible. Some of the packages come from epel while others come from the default rhel-8-baseos-rhui-rpms. dnf-automatic has exposed ...
John R's user avatar
  • 393
0 votes
2 answers
76 views

How to make ingress-nginx use provided certificate to user?

I am installing Home Assistant in my K3S Kubernetes cluster through Ansible and I want to use a Let's Encrypt certificate for my ingress that has been generated by Cert-Manager running on my cluster. ...
Lasse Michael Mølgaard's user avatar
0 votes
1 answer
48 views

Getting permission error from Unifi Network Application when connecting to MongoDB in Kubernetes

I running K3S Kubernetes on a cluster server consisting of a mixture of Raspberry 4 and Raspberry 5 nodes. I want to install Unifi Network Application on the cluster server and have come pretty far in ...
Lasse Michael Mølgaard's user avatar
0 votes
1 answer
108 views

How can I hide a file or folder using Ansible on Windows?

Is there a way to mark a file or folder as hidden using Ansible on Windows? I've checked the win_file module, https://docs.ansible.com/ansible/latest/collections/ansible/windows/win_file_module.html ...
Saaru Lindestøkke's user avatar
0 votes
0 answers
39 views

oVirt ansible create VM doesn't get a IPv4

Trying to create a new VM in OLVM / oVirt 4.4 using the ansible collection using the vm_infra role. All runs with no errors but the VM never gets an IPV4 address. yml config looks like this, --- ####...
cjt's user avatar
  • 101
1 vote
0 answers
36 views

[ANSIBLE][FORTIGATE] Error in repo for the module fortios_log_webtrends_filter

I am having trouble using ansible to push playbook on fortigate. In fact, I am writing a playbook to filter urls through categories. To do that i use the module fortinet.fortios....
Pierre C's user avatar
0 votes
1 answer
80 views

Unset SDKROOT in Ansible

I'm running an Ansible play that is cross-compiling with Xcode on MacOS. When I run printev in my playbook, I see this value: SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX....
jackwise's user avatar
  • 259
0 votes
1 answer
332 views

Ansible Lint not finding community.general included with Homebrew-installed Ansible

I am having an issue with Ansible Lint not finding community.general modules: > ansible-lint <redacted>.yml WARNING Listing 1 violation(s) that are fatal syntax-check[unknown-module]: couldn'...
Dave Dribin's user avatar
2 votes
2 answers
86 views

How can I set Ansible command arguments based on what keys a loop item has?

Context I'm using Ansible to setup Windows servers using the win_chocolatey module. In my group_vars/windows_servers.yml file I have: choco_packages: - 7zip - git - vscode And in my playbook ...
Saaru Lindestøkke's user avatar
0 votes
1 answer
121 views

How to create Persistent Volume Claim in Kubernetes with Ansible?

I am trying to install Unifi on a Kubernetes cluster server (K3S) using Ansible and ran into troubles when trying to define a persistent volume claim. I am using Kubernetes.Core module and I have ...
Lasse Michael Mølgaard's user avatar
0 votes
1 answer
327 views

Multi master HA Kubernetes kubespray installation using kubevip fails

I'm trying to install a HA Kubernetes using Kubespray with Kube VIP. I followed the instruction of Kubespray for Kube VIP but it gets stuck on "TASK [kubernetes/control-plane : Kubeadm | Create ...
Mohammad Reza Ghahremani's user avatar
0 votes
0 answers
78 views

Redhat RHE9 ansible raising Invalid repo ID while the repo is listed on the system

I'm running Linux Redhat 9 on one of my AWS EC2 and I'm trying to install OpenVPN server. For that I want to enable codeready-builder repository. Here is the ansible task that enable the repo : 15 - ...
nixmind's user avatar
  • 111
0 votes
2 answers
812 views

Ansible - Getting a key value from every dict in a list of dicts

I have a list of dicts where each dictionary has the same keys, just different values. I can loop through the list and get the "ip" attribute I want but its a large list and wanted to know ...
Jolan's user avatar
  • 3
0 votes
0 answers
132 views

What is the best way to partition Ubuntu22 with Packer (and ansible?)

I have this all working, but I am wondering if there is a better way to do this? It seems very difficult to make small changes this way. I'm using the vsphere-iso provisioner here, but I can also work ...
Jlom84's user avatar
  • 1
0 votes
0 answers
85 views

Ansible to change Cisco IOS enable password on multiple devices

Does anynoe know if there is a ansible module for changing the Cisco IOS enable password on devices? There appears to be a user module but that is for usernames only in IOS. Should I use the ...
Jim's user avatar
  • 1
0 votes
0 answers
96 views

Unable to change awx custom volumeMount permissions in k3s init container

I am currently trying to edit my AWX deployment on k3s. The goal is to add a PVC as a volume mount so that I have persistent storage to write files to from my Ansible tasks. The PVC mounts to the Task ...
Pancakery's user avatar
0 votes
1 answer
424 views

Ansible "Failed to create temporary directory" (GCP)

I've encountered an issue with my Ansible playbook that provisions both a Kubernetes cluster and other servers within our cloud infrastructure. Specifically, the problem arises when I configure the &...
1wonder's user avatar
0 votes
0 answers
354 views

Ansible: become from a passwordless user

I have a user with no password, and want Ansible to use sudo from that user, without adding NOPASSWD to the sudoers file. Ansible complains with: FAILED! => {"msg": "Missing sudo ...
Fadeway's user avatar
  • 123
2 votes
1 answer
431 views

Ansible compare two value from two dictionnaries

I have a simple problem, i have two dictionaries, one being static with some data, and an other being the result of the stat command stored in a variable (with register). The goal is simply to compare ...
math's user avatar
  • 121
1 vote
0 answers
490 views

Ansible playbook to format and mount unused disks

I am trying to setup a disk on Linux with Ansible. I am fairly new to ansible. I have managed to get a list of all unused disks (though it will probably consist of just one) but I am having issues to ...
javiers's user avatar
  • 31
0 votes
1 answer
353 views

Jenkins Multiple Agent and Git

I have been using Jenkins for many years, but I have never needed more than one agent for my tasks. Just recently, I found the need to add another agent, which is not Linux but Windows. Now, this node ...
Yousuf's user avatar
  • 45
0 votes
0 answers
127 views

Ansible: Failed to connect to the host via ssh; unknown key

I encountered an issue while connecting SSH host on Ansible. The error message is: UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: ...
陈青海's user avatar
0 votes
1 answer
163 views

Create file with double quotes in values

I need to create a file with double quotes in the values. Playbook: - hosts: all vars: test_var: - hostname: "hostname" hardware: - disk: "HDD 50G" ...
Konstantin's user avatar
0 votes
1 answer
127 views

How do I add 2nd IP to /etc/hosts file using Ansible?

I have a Vm with 2 network interfaces, eth0 and ens10. So currently I use this: - name: Add IP address of all hosts to all hosts lineinfile: dest: /etc/hosts regexp: '.*{{ item }}$' line:...
GodAtum's user avatar
  • 309
0 votes
0 answers
152 views

Ansible playbook to create a new storage

I'm trying to create a new storage in my proxmox node with an Ansible playbook, but this ends up having no free space, all the space is used. I want to do this from the playbook and not from the ...
Ionut's user avatar
  • 101
1 vote
1 answer
478 views

Creating a podman container as a non-root user in an Ansible playbook running as root

Is it possible to create a Podman container under a different user than the one running the Ansible playbook using namespaces? I am writing an Ansible playbook for my virtual private server. The ...
mcy's user avatar
  • 111
0 votes
2 answers
204 views

Creating a configuration file for Prometheus

Inventory file (inventories/test/environments/tmp6.yml): test: children: environments: children: tmp6: tmp6: vars: ansible_user: superuser ansible_password: superuser ...
Konstantin's user avatar
1 vote
1 answer
47 views

Сreating a dictionary of several pairs of elements

There are files in the directory: environment1_--_192.168.12.239 environment1_--_192.168.12.46 environment1_--_192.168.12.72 environment1_--_192.168.12.83 environment2_--_192.168.12.150 environment2_--...
Konstantin's user avatar
1 vote
2 answers
137 views

Device the file or directory resides on

How to identify the device on which the file or directory resides? There is a stat module. Among the results there is a "Device the inode resides on". How can you map the "Device the ...
Konstantin's user avatar
1 vote
2 answers
262 views

How to fail an Ansible task if executable not exists?

Part of my Ansible playbook is K3S cluster creation. For a server node I have these tasks: <...> - name: Retrieve K3S installation status command: which k3s changed_when: false ...
Dmitry Papka's user avatar
7 votes
2 answers
647 views

Ansible performance issues on a huge group

So, I have this host group, which consist of 35k VMs. Aaaand I need to run a playbook over it. If it does matter - playbook is just a call for community role for installing node_exporter. But I'm ...
Anatolii Tk's user avatar
3 votes
2 answers
261 views

Ansible. Duplication of task execution

Simple playbook: - hosts: all vars: ulogin: login upasswd: passwd user_login_with_password: - user_login: "{{ ulogin }}" user_passwd: "{{ upasswd }}" ...
Konstantin's user avatar
0 votes
1 answer
155 views

Failing to authenticate with GHCR after kubernetes upgrade to 1.24

I’ve upgraded my AWS EKS to 1.24, and since then authentication with github docker registry fails. I’m running the following Ansible task in Jenkins: - name: Login to github docker registry ...
Supertwister's user avatar
3 votes
2 answers
606 views

Use ansible.builtin.version outside of assert

I have following working tasks: - name: Get Package infos ansible.builtin.package_facts: manager: auto - name: Test redis-server version ansible.builtin.assert: that: - ...
MaKaNu's user avatar
  • 133
0 votes
1 answer
126 views

How to store the value of a variable Ansible in a loop?

I want to store the value of {{ item }} of the loop in a variable. This is my task : include_role: name: role1 vars: template_path: "inventories/{{ ENV }}/group_vars/all" ...
tima's user avatar
  • 1
0 votes
2 answers
448 views

sudo: /etc/sudo.conf is owned by uid 65534, should be 0\nsudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

I have the latest Ansible Tower configured on a RHEL 8.9 When I run specific ansible tasks, I always get this error message: { "module_stdout": "", "module_stderr"...
Budianto IP's user avatar
0 votes
1 answer
548 views

Rhel 7–> 8 upgrade default Python version is changing automatically

I am trying to upgrade rhel7 to Rhel8 using leap upgrade tool using ansible. But my rhel7 server is treating me wired. Currently RHEL7.9 machine is pointing to python2 but when I reboot the machine ...
Prade's user avatar
  • 31
0 votes
0 answers
90 views

Ansible / VMWARE - Retrieve network interface labels and start them according to the information for each VM

Context I'd like to retrieve the network interface labels for each VM, which I define directly in a variable array, and connect them. Knowing that the network interfaces already exist on each VMs. I ...
user20893268's user avatar
0 votes
0 answers
139 views

error trying to ansible with become machinectl

I've tried to make work some automation with ansible inside a systemd-nspawn container with machinectl commands. I've found a become machinectl ansible plugin that seems to fit, but there's something ...
namregzepol's user avatar
0 votes
1 answer
78 views

Ansible.builtin.wait_for issue weird behaviour with kerberos

I'm used to have many working projects to deal with Windows environment using Active Directory service account, ciffered using Hashicorp Vault. Projects are launched from a Debian 11 server to many ...
motorbass's user avatar
  • 373

1
2 3 4 5
36