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

how to handle fail and pass in ansible message with WHEN

Team, I have a task that is checking for mounts. I have fail condition working but i also need to report for pass condition when mounts are present.. what am i doing wrong? shell: "mount | grep sdd" register: lvp_mount …
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
3 answers

Unable to ping server using ansible

I'm unable to ping the another server. And i have SSH communication also authenticated. Please find the below error ansible all -m ping -u ubuntu -i inventory WARNING]: Unhandled error in Python interpreter discovery for host 10.0.3.128: No JSON…
0
votes
1 answer

ansible syntax error to set tag in playbook under roles

Team, I tried several combinations nothing worked. how to set tag under role in playbook? roles: - 3_validations_on_ssh tags: [test] - 3_validations_on_ssh tags: test output: The offending line appears to be: -…
user10724620
0
votes
1 answer

Ansible condition to run specific tasks in a playbook only if host belongs to specific group in inventory file

I created a playbook with 6 different tasks and want to run tasks 1,2,3 only when host is a child of was855node group (e.g. b, c) and tasks 4,5 to run only when hosts is child of was855dmgr group (e.g. a) My inventory…
0
votes
1 answer

Ansible | Replacing finished hosts in the current batch with hosts from next batch

I implemented a playbook to iterate over 10 hosts. From those 10 hosts, host_2 and host_8 are slow. I used for this setup a batch size of 2. My expected outcome is when the playbook will start with host_1 and host_2 as soon as it finish with host_1…
raeX
  • 3,197
  • 2
  • 14
  • 21
0
votes
1 answer

How do I use Ansible loop register values?

I am trying to grep the process IDs for a process on multiple target hosts and trying to kill that process. What I have so far is this - name: Grep any running process shell: ps aux | grep "[m]ongo*" | awk '{ print $2 }' register:…
RPT
  • 728
  • 1
  • 10
  • 29
0
votes
2 answers

Ansible, pg_hba.conf configuration with IPs from hosts file

I have problem and i don't did i even start correctly. i have hosts file that looks like all: children: application1: children: application1-webserver: hosts: host1.domain.net: host2.domain.net: …
0
votes
1 answer

can't use the ansible extra vars values in playbook task

When running the ansible playbook, i am providing the extra vars especially for modules variable where i am passing multiple values. ansible-playbook abc.yml --extra-vars "status=enable modules='redis apache zookeeper'" I want to run the below…
learning fun
  • 519
  • 1
  • 5
  • 12
0
votes
2 answers

Append file(s) to a file without redirection (">>") in Bash

I have a remote file (two actually) that I wish to concat to another remote file. I want to use the command module in Ansible rather than the shell module. Therefore I can't use >> (or | or && etc). Question is twofold: is there a module (or…
SeamusJ
  • 401
  • 5
  • 10
0
votes
1 answer

Ansibl-vault: password from terminal

How can I pass the password of ansible-vault stored in an environment variable to the command ansible-playbook play.yml -i hosts --ask-vault-pass I can't pass a file or have an interactive shell to enter the password since the commands are run from…
RPT
  • 728
  • 1
  • 10
  • 29
0
votes
1 answer

Ansible jinja2 template with linux command

I am learning ansible. i have written a jinja2 template for looping over a multiple values. However, i get those values from a linux command. - name: fetching port ranges command: ls /apache |grep redis|grep ".pid" | awk -F"_" '{ print $2}'|…
0
votes
1 answer

ansible loop on register variable indice results

Team, I have a task in my role that runs a command on all the hosts in a group. Now for every hosts i need to do a failed_when output does not contain a specific string. How can i achieve this from task in role for all hosts because. below am only…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

Ansible mount module to just check state and not report status

Team, I am writing a validation task that is supposed to just check if a mount exists or not and report its state from output. so my task is below but it fails and am not sure how to handle it. any hint what adjustments do i need to make? -…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
0 answers

Ansible nested loop to run checksum on all hosts in inventory group

Team, I have below task that runs on local host. But I need to run it on all hosts under a group defined in inventory for which I need to do delegate_to and with_items. Any hint how can run this task on all hosts?       - name: verify if kernel…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

Ansible - include one playbook into another in loop

I am new to ansible and trying to figure out how can I call one playbook from another playbook in loop. I also want to consume the output back in master playbook. Not sure if it could be possible in Ansible. Below is a stub from other programming…
sunder
  • 1,803
  • 4
  • 29
  • 50