Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ansible]

Ansible is an IT automation tool. Use this tag for questions regarding the Ansible IT automation tools.

0
votes
0answers
5 views

Disable Quick Edit PowerShell/cmd prompt

I've tried to disable quickedit through regedit HKCU:\Console QuickEdit = "0" the value changes in the registry but nothing happens. I know I can right-click edit properties but I need to find the ...
0
votes
0answers
8 views

Trouble uninstalling a program with ansible win_shell

The program in question is gvim. it works perfectly when i log onto powershell and execute this command: `& "C:\program files\vim\vim81\uninstall-gui.exe" /S but when i do it in ansible with ...
-2
votes
0answers
13 views

Kubespray multi master config failed with below output

ailed: [node1] (item=apiserver) => {"changed": true, "cmd": ["/usr/local/bin/kubeadm", "init", "phase", "certs", "apiserver", "--config=/etc/kubernetes/kubeadm-config.yaml"], "delta": "0:00:00....
1
vote
1answer
14 views

ansible playbook when condition for replay

is there any option for the replay the play in the playbook? I want to write ansible playbook like below. I want to run play2 if any error in the play1_result and after running play1 if play2 is a ...
1
vote
0answers
12 views

Ansible - ios_vlan unable to run any commands that require privilege mode

I've been testing ansible for some simple network automation and it seems I'm unable to complete even some simple tasks. I'm having an issue where any commands that require enable mode are failing. ...
0
votes
0answers
12 views

Ansible failing to SSH with password instead of Key

I am using ansible to try and set up a server. At the moment the server has a root user who authenticates with a password (no ssh key required). If I ssh manually from my command line I am prompted ...
1
vote
1answer
25 views

Run ansible playbook on specified host and group?

Let's suppose that we have host group dev with corresponding group vars. [dev] host1 host2 How to run ansible playbook with a host3 that is not in group dev using CLI?
0
votes
0answers
35 views

Ansible via Vagrant Provisioner not Working with `become` (or `sudo`)

How can Ansible be used via Vagrant's ansible provider while working with actions that become a superuser? Every attempt I've made so far doesn't work for quite inexplicable reasons. The scenario is ...
3
votes
1answer
159 views

Uniting Putty with WSL-Ansible under the same private key and passphrase

In my PC I use Windows 10 home with WSL-Ubuntu (16.04 - xenial) and Ansible. I often rent IaaS machines and SSH into them via Putty from Win 10 and all of my IaaS machines are usually orchestrated, ...
0
votes
0answers
30 views

Why do tabs in YAML work some but not at all times?

We've used tab-characters in some of YAML-files here: host: "foo" port: 8011 p: "bar" For some reason, the same version of Ansible running the same playbook works just fine with these files ...
2
votes
1answer
285 views

Ansible hangs after parsing inventory

I'm using Ansible locally to configure my own machine and today (I haven't run the playbooks in a while) it all of a sudden started just hanging. I can't seem to run any playbooks at all, at least not ...
0
votes
1answer
84 views

to hide password from the output

I'm passing the password to my sudo in ansible playbook like: echo <password> | sudo -S su - <username> It's working fine. But the problem here is in my output the password is visible. ...
0
votes
1answer
333 views

How to count the number of elements in an array in Ansible?

An array is generated in Ansible from shell command output, it is similar to below: foo: [value0, value1, value2, value3] Now depending on output of the shell command, the number of elements of foo ...
0
votes
0answers
50 views

Possible to stop ansible and run an autoit script non-silent?

I have a vast ansible script i run. But there are some things I need to do manually but can do they via autoIt. Is there a way to run win_shell or win_command so that ansible let's autoIt run in the ...
0
votes
0answers
22 views

Ansible command not working on Cygwin

I have configured Cygwin on Windows Server, but the below command is not showing any error. How I can solve the problem? $ ansible all -m ping
0
votes
0answers
57 views

Ansible Regexp groups, patterns or something else?

I have to use ansible to manage a few DNS zones. We use a playbook and some templates without any issue. However, the serial number of the zone(s) is manually modified by the end users and a lot of ...
0
votes
1answer
35 views

Ansible: replace cannot find a locally existing file

I am trying to replace a single string in a configuration file test.conf using Ansible. Those are the two tasks of my role: - name: Check for conf locally local_action: stat path="{{ role_path }}/...
1
vote
1answer
55 views

How to interpret the iptable rule specified in the description?

I am new to iptables and trying to learn the same. What does --set in this iptable rule mean? -A INPUT -m state --state NEW -M recent --name ssh -p tcp --dport 22 --set Can someone explain this ...
0
votes
0answers
31 views

How to securely pass personal credentials to ansible_local?

My Vagrantfile contains this: config.vm.provision "ansible_local" do |ansible| ansible.playbook = "setup.yml" ansible.vault_password_file = "vault_pass" end The vault is secured with a team-wide ...
0
votes
2answers
163 views

No Ansible config file or /etc/ansible directory after trying pip and yum install

So I have been trying to install Ansible for some server management however it seems that yum and pip both don't want to co-operate: I tried a yum install which refuses to work because it cant seem ...
0
votes
0answers
131 views

Changing Registry Settings with Ansible Windows 10

I've been trying to disable a microphone via automation for a few days now. I'm using Ansible and attempting to change the registry setting. It's a simple thing changing from 10000000 to 10000001 or ...
2
votes
0answers
77 views

Java memory allocation error inside a Docker container when host machine is running Alpine Linux

I want to run Jenkins in a Container where my host machine is running Alpine Linux. I have an Ansible playbook that starts the Jenkins container. However, the container exits as soon as it starts. I ...
0
votes
0answers
46 views

Cannot add or change users with ansible on remote ubuntu machines

I'm testing ansible and using a playbook to create a user on a remote machine but i keep getting the error FAILED! "useradd: permision denied" "useradd: cannot lock /etc/passwd" Will i need to ...
1
vote
1answer
252 views

Ansible ssh connection to remote machine fails with the following error, how do we tweek it to work

when Ansible playbook tries to connect to the (Tomcat server) VM machine which is in the same subnet, it gives the following error: Step1: ssh command the one which ansible playbook uses: ssh -C -...
2
votes
0answers
38 views

Provisioning browser extensions on Linux

I've always struggled with getting new Linux systems set up to my preferred specifications, and I've finally started to look into solutions for provisioning, saving dotfiles in git, etc. There's a lot ...
2
votes
1answer
1k views

ansible: execute local_action only once while running playbook against a group of hosts (multiple managed hosts)

Is it possible in ansible to make local_action task being run ONLY once while running playbook against a group of hosts? Here is the problem: hosts: - macbooks - localhost tasks: #...<...
1
vote
1answer
703 views

Does ansible gather facts about local host OS (not a remote one)

I am writing the role which includes some tasks to be executed on local machine using dedicate_to: localhost statements. When gathering facts, ansible registers some variables about the remote host (...
0
votes
0answers
49 views

Ansible picking wrong variable configuration when host belongs to several host groups

I have a server infra which belongs to two different host groups. For each host group, I have settings in group_vars/<host-group>.yml: # in group_vars/develop.yml user_name: "develop" ... And: ...
0
votes
3answers
943 views

No package matching 'docker-ce' is available with ansible

On ubuntu 18.04 I am running this ansible (version 2.5.1) role: --- - name: Add Docker apt repository key. apt_key: url: "https://download.docker.com/linux/ubuntu/gpg" state: present - ...
0
votes
1answer
104 views

ansible: why it looks for vultr.ini file?

I have created the following playbook to create a vultr machine. I'm using the vultr module of ansible and have put all the necessary parameters; --- # Ansible Blocks - hosts: 127.0.0.1 # ...
1
vote
2answers
2k views

Managing FreeBSD host with Ansible fails: Shared object \“libdl.so.1\” not found, required by \“python\”\r\n

Management of FreeBSD on Raspberry pi 3 (FreeBSD-aarch64-12.0-GENERIC-320146M from RaspBSD project - http://www.raspbsd.org/) fails. Control host is MacOS 10.13.2. python is successfully installed ...
0
votes
0answers
22 views

Configuration and automation management on WIndows IoT ARM processor (Puppet, Ansible,… )

I have a couple of Windows IoT board to configure and I would like to use a configuration manager such as Puppet or Ansible. It is using an ARM processor and for now all the configuration agents I ...
0
votes
1answer
143 views

Ansible Playbook Permission

I have one host abc.com where I have downloaded playbooks from GitHub. There are multiple users which can connect to abc.com but I want to restrict the playbook execution for specific user X. So that ...
1
vote
1answer
184 views

Ansible inventory hierarchy

I want make an inventory file for Ansible as sorting-independent. There is an example below for this file: [houston:children] hst-lin hst-win [hst-lin:children] hst-lin-prod hst-lin-test [hst-win:...
0
votes
1answer
177 views

Is There An Ansible Task To Create Services

Ansible has a task to ensure services (systemd in this case) are started or stopped etc. However, is there a task to create the service? Right now I am copying a template to the correct directory ...
0
votes
1answer
177 views

Python not available in Ubuntu xenial?

I have just provisioned a Xenial machine with vagrant (based on xenial64-20180228.1.0-virtualbox.box). In my host system I have python: » lsb_release -a No LSB modules are available. Distributor ID: ...
0
votes
1answer
249 views

How to configure custom ceph OSD options in ceph-ansible?

Currently I'm deploying a ceph cluster on a few ARM-based machines, namely the HC2 from ODROID equipped with 4 TB WD Red Drives. I also found an article from WD labs, doing the same task at large ...
1
vote
1answer
124 views

Ansible installed on Mac with success message but not found

I have been trying to install ansible from long time. It is giving success message when use below command. Anupams-MacBook-Pro-2:bin anupamsri$ sudo pip install ansible The directory /Users/...
0
votes
0answers
156 views

Setup a Static IP Addressed Linux network oin Parallels

Our requirement is to have static IPS in our parallel machines for us not to change our SSH hosts for in Ansible. In the Parallels, virtual machine settings are done for Linux. I am using a Host-Only ...
3
votes
1answer
202 views

overriding options in the ansible config

In my previous question, I discovered that I can put options into a local ansible.cfg file. But can I override them? I have an ansible.cfg file that contains [defaults] vault_password_file = /home/...
0
votes
1answer
148 views

Combine ansible-vault with prompted variables?

The problem I have right now is that, to use ansible-vault encrypted strings, I need to specify on the command line --vault-id=foo@prompt . I don't use encrypted strings very often, so I'd rather ...
0
votes
1answer
135 views

How to apply a variable to a host group when the groups overlap

I'm trying to set up a (hopefully) simple Ansible script to check out a git branch. There are three environments: dev, qa, and live. Each spans two hosts. But dev and qa use the same hosts, just ...
1
vote
1answer
152 views

Ansible error: Unable to add user to already existing group

I am unable to add user to an already existing group. After executing, on verifying from /etc/groups I can see that user is not added. I am new to Ansible. Could anyone help? This is the script I am ...
1
vote
1answer
2k views

How to better secure vagrant virtual machines and delete vagrant user

I am trying to use vagrant as a way of provisioning virtual machines (setting IP addresses, resources, etc) but I am also trying to decouple vagrant's dependency on ansible i.e. I just want to use ...
2
votes
2answers
3k views

Install Ansible in Windows, using Git-bash

I am trying to install the Ansible open source automation platform on Windows. There are many guides out there for how to install Ansible using Cygwin (eg. 1, 2). However, I already have Git-Bash ...
0
votes
1answer
117 views

Ansible playbook to deploy to new server and remove from others

I'm toying with the idea of having a playbook that runs a certain task when a server is in a group and another task when it is not in a group. Say I have office1 with all servers and I have a primary ...
2
votes
0answers
249 views

Using templates/jinja2 filter in Ansible playbook to conditionally execute certain

I am creating a playbook for network device orchestration. I need to execute certain commands depending on the boolean vars input i receive. Is it it possible to use the boolean input to populate ...
1
vote
2answers
2k views

Ansible not working with sudo

I am trying to use ansible, but I seem to not be able to get it to work with sudo. I have minimised the problem to this: This does not work: ansible localhost --ask-become-pass -m shell -a "cat /...
0
votes
1answer
107 views

Can I change the Ansible target in-flight?

I run KVM virtual machines on bare metal hosts. To spin up new VMs, I would: virt-clone a template virt-sysprep the clone to make some basic changes Start the cloned VM Use Ansible for further ...
0
votes
2answers
112 views

Can people automate Windows apps installation?

I understand a Linux application installation can be automated through a script, but I am not so sure if this is true in Windows world. Here I have specific scenario. I want to install Word onto a ...