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
1 vote
2 answers
726 views

Ansible - Configuring Supermicro servers via Redfish API

I plan to configure Supermicro servers via the Redfish API. Ansible provides the following modules for the Redfish API: community.general.redfish_command community.general.redfish_config Supermicro ...
stackprotector's user avatar
0 votes
1 answer
7k views

Ansible jinja2 if/elif/else construct not working anymore

I am using a jinja2 template for creating several files. Those differ a bit dependent on a set variable. Here's the code: {% if production_env == "prod" or "stage" %} password: &...
diggnsaegg's user avatar
1 vote
0 answers
30 views

Implementing the right conditions for a yum command for centos5 in Ansible

I'm currently working with a centos5 host and I have to install some packages with yum. Unfortunately, as far as I know, centos5 doesn't support Ansible's yum module, since it requires python2 ...
Wander's user avatar
  • 11
0 votes
1 answer
2k views

ansible fatal: "sudo: a password is required", even after priveleges are escalated

while trying to setup a remote machine using ansible, I am running into the following issue: FAILED! => {"changed": false, "module_stderr": "sudo: a password is required\n&...
vinylic's user avatar
1 vote
1 answer
76 views

Creating a hostgroup from a super-set of hosts

I have two host files with different hosts, hostGroups and super-set in each file like below. /ets/hostFiles/TestBoxes [TestBox:children] groupA groupB [groupA] ... ... [groupB] ... ... /ets/...
Siva's user avatar
  • 223
0 votes
1 answer
1k views

Ansible / Jinja2 Unexpected templating type error

I am trying to take a dictionary from one or more async tasks "register: task_variable" then collecting it as a list based on its id's and running a wait task using async_status on the ...
Cyber Axe's user avatar
0 votes
0 answers
819 views

AWX Ansible - Can't access repository Git and Bitbucket

I have configured and successfully used until some days ago a project in AWX, synchronizing it with a Bitbukcet repository. Now, when I am trying to sync the Project with the repository, I get this ...
SctALE's user avatar
  • 101
2 votes
1 answer
729 views

How to access elements of a variable in ansible

I'm trying to access a specific value in a list of data and it fails, can't find the ipa variable. Here is a short bit of the boulder.yaml vars file, yes, dual homed. Network configurations require it:...
Freejack's user avatar
1 vote
0 answers
50 views

What does `Networking` refer to in this diagram about Ansible? [closed]

I find a snapshot of ansible execute a Task. My questions about it: What's Networking in step 7, does it mean the network devices? EDIT-01 In this link we can also find the Networking: Networking – ...
qg_java_17137's user avatar
1 vote
1 answer
402 views

How Can I Escape Backspace Using Set_Fact In Ansible With Jinja Conditional

I cannot figure out how to escape an HTML closing tag, <\b> in this example, when used inside an Ansible Jinja conditional (ansible 2.9.27 in this case). Using an additional backslash <\\b>...
alteredstate's user avatar
0 votes
0 answers
26 views

What is the best approach for managing this local network of SBCs?

I am dealing with hundreds of SBC's (Raspberry Pi or similar). They are all networked to a central control PC via ethernet. I need to automate the following: Perform a network OS install Perform ...
A__'s user avatar
  • 101
1 vote
1 answer
2k views

Ansible playbook fails on Windows server

--- # This is a basic playbook for testing - hosts: WindowsSandbox #gather_facts: no vars: ansible_remote_tmp: c\temp remote_tmp: c\temp tasks: - win_shell: cd c:\temp ...
Adam's user avatar
  • 11
2 votes
1 answer
527 views

known_hosts module reports changed when nothing has changed

Why does my task report say that it has changed when nothing has changed? - hosts: localhost become: false gather_facts: false tasks: - name: Remove non existing host key from known_hosts ...
sxkx's user avatar
  • 121
0 votes
1 answer
3k views

How to run a task from a playbook to a specific host

I'm writing an ansible playbook to manage backup and I want two different tasks : - name: Setup local machine for backup cron: cron_file: /etc/cron.d/backup hour: 4 minute: 0 job: /...
Lionep's user avatar
  • 113
0 votes
0 answers
283 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) ...
Rob Wells's user avatar
  • 123
2 votes
1 answer
228 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 │ ...
Tanuki's user avatar
  • 163
0 votes
1 answer
209 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 ...
user3224454's user avatar
2 votes
1 answer
2k 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'...
Omar Shazly's user avatar
1 vote
1 answer
371 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 ...
Postie's user avatar
  • 113
3 votes
1 answer
2k 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 ...
Tanuki's user avatar
  • 163
4 votes
2 answers
169 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 ...
user34926's user avatar
1 vote
0 answers
39 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, ...
stackprotector's user avatar
1 vote
1 answer
2k 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 ...
dnraikes's user avatar
  • 111
-1 votes
1 answer
446 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!
Costales's user avatar
  • 101
5 votes
1 answer
2k 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 ...
eekfonky's user avatar
  • 151
2 votes
1 answer
124 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 ...
Ta Mu's user avatar
  • 6,812
1 vote
1 answer
2k 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 ...
Ravi Kumar CH's user avatar
2 votes
2 answers
6k 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 ...
James T Snell's user avatar
0 votes
1 answer
35 views

Ansible network automation: log all commands from multiple plays

I'm trying to write a script to publish basic configurations for any new devices. Also to assert compliancy of basic configuration for devices in production. Trying to gather all the lines executed, ...
tintin's user avatar
  • 91
3 votes
1 answer
648 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 ...
Santosh Kumar's user avatar
3 votes
1 answer
2k 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 ...
George Udosen's user avatar
1 vote
1 answer
942 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 ...
AndrewRalon's user avatar
2 votes
1 answer
1k 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 ...
jstarek's user avatar
  • 123
2 votes
2 answers
3k 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 ...
Bryon's user avatar
  • 123
1 vote
0 answers
23 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 ...
jhoffrichter's user avatar
2 votes
1 answer
615 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 ...
Santosh Kumar's user avatar
1 vote
1 answer
1k 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 ...
knowads's user avatar
  • 13
0 votes
0 answers
1k 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 ...
waverider's user avatar
  • 109
1 vote
0 answers
35 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 ...
adaba's user avatar
  • 111
0 votes
1 answer
355 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 }}&...
vtr's user avatar
  • 11
0 votes
1 answer
1k 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 ...
Aslak Laine's user avatar
2 votes
1 answer
7k 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: ...
learningtech's user avatar
1 vote
2 answers
586 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 ...
Maksym Iliev's user avatar
7 votes
2 answers
4k 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 ...
Todd Walton's user avatar
1 vote
0 answers
84 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 ...
MoonHorse's user avatar
  • 111
0 votes
1 answer
55 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: ...
U880D's user avatar
  • 387
0 votes
1 answer
160 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 ...
James T Snell's user avatar
1 vote
1 answer
655 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?
user30584's user avatar
2 votes
1 answer
2k 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 ************************...
Alic Antunez Cruz's user avatar
1 vote
2 answers
142 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 ...
Leonardo Cavalcante's user avatar

1
2
3 4 5
10