Ansible is an open-source software platform for configuring and managing computers. It combines multi-node software deployment, ad-hoc task execution, and configuration management.

learn more… | top users | synonyms

0
votes
1answer
47 views

SSH and sudo over a pseudo-tty terminal

I am trying to overcome some limitations in our environment to write up an authorized SSH file for passwordless ssh keys. I am requiring to perform an ssh as a to a target system, and then run a "...
1
vote
1answer
20 views

ansible: setting variable according to ansible_os_family

Using ansible 2.0.2.0, I want to deploy a file to destination server. The destination folder is different on Debian and RedHat family. I have used set_fact, but it seems that it used the last defined,...
0
votes
1answer
17 views

Add and remove instances from azure load balancer programmatically

I'm new to Azure, and my team and me are setting a production environment in the Azure cloud, there will be a load balancer with a few instances behind, in the deployment process using Ansible I'd ...
0
votes
1answer
13 views

Using external variables inside of an Ansible template

Background I am writing a playbook that installs two of the same web application on different machines. Both applications require their own MySQL/MariaDB database. I plan to pass the MySQL ...
1
vote
1answer
59 views

Ansible deploy multiple authorized_keys on multiple hosts

We need deploy keys on the servers, but trick is that the keys are many and do not all of them must have deploy on all servers. Now we do it follows: in vars roles/authorized_keys/vars/main.yml ...
4
votes
1answer
35 views

What is the equivalent of using hiera as an ENC in Ansible?

I use hiera as an External Node Classifier in Puppet in order to avoid that roles are deployed on nodes that are for example incompatible. Now I have two servers that are provisioned using Ansible. I ...
0
votes
1answer
17 views

What is the equivalent of Puppetboard in Ansible?

I would like to have an overview of all facts of all nodes in the cluster that are provisioned with ansible like Puppetboard is doing for all nodes that are provisioned using Puppet
2
votes
0answers
36 views

What is the equivalent of r10k in Ansible?

Puppet modules like the ones from puppetforge could be deployed using r10k. Question What is the equivalent of this tool in Ansible? Attempt to answer the question This Google Q&A was found ...
-1
votes
0answers
39 views

ansible - create a loop directory

Can some please clarify me the ansible issues which I am having? On default main.yml I have below variables: my_path: "/etc/newfiles" my_plugin_location: "/etc/myfile/plugins" my_tmp_dir: '"{{ ...
8
votes
1answer
115 views

What is the current state of the art for user management with Ansible?

I have been using Ansible, to great success, for ~3 years now for managing an ever-growing flock of linux systems. Before diving into my question, I need to set some context. As part of my day job, I ...
0
votes
0answers
13 views

Running ansible role and dependencies with different ssh login method

I am writing an Ansible role (say role A) that should have dependency at another role (say role B). However role B has to be run with --ask-pass, i.e. you can only run it with password, not an ssh ...
0
votes
1answer
26 views

Ansible not executing within Packer Build

I am currently experimenting with deploying using Packer’s Ansible local provisioning and for some odd reason, it doesn’t appear to be executing the tasks in the playbook. Packer, after installing ...
0
votes
0answers
16 views

Using ansible for multiple web apps on one server

So far, most of the ansible guides and documentation I have seen was about having one application that runs on multiple servers. But I would like to automate the opposite: I have several small rails ...
0
votes
2answers
54 views

Failed to install the ansible with pip

I tried to install ansible with the following commands: docker run -ti --rm ubuntu:14.04 bash echo "===> Updating cache..." && \ apt-get update && \ \ \ echo "==...
0
votes
0answers
59 views

How can I use variables in Ansible expect module questions?

I'm trying to use a variable in Ansible playbook using the expect module. It seems like I can use it for the answer, but not the question - is there some escaping I can do to make this work? ...
0
votes
1answer
24 views

create a user and associate with existing pem file

I have an ec2 instance on which i am running ansible.I want to create a user with a playbook, but without a password and the user must be using existing pem file for authentication and must be able to ...
0
votes
1answer
45 views

Deploying a windows machine with ansible and sysprep

I was wondering if you could help me? I'm trying to deploy a windows server 2012R2 base image using the vsphere ansible module. I have created a Vsphere template where the guest machine has WinRM ...
1
vote
0answers
38 views

How to run Ansible's gce.py script from inside an instance running in the cloud?

My goal is to create a compute engine instance in Google cloud from which I can run ansible scripts to further create additional instances that will run containers via GKE. I've figured out a number ...
1
vote
1answer
36 views

Why is module os_keypair not returning private_key?

I am deploying to Rackspace Cloud with the OpenStack ansible module. I am facing an issue with the SSH keypair creation. It creates the public key, and installs it on the host. However I can see that ...
1
vote
1answer
29 views

Parse through a list of Ansible variables and refer to itself while running task

Problem I have a simple Ansible playbook that creates a list of tmux sessions and then runs a script inside of each session. I am trying to give the tmux sessions names in my vars.yml file. My ...
1
vote
1answer
34 views

Ansible best practice for a file for every host

I need to have a different file for every host, where is the best place to store that? Is it considered good practice to store it under files folder and store the path under host_vars?
0
votes
1answer
19 views

How to create a vagrant box in a remote server

I've been using vagrant since a few months to test server configurations (with ansible). At work we have some spare internal servers that I would like to use for our continuous integration system. ...
2
votes
2answers
60 views

Ansible, AWS, other host based on tag

I am creating Ansible playbooks which create our system's infrastructure in AWS. Obviously dynamic inventories using ec2.py are involved. I first create a utility server, then a web server, and I ...
0
votes
2answers
32 views

Ansible - multiple statements withe the same variables

I'm new to ansible, so I might be missing something obvious. I have a playbook doing the following: - name: Create real users user: name="{{item.user_name}}" comment="{{item.user_description}}" ...
0
votes
1answer
34 views

How do I organize Ansible's hosts file per role and location?

My project is to use Ansible to manage three server clusters each of which live in different cities and states, Boston, Chicago and Los Angeles. So in each data center I have two httpd servers, three ...
-1
votes
1answer
104 views

How can i check software version with Ansible?

I have three linux servers and i created the ansible inventory file: [web] 192.168.0.155 192.168.0.165 192.168.0.175 And i have playbook.yml: --- - hosts: web tasks: - name: Check drinks ...
0
votes
1answer
75 views

resolvconf coupled with dnsmasq and lxd

Q: How do I programmatically add a persistent resolvconf entry for my lxd based dnsmasq? I have a very base installation of Ubuntu 16.04 server. I have installed and configured lxd and created a ...
-1
votes
3answers
38 views

How to manage hosts with multiple sites using Ansible?

I have this sample inventory file: [web1] // Web Server 1 contains the following sites: example1.com example2.com [web2] // Web Server 2 contains the following sites: example3.com example4.com But ...
0
votes
1answer
108 views

Windows Server 2012 R2 not downloading recommended updates

I have multiple Windows Server 2012 R2 running on Azure (IaaS VM's). We perform monthly maintenances on these servers via Ansible, this includes Windows updates (recommended and critical updates). ...
2
votes
1answer
38 views

Combine groups in ansible template

Has anyone combined groups for a loop in ansible templates. What we want to do is get the common members of two groups and loop them through to create our config. We're trying the same format that ...
10
votes
4answers
266 views

Ansible: Is it possible to “cat file” and export it's output to screen while playing a playbook and not as debug?

I wrote a playbook which installs and configures Google Authenticator per user. I want the last step of the playbook to cat the google_authenticator configuration file. Using the "debug" module I am ...
0
votes
1answer
52 views

Restarting network interfaces that have changed with ansible

I've got an ansible role that - name: add virtual interface configs for vlan template: src=ifcfg-eth.vlan.j2 dest=/etc/sysconfig/network-scripts/ifcfg-{{ item.device }} with_items: "{{ ...
0
votes
0answers
42 views

Automate vm creation and configuration with ansible

I am looking at different ways to consistently, quickly and automatically provision and configure linux VMs. I am currently using ansible to configure all my servers. It really is the business. I ...
1
vote
1answer
29 views

Via ansible change password of non-root account using passwd command and picking old password from ansible files

I have got a lot of systems having a common username to login. The password is also same for most of the systems. I have 1 inventory file with all the systems. For the systems that have a different ...
0
votes
0answers
30 views

Ansible fails on AWS domain name, but not on ip and other domain name

I have a machine which I am trying to ping via ansible to test my connection. Originally we were using the AWS domain name (note, not using the actual addresses): ec2-{ip}.address.compute.amazonaws....
2
votes
1answer
91 views

How can I use Ansible to conditionally append a line in a file?

I'm trying to create an Ansible task that sets up trim/discards. I have a playbook that takes care of everything else (LVM, fstrim), but I can't figure out how to get crypttab configured properly. I'...
1
vote
1answer
312 views

Ansible host “unreachable”: true

I just started learning the basics of Ansible. And facing some problem related to server connectivity via SSH. I created a folder named publich_html and put my code into that folder and changed the ...
3
votes
2answers
132 views

Ansible: updating select packages if installed without installing if not

I have a few tens of hosts that are a mix of CentOS 6 and 7. I recently started using Ansible to help manage them, but I'm still very much a newbie. Like everybody, I have a periodic need to update ...
1
vote
1answer
45 views

How to fetch specific data from a module in ansible to be used under another host

Here is a Linode playbook to spin a cloud server instance: --- - hosts: 127.0.0.1 connection: local tasks: - name: Create Linode Machine linode: api_key: 'blablabla' name: ...
2
votes
1answer
80 views

Ansible-galaxy not working with sudo

I'm having problems instaling plugins with ansible-galaxy. I've tried 3 things: Instaling without sudo: ansible-galaxy install sfromm.epel [WARNING]: - sfromm.epel was NOT installed successfully: ...
7
votes
2answers
218 views

Immutable Server model with Docker/Ansible vs. Ansible, Puppet, and Foreman in AWS?

We are running into an interesting argument and are falling into two camps. I'm interested in any particular problems with either idea or gotchas we might be missing. Really, anything that can help us ...
1
vote
1answer
159 views

Changing the IP of a vSphere guest VM using Ansible

I want to deploy a VM from a template on vSphere and change the new instance IP via Ansible (2.x). I've managed to clone the template with vsphere_guest module but I didn't find a way to change the IP ...
0
votes
1answer
36 views

Ansible stat, register and when while looping

I have this: - stat: path=/etc/pki/tls/certs/{{ item.ServerName }}.crt with_items: - "{{ prod }}" register: sslcheck - debug: var=sslcheck - name: Create self-signed SSL ...
0
votes
0answers
30 views

looping using with_items while registering it

I am passing 3 variable values from inventory file. Now i want to confirm that all the 3 variables values are present in inventory file. I am registering the values with with_items but how to check ...
0
votes
1answer
38 views

Ansible and fact dependent variables

Can an inventory variable in Ansible be dependent on a fact? Namely, I have a variable in group_vars/all/cars.yml that I would like to set to a value dependent on ansible_fqdn. Like: --- ...
0
votes
1answer
38 views

how to store value of ansible fact variable in another variable

I wanted to store value of ansible fact variable in some other variable, and also wanted to check is that fact variable is empty or not Below is my code where i can print the value of ansible_local ...
1
vote
1answer
77 views

Can I use ansible to startup jboss service in domain mode?

I used sh /usr/local/jboss/bin/domain.sh manually, and jboss works fine. When I use ansible to start jboss automatically, jboss log always shows "Container is down". File /root/startup_jboss.sh : #!...
2
votes
0answers
2k views

Ansible: Failed to connect to the host via ssh

Anyone know why this isn't working? I'm using Ansible on Cygwin using a compiled version of sshpass. I followed the instructions at http://www.jeffgeerling.com/blog/running-ansible-within-windows ...
0
votes
2answers
84 views

Setting up icinga2 nodes via Ansible: how do I get the ticket from the master?

I'm trying to write an Ansible playbook to set up Icinga2 nodes, but each host needs a unique ticket from the Icinga2 master to authenticate. Right now I'm thinking of ssh'ing out from the node to the ...
0
votes
1answer
31 views

I am trying to use vars_prompt but when i run the playbook it directly gives me prompt and ask for the value, it doesn't checks in inventory file

What I want is set the priority of variables. I am passing the variable from inventory file and if the variable is not defined in inventory file then it should ask for user prompt. I am trying to ...