Questions tagged [ansible]

On-topic questions are concerned with the use of the tool itself. Installing Ansible and prerequisites, connection issues, ... are off-topic. Red Hat Ansible is a model-driven, configuration management, multi-node deployment/orchestration and remote task execution system. It uses SSH by default, so there is no special software to be installed on the nodes you manage. Ansible is written in Python but can be extended in any language.

Red Hat® Ansible® is a model-driven, configuration management, multi-node deployment/orchestration and remote task execution system. It uses SSH and Python by default, so there is no special software to be installed on the nodes you manage. Simply, it is an agentless configuration management tool. Ansible can be extended in any language, as long as the modules can process and respond with JSON.

The biggest advantage of Ansible over other configuration management technologies is, it is agent-less, i.e., no clients need to be installed, which avoids the chicken and egg problem.

The name "ansible" is taken from the science fiction concept of a machine capable of instantaneous or superluminal communication.

While only a Linux node can be used as a control machine, it remains nonetheless possible to have Windows nodes as a target into Ansible.

Ansible capabilities have gained a lot of modules to cover Infrastructure as a Service, Platform as a Service, and Service as a Service.

Ansible is also capable of interacting with a lot of network equipment like Cisco IOS, Juniper Junos or F5 Bigip.

Ansible has two major products,

  • Ansible Engine - Easily and quickly deploy IT services, applications and environments, remove barriers between IT teams by automating routine activities.

  • Ansible Tower - With Red Hat® Ansible® Tower you can centralize and control your IT infrastructure with a visual dashboard, role-based access control, job scheduling, integrated notifications and graphical inventory management. Easily embed Ansible Tower into existing tools and processes with REST API and CLI.

Relevant links:

Related tags:

23075 questions
6
votes
1 answer

Failed to connect to host via SSH on Vagrant with Ansible Playbook

I was not able to find where the actual problem is. I executed below playbook with my private key: --- - hosts: localhost gather_facts: false sudo: yes tasks: - name: Install package libpcre3-dev apt: name=libpcre3-dev…
Tanay Suthar
  • 453
  • 3
  • 8
  • 19
6
votes
1 answer

How to set condition for single option of ansible module alone

Is that possible to set conditions for a single option of the ansible module. Using set_fact we can set condition aand use that variable in the ansible module. Alternatively is there any other option to set the condition using if loop in jinja or…
jake
  • 333
  • 1
  • 4
  • 12
6
votes
1 answer

Ansible - how to use when with an or operator

My goal is to use a conditional check, on two variables, using the or operator. There are two vars: var1: test var2: another Using one a check on one variable works. when: "'te' in var1" # works! But using two variables is always true. when:…
Kevin C
  • 4,851
  • 8
  • 30
  • 64
6
votes
1 answer

Ansible -> How to force execution of all tasks?

We would like to reset server installation. We already have Ansible script to setup our server, so we want to execute it. However Ansible checks, that e.g. some files are existing and then skip steps where those files are prepared, but we would like…
6
votes
1 answer

ansible: using ssh key authentication but asked multiple times for passphrase - why?

On my management hosts, i have installed ansible 2.2.0.0 and i am attempting to connect to my client. The client is an EC2 instance that only accepts SSH keys to login. I have a simple playbook that is creating a temporary file on the client I am…
Matzuba
  • 333
  • 2
  • 4
  • 8
6
votes
1 answer

How to install older package of ansible?

I need to install ansible 2.1.0.0-1.el7. My setup does not work with the newest version of ansible which I installed with: yum -y --enablerepo=epel install ansible This gave me ansible-2.2.0.0-3.el7.noarch. So I tried to list the older versions but…
DenCowboy
  • 13,884
  • 38
  • 114
  • 210
6
votes
2 answers

ansible parse json with several keys with the same name to one list variable

I have an issue to parse a json using ansible I have a task that connected to rancher and get a json file task: - uri: url: http://rancher.local:8080/v1/hosts method: GET user: ################## password: ################ …
dsaydon
  • 4,421
  • 6
  • 48
  • 52
6
votes
2 answers

Ansible mysql grant

I want to grant privilege on a db(test_db) to a user(test_user) using Ansible. My command is as shown below. grant all PRIVILEGES on .* to @'localhost'; How will I execute the command using Ansible.
Pattu
  • 3,481
  • 8
  • 32
  • 41
6
votes
1 answer

How to create conditional copy in Ansible based on network (subnet) membership

I want to copy one version of a file to a server if it has an interface in a specific subnet, or a different version if it does not have an interface in that subnet. Below is a working, but I think less than optimal solution. I'm hoping there is a…
jordan white
  • 63
  • 1
  • 4
6
votes
2 answers

How can I make Ansible show only errors in execution?

How can I make ansible show only errors inside of some playbook, or even when directly invoked? I tried suppressing std output but that apparently didn't help, because execution errors seem to be put into standard output instead of error output on…
Petr
  • 13,747
  • 20
  • 89
  • 144
6
votes
2 answers

Getting MAC address from Ansible facts in role

I'm trying to get the MAC address for the current host so that I can use the value in a task. Even after reading the docs I cant seem to wrap my head around how to do this. I've been trying to figure out the structure by dumping out the values. The…
RhythmicDevil
  • 705
  • 5
  • 15
  • 31
6
votes
1 answer

calling an ansible playbook with tag and parameter

I am trying to call an ansible v2.1 playbook (notifications.yml) from another playbook using an include statement. I would like to specify a tag as well as pass a parameter to the called playbook (from within the playbook which has the included…
ali haider
  • 19,175
  • 17
  • 80
  • 149
6
votes
3 answers

root@localhost password set with Ansible mysql_user module doesn't work

I have the following playbook: - hosts: myserver vars: mysql_root_password: foobarbaz [...] tasks: [...] - name: update mysql root password for all root accounts mysql_user: name=root host={{ item }} password={{…
William Turrell
  • 3,227
  • 7
  • 39
  • 57
6
votes
2 answers

How to backup files and folders using ansible?

I have a folder of files and sub folders with some template files which needs to be deployed in a remote machine, but before deploying these files & folders I need to backup these in the control system (where ansible is running). The number of files…
user801116
6
votes
3 answers

Ansible: execute role only for some hosts

Let's say I have a single playbook with some roles for the installation of an appserver and I like to apply the same playbook on both production and testing servers. Both production and testing servers have the same list of roles, with the exception…
tvs
  • 737
  • 2
  • 17
  • 33
1 2 3
99
100