Questions tagged [ansible]

Ansible is an automation tool ("IT orchestration engine", per the company web site) for the deployment and configuration of applications and systems.

Ansible is an automation tool for the deployment and configuration of applications and systems. Ansible is an open source project released under the GPLv3 license. Ansible, Inc., who provides commercial support and repackaging, was acquired by Red Hat, Inc. in 2015. Ansible scripts are written using the YAML syntax.

Ansible Git Corporate site Ansible Project on Google Groups

477 questions
56
votes
1 answer

ansible extract without first directory

When extracting a tar.gz file in ansible I end up with a first directory - name: Extract archive unarchive: src=file.tar.gz dest=/foo/bar which results in /foo/bar/bar-version-someFirstLevelFolder/contentOfArchive How can I prevent…
Georg Heiler
  • 663
  • 1
  • 5
  • 6
43
votes
3 answers

List ALL Ansible variables for a host or group with an ad hoc command?

Ansible variables come from a variety of sources. It is for example possible to provide host_vars and group_vars by creating YAML files in a subfolder named host_vars and group_vars respectively of the folder containing the inventory file. How can I…
0xC0000022L
  • 16,189
  • 24
  • 102
  • 168
25
votes
2 answers

Ansible use inventory_hostname or ansible_hostname in task name

I am writing a rolling upgrade playbook and would like to print out the hostname of current host been upgraded. I put inventory_hostname and ansible_hostname in task names but that did not work - name: upgrade softare on {{inventory_hostname}} -…
Ask and Learn
  • 1,865
  • 4
  • 25
  • 34
25
votes
1 answer

Proper syntax for ansible symlink

What is the proper syntax for creating symlinks using ansible? I'm creating a Vagrant virtual environment and running ansible as my provisioner. Everything works fine up until I try to symlink to my site nginx configuration file from sites-enabled.…
jeanpier_re
  • 405
  • 2
  • 5
  • 10
17
votes
2 answers

How would I register a dynamically named variable in an Ansible task?

I'm trying to retrieve the group ID of two groups (syslog and utmp) by name using an Ansible task. For testing purposes I have created a playbook to retrieve the information from the Ansible host itself. --- - name: My playbook hosts: enabled …
0xC0000022L
  • 16,189
  • 24
  • 102
  • 168
13
votes
1 answer

How can install specific version of ansible?

How can I install a specific version of Ansible, using Yum or another method? When I try to install version 2.0 it says No package 2.0 available. I checked the epel repo. There are only two rpms, but no rpm containing version 2.0. Why are they…
salauddin
  • 325
  • 2
  • 3
  • 6
10
votes
2 answers

Whenever ansible makes changes to sshd in CentOS7 a random future play cannot connect

This has been an irritating enough problem now that I thought I would finally ask the community at large what a possible solution might be. It's even more irritating that I seem to be the only one experiencing this issue. Essentially, anytime in…
Viscosity
  • 273
  • 1
  • 7
  • 15
9
votes
3 answers

With Ansible, is it possible to connect connect to hosts that are behind Cloud IAP (Identity-Aware Proxy) in GCP?

Cloud IAP is a sort of proxy for Google Cloud Platform that lets you connect to compute instances that don't have public IP addresses, without a VPN. You stand up an instance and then you can use the gcloud utility to connect to it by name like so:…
mat
  • 153
  • 1
  • 9
9
votes
4 answers

Is there a distro-agnostic configuration management software?

I don't want to label myself to specific configuration-manager modules like Ansible's apt module or yum module. Is there a distro-agnostic configuration management software, or at least one with distro-agnostic code to install the following packages…
user149572
9
votes
3 answers

Can I automatically accept MS SQL license terms while installing the yum package?

I am using Ansible to provision MS SQL Server 2017 to a CentOS 7.4 box. I first went through this guide via command line and it works, but my end goal is to "Ansible-ize" it. However, when I get to the step about installing the command line tools,…
Nathan Smith
  • 259
  • 2
  • 3
  • 9
8
votes
1 answer

Terminate and disable/remove unattended upgrade before command returns

I'm having an issue here where I try to automate a setup with Ansible. Some of the steps require interaction with apt, but occasionally I get an error because unattended-upgrade kicked off and locked apt. This will make the playbook stop. I've tried…
Daniel F
  • 817
  • 2
  • 10
  • 24
8
votes
2 answers

How do I open a file with ansible-vault edit from inside vim?

Usually, when I want to open a file encrypted by ansible-vault for editing, I just run ansible-vault edit - this decrypts the file to a temporary file and opens it for editing. However, what I want to know is how to achieve this from…
3cheesewheel
  • 195
  • 1
  • 6
8
votes
1 answer

Configuration management via versioned packages

For the hosts we manage, my boss has a vision of configuration management via versioned packages (in our particular case, fpm-built debian packages). This is to make: host deployment easier easier to track local changes make bug tracking easier as…
chazkii
  • 181
  • 6
7
votes
2 answers

Ansible failed_when only print customized error message

I am writing a simple Ansible playbook to run RHEL leap second detector on Linux boxes with mixed distribution. here is the playbook --- - hosts: Linux vars_files: - ../group_vars/Linux.yml tasks: - name: Running RHEL leap second…
Ask and Learn
  • 1,865
  • 4
  • 25
  • 34
6
votes
1 answer

How to enable multiple services at once with firewalld module - Ansible

How to enable multiple services at once with firewalld module? I'm using this code which enables one service (https) after running ansible-playbook.It work just fine. However, I can't figure out how to enable multiple services in this code instead…
JohnyFailLab
  • 133
  • 3
  • 9
1
2 3
31 32