Questions tagged [ansible]

Use this tag for questions about Ansible, an open-source automation engine, related to using Ansible for topics such as cloud provisioning, configuration management, application deployment, etc.

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

How to use Ansible to create a Nexus npm repo

I need to use Ansible to create an npm repo in our Nexus server. I've been looking through the Nexus REST API documentation and figured that I would use the uri module to issue the relevant command(s) ...
user avatar
  • 123
0 votes
0 answers
15 views

windows.win_shell not running as currently logged-in user

I am working on a playbook that is meant to upgrade software on a Windows machine. I would like to prompt any currently logged in users to cancel the upgrade if it is not a good time. I have the ...
user avatar
2 votes
1 answer
26 views

Ansible: How to run ad-hoc command with multiple environnements?

Given the following architecture: ├── ansible.cfg ├── hosts │ ├── production │ └── staging ├── production │ ├── group_vars │ │ ├── all.yml │ │ ├── mygroup.yml │ │ └── mygroup2.yml │ ...
user avatar
  • 33
0 votes
1 answer
31 views

How to keep packages updated and keep in pace with security updates

In a project with multiple vms that run various applications from Wordpress to Django and various other things. Is there a way or a tool to keep track of the packages that require updates or have ...
user avatar
2 votes
1 answer
58 views

In Ansible, how do I assign a hostvar to a playbook's host?

The directory of my Ansible project has the following structure: project/ playbook.yml host_vars/ localhsot.yml roles/ ... terraform-provision/ ... terraform/ ... Here'...
user avatar
0 votes
1 answer
26 views

Setup multiple Raspberry Pi different network configurations

For multiple projects we are setting up 2 to 6 RPi's per project. Each project runs on a different network and for some of these networks we can use DHCP, for others the RPi's have to connect using a ...
user avatar
  • 1
1 vote
1 answer
109 views

How can I set let's encrypt certificates with Ansible?

I'm trying to get a let's encrypt certificate for my domain with ansible. I have been reading this tutorial which is a bit outdated and the ansible documentation. My playbook is a mix of what I have ...
user avatar
  • 33
0 votes
0 answers
12 views

How to disable cross region replication for an instance in oracle cloud through ansible playbook?

I'm trying to disable cross region replication for an instance in Oracle cloud using ansible. So far I've come up with this: - name: Get information of all boot volume attachments in a compartment and ...
user avatar
4 votes
2 answers
110 views

Why use configuration management tools in the world of modern cloud?

Configuration management tools like Ansible, Chef, Puppet, and Saltstack allows us to configure a cluster of blank machines to help install and deploy an application. For example, with Ansible, we can ...
user avatar
0 votes
0 answers
19 views

Is there a good/best practice for temporary changes in Ansible?

Sometimes, I need temporary changes in a playbook. Like adding a firewall rule, do things, and remove the firewall rule again. Or adding a local package repository mirror, install packages from it, ...
user avatar
0 votes
1 answer
56 views

Why can't my playbook find the community.docker modules

I am trying to write a playbook that will download a docker image and run it on a group of servers. I have a python 3.6 virtualenv created and installed ansible into it. I then ran: ansible-galaxy ...
user avatar
  • 101
-1 votes
1 answer
30 views

ansible-doc command for filters & plugins

I would like to list & read documentation from the ansible-doc command for example about ipaddr or flatten. Is it possible? Thanks in advance!
user avatar
  • 101
2 votes
1 answer
142 views

Ansible no user $HOME by default - so how do I run commands

I have thousands of servers that, by default, for security and space do not create a $HOME when you ssh in. This seems to be posing a problem for Ansible as it keeps trying to chdir to home that does ...
user avatar
  • 121
2 votes
1 answer
29 views

Container deployment sync problem with Ansible

Imagine the following situation after you have switched from docker-compose to Ansible: You start a DB container which needs time to boot up You want to load data dump into it (could be also you ...
user avatar
1 vote
1 answer
291 views

ansible mysql query not showing results

I have used community.mysql collection and was able to run a query against the database. --- - name: Get stats of a file hosts: localhost become: true tasks: - name: run mysql query ...
user avatar
1 vote
2 answers
559 views

Ansible: How to run local powershell script on remote hosts

I'm trying to write a play that will take a locally stored powershell script from my Ansible server and run it on Windows hosts. I have been using the "win_shell" module to run scripts ...
user avatar
0 votes
1 answer
8 views

ansible network automation: log commands all commandes from mutiple plays

Trying to write a script to publish basic configurations for any futur new devices. Also assert compliancy of basic configuration for devices in production. Trying to gather all the lines executed, on ...
user avatar
  • 51
2 votes
1 answer
48 views

Where does multi-role variable goes in Ansible?

There are multiple kind of variables in Ansible. And I find it overwhelming to wrap my head around them. Some of them are: The one we can write in roles//vars/main.yml The one we can write in the ...
user avatar
0 votes
0 answers
20 views

ansible network automation: log commands in checkmode, mutiple plays

Trying to write a script to publish basic configurations for any futur new devices. Also assert compliancy of basic configuration for devices in production. Trying to gather all the lines executed, ...
user avatar
  • 51
2 votes
1 answer
400 views

Ansible playbook error: Collection' object is not callable

I am learning ansible on my local vagrant vm machine and I am setting up mongodb using ansible and I keep getting the error: An exception occurred during task execution. To see the full traceback, use ...
user avatar
0 votes
1 answer
124 views

Ansible to get AWS SSM Parameter Store value but fail to decrypt secure strings

I need to lookup a value from AWS SSM Parameter Store, but it needs to fail if the parameter type is secure string. I do NOT want secure string parameters to be decrypted, and I want to detect their ...
user avatar
2 votes
1 answer
192 views

How can I determine an Ansible client's IP address in an OS-independent manner?

I have an Ansible environment in which machines are listed by hostname in the inventories. Occasionally, it is necessary to determine the IP address of a target machine in a playbook (note: in this ...
user avatar
  • 121
2 votes
2 answers
335 views

How to loop through json without an array

I am trying to work out how to iterate over some JSON that has repeated structures but have not used a list. I am using the ansible.posix.firewalld_info module and it returns a dictionary for each ...
user avatar
  • 123
1 vote
0 answers
21 views

Filtering included data for specific criteria to run tasks

I have directory with yml files in there which set parameters for different instances of the software I'm to deploy. It looks something like this: instance1: ip: 127.0.0.3 servername: mycoolserver ...
user avatar
0 votes
0 answers
35 views

Ansible playbook - defining var based on condition

I want to create a var based on condition so I created the below : tasks: - name: set IN_PROGRESS backup folder set_fact: v_target_backup_folder_in_progress: >- {% if node_type == &...
user avatar
2 votes
1 answer
47 views

What are minimum permissions required for an IAM user to provision EC2 instances?

I want to provision an EC2 instance with Ansible. So for that purpose I want to create a separate IAM user to keep things clear. I can assign the full EC2 access to the user. But I don't want any ...
user avatar
0 votes
0 answers
55 views

Сontrol Windows-containers from Ansible directly through "docker" connection-plugin

Is it possible to control Windows-containers from Ansible with "docker" connection-plugin? I.e. with ansible_connection=docker in inventory-file? My current environment: Running dockerd -H ...
user avatar
  • 1
0 votes
1 answer
112 views

Ansible Playbook always interactively asks for Become password, even though no become user is specified?

I have a simple ansible playbook that copies a script and executes a script on an EC2 instance. - name: Playbook Deploy jar hosts: all remote_user: ubuntu tasks: - name: Copy Provisioning ...
user avatar
0 votes
0 answers
334 views

Ansible in venv: how to pip install globally on localhost?

Ansible is installed and is running in a virtual environment: (env) ansible-playbook -vvvv -i localhost playbook.yml I'm trying to install a Python package globally, but it either installs in venv ...
user avatar
1 vote
0 answers
23 views

Filter jobs by inventory

I'm using Ansible AWX and I'd like to find all jobs that were done for a specific inventory , I can do that by going to the inventory and then in the "completed jobs" tab, but is there a way ...
user avatar
  • 111
0 votes
1 answer
94 views

Copy and unarchive Ansible Module

I tried below ansible tasks with copy and unarchive modules and facing error - name: find and archive hosts: localhost tasks: - name: find the file copy: src: "{{ item }}&...
user avatar
  • 11
0 votes
1 answer
124 views

How to prompt when win_service service exists?

I'm trying to figure out the steps needed to get when or other conditionals to react when service is present on hosts targeted on my task. With this I get report that service is on one of the nodes ...
user avatar
1 vote
1 answer
820 views

ansible Unsupported parameters for (command) module:

I'm trying to run a shell command in an ansible task but I keep getting an error. This is the task item and the shell command I want to run: - name: Set File Watch Limit ansible.builtin.shell: ...
user avatar
  • 121
0 votes
2 answers
68 views

Why does Ansible ignore tasks after failing?

My ansible playbook has a task named 'Copy the build script to the system and run it'. It is prone to errors, so I've created a debug task to debug it: - name: Copy the build script to the system and ...
user avatar
2 votes
1 answer
517 views

Testing for EL with Ansible facts; distribution or os_family?

Sometimes in an Ansible playbook, you'll want to condition running a task on whether or not the distribution is CentOS, RHEL, etc, or if it's something else. A very common example is when a package is ...
user avatar
1 vote
0 answers
35 views

Ansible : 'NetworkManagementClient' object has no attribute 'private_endpoints'

I try to deploy a private endpoint for a storage account with Ansible. I am using azure.azcollection.azure_rm_privateendpoint. My playbook code is as below: - name: Create PE hosts: localhost ...
user avatar
  • 111
0 votes
0 answers
67 views

Github deploy keys - success with Curl, failure with Ansible

I'm trying to learn Ansible. One of my tasks is to have Ansible add deploy keys to github for a project. This command runs perfectly fine from bash command line: # replace blahblahblah with ...
user avatar
  • 121
0 votes
1 answer
21 views

Ansible user_module exit with "rc: -25" if UID is large

Ansible user_module exit with rc: -25 if trying to create user with UID provided from Active Directory (AD) domain controller (DC). main.yml - name: Configure local user for example.com user: ...
user avatar
  • 142
0 votes
1 answer
81 views

Ansible Tower on a Free Linux Distro?

Red Hat's Ansible Tower's documentation states that it can only be run on Red Hat Enterprise Linux. I can see once upon a time it could be run on other distros, such as Ubuntu. Is there a free Linux ...
user avatar
0 votes
1 answer
120 views

How to check the status of Ethernet port using ansible?

I want to check status of Ethernet port whether it is up or down on remote server using Ansible?
user avatar
2 votes
1 answer
618 views

What do skipped, rescued, and ignored results mean in ANSIBLE playbook execution?

What do skipped, rescued, and ignored results mean in an Ansible playbook execution? What would be a possible scenario where these results would be different from 0? PLAY RECAP ************************...
user avatar
1 vote
2 answers
89 views

Dynamic environments per client, which is the best approach, if any?

I don't know how to explain this problem better, but I'll try to explain it clearly: Where I work our customers are companies, with lots of users We offer a SaaS solution for them to manage stuff For ...
user avatar
0 votes
1 answer
49 views

How can I detect if an Ansible playbook is executed by ansible-pull rather than ansible-playbook?

I am looking for a when condition which is fullfilled when the playbook is executed by ansible-pull.
user avatar
1 vote
1 answer
110 views

Can not install mysql client and server using a playbook Ansible

Do you know how I can fix this error? I'm getting 404 response from my node machibe when I'm trying to install default-mysql-client and server using Ansible-playbook apt module or shel. Facts I do ...
user avatar
  • 111
1 vote
1 answer
190 views

Ansible with OpenSUSE transactional server

When using an OpenSUSE transactional server, transactional-update must be used instead of Zypper. Is there any way of doing this with Ansible?
user avatar
1 vote
1 answer
341 views

How to add a string to a line when it doesn't exist?

I'm trying to solve a problem where I want to add a setting 'pci=noaer' to all kernel definitions in /boot/grub/grub.conf, but only if the setting doesn't exist. I've managed to get the basic ...
user avatar
  • 13
1 vote
1 answer
60 views

Root ssh key for ansible control node

Scenario: Deploy 30 VMs using terraform and then run ansible - how many ssh keys do you generate? Virtual machine definition in terraform requires administrator ssh key or password provided. Do you ...
user avatar
  • 113
1 vote
1 answer
82 views

Ansible: Does the `hosts: all` pattern in a play only match hosts specified in inventory, or does it also match playbook `add_host` hosts?

I know "all" doesn't match the implicit localhost; the title succinctly expresses my question. Motivation: I have a playbook that needs to be run on cloud hosts generated dynamically and ...
user avatar
1 vote
1 answer
222 views

Ansible cli_command loop register issues

I can't seem to get the register to works with cli_command and looping of multiples commands. Any suggestions? - name: Run show commands hosts: - all connection: network_cli gather_facts: ...
user avatar
  • 11
2 votes
1 answer
165 views

Using ansible to update remote Ubuntu servers that have no external internet access

I am quite new to Ansible, and have to been able to use it to install packages on 80 remote Ubuntu servers that have no external internet access. Is it possible to use Ansible to update/patch these ...
user avatar

1
2 3 4 5
8