Questions tagged [ansible-2.x]

Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems

Ansible 2.x is a new backwards-incompatible version that involved a rewrite of the core, and a new API.

Ansible 2.x features new commands like ansible-vault, allowing you to store encrypted information in playbooks and have them decrypted on the fly. It also includes new concepts like Task Blocks, Dynamic Includes, Execution Strategy Plugins, and a suite of new "batteries included" modules. Most importantly, new releases are named after Led Zepplin songs, rather than Van Halen.

https://raw.githubusercontent.com/ansible/ansible/stable-2.0/CHANGELOG.md

Related Tags

1908 questions
0
votes
1 answer

Join results in debug output from multiple hosts- ansible

I am trying to input a list of hosts, then the code will check which systems have space more than 1 GB in /, and less than 1GB and display the output. The output I am getting is host wise like this:- Current Output:- ok: [hostname1.com] => { …
rocknrollaki
  • 75
  • 1
  • 4
  • 11
0
votes
1 answer

Copy rsa tokens to remote hosts within a group

I am trying to create rsa and copy to other remote machines so that test[0] is able to ssh into test[1] and test[2] My inventory file [ test ] 10.100.0.1 10.100.0.2 10.100.0.3 I want to create a rsa token on 10.100.0.1 as root user and copy the…
user6826691
  • 1,813
  • 9
  • 37
  • 74
0
votes
1 answer

Running playbook returns: Failed to connect to the host via ssh, solved by running ping all

I have an ansible playbook and I run it: sudo ansible-playbook -i hosts startelk.yml -vvv Every time, after I change the hosts file, running the same playbook results in "Failed to connect to the host via ssh". If I run ansible all -m ping first…
Amela
  • 23
  • 5
0
votes
1 answer

Subprocess.check_output enters hung state

Although the yaml is executed and execution is finised , still python code don't terminate. subprocess.check_output("nohup ansible-playbook ansible_final.yml -u ec2-user &",shell=True)
Abhishek kumar
  • 103
  • 1
  • 7
0
votes
1 answer

set_fact create a list with items

I have task which calls an API and I register the o/p in a varaible; - name: Get Object storage account ID uri: url:…
codec
  • 7,978
  • 26
  • 71
  • 127
0
votes
1 answer

How to invoke encrypted password inside ansible playbook?

How can I encrypt the password in Ansible for executing windows playbook? Kerberos authentication in enabled When playbook is edited others shouldn`t see encrypted password
Sushena
  • 107
  • 3
  • 8
0
votes
1 answer

Distributing different SSH keys to different hosts in one inventory

I have an inventory which contains several hosts. I want to distribute the public part of the SSH keys via Ansible. Each host gets an own key. So far I found the module authorized_keys which can do the general job. However I was not able to figure…
qbi
  • 2,104
  • 1
  • 23
  • 35
0
votes
1 answer

How to pass a groups hosts in ansible?

I am working on a ansible role to automate the installation of vertica. The role is running on a 3 node cluster . I am stuck in 2 places. I am trying to run the below command, I want to pass the hosts from my inventory of a group, I have passed…
user_01_02
  • 711
  • 2
  • 15
  • 31
0
votes
1 answer

The "right way" to check a variable against a list in Ansible

The Ansible playbook code below works, but it relies on a shell out to egrep. I would like to know the "right way" to do this (using Ansible modules, Jinja2 filters, etc., but no external binaries) for my own personal growth. I tried several…
Beam Davis
  • 143
  • 1
  • 7
0
votes
2 answers

define the default value of an ansible list as a dictionary

I'm using the code shown in the attached picture: Code used for my loop I need that each iteration starts the count from 0, and not from 1. I mean specifically the following line: tmp_list: "{{ tmp_list | default([]) +…
eyh
  • 1
  • 4
0
votes
2 answers

Ansible - Delegate single task to a group of hosts where the inventory groupname contains a variable

I have an ansible task which runs on server1 (server is in group "yst-ad-server"). It should take the hosts IP address from hostvars and set it on server2 as DNS address. Server2 is in the group "yst-terminal-server". The part yst is dynamic, so it…
k304
  • 119
  • 2
  • 11
0
votes
0 answers

Azure virtual machine inventory using ansible for multiple groups

I wrote the ansible playbook to build the servers in azure. However, after the servers are built , i couldn't able to write host private IP to inventory file. For instance, if two servers were created using ansible.Each of them will be having…
learning fun
  • 519
  • 1
  • 5
  • 12
0
votes
1 answer

How to specify multiple values to ansible_host magic variable

I have a question on how do we give multiple values to "ansible_host" magic variable. I have my hosts.yml like below: all: hosts: ansible: host: children: applications: children: java_applications: …
0
votes
0 answers

Unable to run command using Sudo in Ansible

I’m running an Ansible job wherein I’m switching the user to a Service Account to run a certain command. I am able to switch the user and confirm the same using the become method and then a raw: whoami. When in the same scenario post the become…
0
votes
1 answer

Ansible mapping value issue when usnig echo module

I am learning ansible and i am suing shell command to add parameter in LDAP config file. echo -e "dn: cn=default, ou=policy, dc=com, dc=com \n changetype: modify \n replace: pwdMaxAge \n pwdMaxAge: 0\n" > /tmp/age.txt But ansible throws the error…
learning fun
  • 519
  • 1
  • 5
  • 12
1 2 3
99
100