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
0answers
16 views

is there any deployment automation software that can create an encrypted vm in esxi?

I recently felt the need to encrypt my esxi vms and tried to find some way to do it with terraform but couldn't find an option for that in the documentation so I looked into ansible , chef with no ...
1
vote
1answer
21 views

Ansible print debug message result variable

I have a simple task that I cannot overcome. I have a playbook that returns AWS EC2 instance configuration. I need to only print (display) private_ip_address. Here my playbook --- - hosts: local ...
0
votes
0answers
21 views

Ansible playbook not running : Import error

enter image description here ansible-playbook -v -i Monitoring/hosts Monitoring/main.yml [WARNING]: log file at /var/log/ansible.log is not writeable and we cannot create it, aborting Using /etc/...
0
votes
1answer
32 views

Using ansible loop until with stdout_lines

I am trying to use ansible loop until the condition is met. I can use until if the output is only single line, however if the output is multiple lines, I will need to use stdout_lines but fail to do ...
1
vote
2answers
28 views

Ansible run a task on a different host than local

I have an ansible playbook which runs on localhost. I need to run a particular task which is invoked inside my playbook on a different host (different group). Is this possible to speicify within the ...
0
votes
1answer
45 views

Loop through var_files variables in ansible

I have a playbook that calls a role and is supposed to import apache vars for websites. The issue is that when I look into ports.conf I only see the line for website1. Website2 is never called. Any ...
0
votes
0answers
26 views

Can anyone help me with how to install OpenStack wallaby with Kolla ansible?

Is there any way to install openstack wallaby with kolla ansible on ubuntu?
-8
votes
1answer
73 views

I have 50 servers. Want to update /etc/hosts file using ansible [closed]

I would like to update /etc/hosts file using ansible playbook to all my 50 servers. <ipaddress> <fqdn> <hostname>
0
votes
1answer
33 views

Ubuntu Key Exchange Algo

I am trying to test the connectivity to several network devices, with Ansible installed on Ubuntu 20.04.2 LTS, using ansible ad-hoc. The problem: SSH is not working as the device's key exchange method ...
0
votes
1answer
85 views

In ansible playbook, how skip task if file already exist in block task?

I have a task like this : - name: install jetbrains toolbox changed_when: block: - name: download toolbox get_url: url: 'https://download.jetbrains.com/toolbox/jetbrains-toolbox-{{ ...
0
votes
0answers
19 views

Scripting Workflows - Organisation admin

Within our organization, we already have great success using Ansible workbooks to bootstrap our servers. My question, is it best to use ansible workbooks to bootstrap organization tasks or is there an ...
0
votes
1answer
52 views

Ansible regex didn't match command output - Empty list -

I'am trying to get the list of the device ID and the list of the port Id with ansible with regex but i get an empty list, below the output that i'am trying to parse it : Device ID Local Intrfce ...
-1
votes
0answers
41 views

ansible host unreachable error when applying a playbook?

I am new to ansible and having trouble applying a playbook I searched online the error so I gathered it must be something to do with the public key of my vm's. The error is as follows: fatal: [...
0
votes
1answer
31 views

Can Ansible git-module install the latest tag from a repo?

I want to install recent, but not the HEAD. Instead, I'd like to install the most-recent tag of a remote repository -- on the assumption, that this is, what the maintainers consider a "release&...
0
votes
1answer
47 views

Why can't my Ansible server not communicate with my Windows XP machine? [closed]

Ansible's official documentation says Windows XP is not a supported os, however, for every day that goes by I'm even more certain you could make it work. The server is a CentOS 7 machine. I can ...
0
votes
1answer
21 views

`mv` command did not rename, but move into existing directory, from ansible

I am running an ansible task (inside a role): - name: Rename dir become: yes shell: mv /data/files/1.6.5 /data/files/1.7.0 The intended effect is that 1.6.5 is renamed to 1.7.0 Now, on the target ...
0
votes
1answer
36 views

deploying on hosts with ansible based on yaml file

Developers are going to provide a yaml file with hosts in particular order (every deployment can differ, depend on needs) and each field in yaml file will have instructions for example install yum ...
1
vote
0answers
46 views

Nftables systemd ExecStart and ExecReload

I have an ansible role (historically inherited) to configure nftables for RHEL8, which I have been trying to make sense of. It is copying a systemd file for nftables.service that has a following ...
0
votes
0answers
14 views

Ansible: win_partition module to delete spanned disk

I am using Ansible with the win_parition module to delete volumes on my Windows Server, and it works fine on Simple Volumes. My issue is with Spanned Disks (For those who don't know, a spanned volume ...
0
votes
1answer
16 views

run a task using playbook on successful output of before task in windows

I'm executing the below YAML(ansible) file using Jenkins. I want to execute task3 only after the successful execution/output of task2 and task2 only after task1 , My YAML file is as below. How do I ...
0
votes
0answers
20 views

Convert host_vars YAML to my.cnf config file via jinja2

please advice on how to create jinja template from mariadb settings. I have /path/to/ansible/host_vars/server.com/: myvar_mariadb_services: max_allowed_packet: 1024 key_buffer: 512M I ...
0
votes
1answer
36 views

How to increase the awx cli result limit of 25

I'm working with the awx cli (19.1.0) and awx (13.0.0) in an environment with over 100 servers When (e.g.) querying failed or changed results with: awx --conf.host https://my.awx --conf.username ...
0
votes
0answers
25 views

Failed to satisfy all dependencies (broken cache)

fatal: [ip]: FAILED! => {"changed": false, "msg": "Failed to satisfy all dependencies (broken cache)"} I am trying enter image description hereto run ansible script ...
0
votes
1answer
37 views

Automatically kept-back APT packages not showing up

I can't list apt packages kept back by the system itself. A have a few systems where I know there are kept-back packages. apt-get upgrade -s shows: Reading package lists... Done Building dependency ...
-1
votes
0answers
18 views

How do I easily and quickly deploy Ubuntu Focal (20.04) on a bare metal at InMotion hosting using Ansible?

So I thought I had bought a pre-provisioned G3 Ultra dedicated server at IMH, but, it seems not and it turns out it is a bare metal. I have no previous Ansible experience and I have been googling ...
0
votes
0answers
12 views

Sync folder to remote host ansible

i'm searching to sync a folder from server_a (122.16.5.21) to server_b (122.16.5.22) using synchronize module so i wrote this playbook - name: DEB to repo hosts: 122.16.5.21 gather_facts: false ...
0
votes
1answer
53 views

Ansible error when trying to ping Windows 10 host. No winrm module

I'm using this command to ping a Windows host from my CentOS 8 Ansible server ansible windows -m win_ping But I get this output when executing it windows | FAILED! => {       "msg": &...
0
votes
0answers
41 views

How to pass multiple commands with Ansible docker_container

We have a Django container in which, at start, we need to run two different commands: python manage.py collectstatic --noinput and gunicorn myproj.wsgi We've tried all sorts of methods, but the result ...
0
votes
1answer
30 views

What exactly happens in the “graphic setup” of postfix?

I'm following this tutorial on how to install and configure postfix, but using Ansible instead of a plain installation. Because of using Ansible, I do not get the following steps of the "...
0
votes
1answer
29 views

How can I use ansible to synchronize directories between groups of servers?

I am currently migrating some data between servers and need to make sure I'm copying some data directories while still preserving mappings between old hosts and new hosts. I'm looking at using ansible ...
1
vote
1answer
36 views

Ansible is unable to connect to a MySLQ database from last week

I have a docker container with jenkins, that uses ansible for some automated commands. One specific commands connects to a database on a different docker container and perform some checks (as cleaning ...
0
votes
0answers
26 views

Ansible exclude semicolon

I'm new to ansible and right now I'm trying to search a specific word from my output: vars: vlans: - vlan 999 tasks: - name: Check Vlans ios_facts: gather_subset: - '!...
0
votes
1answer
25 views

Ansible: Iteration fails while looping over output variable

Here is my debug output from an ansible playbook: "msg": { "changed": false, "failed": false, "instances": [ { ...
1
vote
1answer
39 views

How to pass a different sets of variables for each iteration of loop in an Ansible task

I have an Ansible task which loops through a list and for each item in the list runs a role, using include_role. For each iteration of loop I want to pass a different set of variables. Currently, I am ...
1
vote
1answer
35 views

Ansible loops and template… again

I am trying setup a playbook to generalise the setup of logfile centralisation and templates. I want to write rsyslog.d/ config files using ansible vars through a generic template. The vars : vars: ...
1
vote
1answer
45 views

Looping over ansible fact

Hope you are fine. I am still in trouble with looping over ansible 2.9 facts despites my search on web and documentation. I woul like to retrieve ip address from custom interfaces on all hosts and put ...
0
votes
2answers
44 views

ad-hoc $ ansible -u root Permission denied

Default ansible 2.9 configuration. User user exists both on the control and the hosts. Control and hosts have each other's ssh public keys for both users. From the control host: root$ ansible all -...
0
votes
0answers
27 views

LineinFile, and ansible.builtin.replace do not insert a repeated line

I´m trying to create a task in ansible that copies a variable and a string to my group_var file : - name: set group_vars playbook_dir set_fact: my_groupvar_file: "{{ playbook_dir }}/group_vars/...
0
votes
0answers
20 views

Find VFAT Partition on USB bus

I have to find a way to mount the first "external" vfat partition on 250 different headless hosts via shell. It could be sdb sdb1 sdc sdc1 etc. I need the device name to mount it with ...
-1
votes
1answer
26 views

vmware_guest vs community.vmware.vmware_guest

Anyone knows the diff between vmware_guest vs community.vmware.vmware_guest Here are the urls https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_guest_module.html https://...
-1
votes
2answers
38 views

Ansible yum_repository modules without python3

On the target machine I removed python3 and python and there is no python installed on my target box and the ansible yum_repository module still worked ! I thought modules require python3 ?
-1
votes
1answer
79 views

using ansible --ask-become-pass in a variable

I would need to use my --ask-become-pass password in an expect script. Is there any way to use the password entered when starting ansible_playbook in a variable? Pseudo-code: # ansible-playbook --...
0
votes
0answers
27 views

How to validate the variable value with regex in ansible

how to validate the variable value using regex in ansible var: DeviceName: "xxxxx-ax34tas1.xxxint.pngxx.abc.com" - name: valdiate switchname set_fact: switchname: "{{'...
-1
votes
1answer
33 views

Ansible display the diff output of a task even if the task failed

I have also written a simple ansible task module which does the same as shell, but will include the stdout & stderr as part of it's diff results, so you can see it if you use --diff. But if you ...
0
votes
1answer
116 views

Ansible: populate new fields in each item of a list

I'm a total Ansible and Python beginner. I have a list: my_items: - name: item1 unix_user: unixuser1 homedir: /home/unixuser2 - name: item2 unix_user: unixuser2 homedir: /home/unixuser2 I ...
1
vote
1answer
67 views

How to create an ansible-vault file from a task

I need to create an ansible-vault file to store credentials in a task in a playbook. This file would be used by another playbook. Is there an internal ansible method/module to accomplish this? I would ...
0
votes
1answer
82 views

Adding arguments to Packer's Ansible provisioner

My Friday brain is really struggling to convert an Ansible command line into the format my Packer .json wants. The Ansible: ansible-playbook playbook.yml -e @env/users/user01.yml --ask-vault --ask-...
0
votes
2answers
121 views

How to hide password in the ansible host file

I have some windows hosts are configured with WinRM in order to let Ansible connect them. Not like Linux hosts can do ssh-copy-id to avoid entering the credentials, I have to put my admin password in ...
0
votes
1answer
48 views

How to fetch the disk difference before and after adding a new disk

I'm preparing a playbook to find the newly scanned HDD from vmware, I used below filtering to fetch the no. of HDDs: before_add: "{{ hostvars[inventory_hostname].ansible_devices.keys() | select('...
4
votes
2answers
121 views

Ansible management of frequently off machines

I'd like to use Ansible to manage configuration on about a dozen Linux workstations. The problem is that, being physical machines that people use, they're frequently off. So I need a solution for ...

1
2 3 4 5
29