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
4 answers

Ansible replace code in multiple files in a directory

I'm trying to disable all repos on my server using ansible, so I'm trying to do a replace on multiple files within one directory but can't seem to get it to work any idea appreciated! tasks: - name: get repo names raw: find /etc/yum.repos.d/…
completenewb
  • 73
  • 1
  • 1
  • 4
6
votes
2 answers

Ansible: firewalld and adding new zone

I' trying to add the following to an Ansible playbook: firewall-cmd --permanent --new-zone dockerc firewall-cmd --permanent --zone dockerc --add-source 172.17.0.0/16 firewall-cmd --permanent --zone dockerc --add-port 8443/tcp firewall-cmd…
Magick
  • 4,603
  • 22
  • 66
  • 103
6
votes
3 answers

Gets error "Cannot get CSRF" when trying to install jenkins-plugin using ANSIBLE

I am using ANSIBLE to install jenkins on CENTOS. The installation works fine but when it comes to the task of installing plugin, i get the following error. fatal: [jenkins]: FAILED! => {"changed": false, "details": "Request failed:
6
votes
1 answer

How solve"no python application found check your startup logs" error for Django + uWSGI + nginx stack

I user Django 1.10 with uWSGI and nginx on ubuntu 16.04 and deploy my app with ansible. My project have not default structure, but quite common ( thank Two scoopce for this :). I use split dev and production settings and config folder instead 'name'…
Denis Savenko
  • 829
  • 1
  • 13
  • 29
6
votes
1 answer

ansible conditional templates

I want to have a simple if else condition in ansibles jinja templates. For plain python cluster_name+'A' if isCondition is True else cluster_name +'B' wors great if the following variables are defined: isSingleNode = True cluster_name =…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
6
votes
1 answer

Find ansible ssh user

I'm using the User in ~/.ssh/config file to specify the user name ansible uses to access the remote server, for example: Host 123.234.098.076 User my_local_user_name Is there a way to find that user name in Ansible? In the following playbook…
AJP
  • 26,547
  • 23
  • 88
  • 127
6
votes
3 answers

Run Python script with arguments in Ansible

I want to run a Python script from inside of an ansible playbook, with input arguments. How do I do it? I tried command, but it doesn't seem to take any input arguments. I also tried script, but it seems to be considering only bash scripts. PS: I am…
Dawny33
  • 10,543
  • 21
  • 82
  • 134
6
votes
1 answer

is boto3 supported by ansible?

so this is a pretty basic question but I couldn't find the answer in the ansible docs. Does Boto3 work with Ansible? I see that some of the docs on ansible have boto3 as a requirement, like…
lightweight
  • 3,227
  • 14
  • 79
  • 142
6
votes
2 answers

How to include the Ansible config file in the ansible-playbook command?

I run my ansible-playbook with the following command in my localhost: ansible-playbook -i "localhost," -c local GitClone.yaml However, I also have a GitClone.cfg file which has: [defaults] transport = ssh [ssh_connection] ssh_args = -o…
Dawny33
  • 10,543
  • 21
  • 82
  • 134
6
votes
1 answer

How to concatenate files with a glob pattern as a single value?

I have a fairly simple playbook which creates authorized_keys entries for a given user in Ansible: - name: chat user authorized keys authorized_key: user: chat key: | {% for filename in lookup('fileglob', 'public_keys/*.pub')…
Naftuli Kay
  • 87,710
  • 93
  • 269
  • 411
6
votes
1 answer

Run Ansible-Playbook on localhost on Windows

I know Ansible supports Windows clients/nodes. What I really enjoy about Ansible is that I can create a Linux VM, pull a git repo that contains Ansible playbooks for and without any configuration or setup of a control server, I am able to run the…
ajgreyling
  • 1,406
  • 2
  • 13
  • 10
6
votes
2 answers

Get IP address of Docker with Ansible

I have follow playbook command: - name: Docker | Consul | Get ip shell: "docker inspect --format {% raw %}'{{ .NetworkSettings.IPAddress }}' {% endraw %} consul" register: consul_ip After run ansible return follow error: fatal:…
Rinat Mukhamedgaliev
  • 5,401
  • 8
  • 41
  • 59
6
votes
2 answers

Ansible first hostname of groups

I am not sure on how to find the first ansible hostname from group_names. Could you kindly advise me on how to do it? hosts [webservers] server1 server2 server3 [webserver-el7] server4 server5 server6 And i have 2 different playbook for each host…
AlamHo
  • 193
  • 1
  • 3
  • 12
6
votes
4 answers

How can I get the installed YUM packages with Ansible?

I am trying to get all the installed YUM packages on an RHEL machine. I can easily get it through using shell commands which is not idempotent and would like to use the YUM command instead. The shell command works fine: - name: yum list packages …
user_dev
  • 1,357
  • 3
  • 20
  • 46
6
votes
1 answer

Is there an equivalent to Lookups but executing in target host instead of local?

In Ansible, when I need to read properties from a Java properties file (.properties), I do something like: - name: Read properties set_fact: myProp1: {{ lookup('ini', 'myProp1 type=properties file=/path/to/file.properties }} myProp2: {{…
Héctor
  • 24,444
  • 35
  • 132
  • 243
1 2 3
99
100