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

ansible iterate on results from multiple hosts to pull specific key value

Team, I am looping over all hosts in specific inventory group to check the key-value responses from the output of stat on a file but am failing to map it. can anyone hint please how to map it? - debug: var: result - debug: …
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
2 answers

ansible command module result code is non zero for a success response

Team, unable to catch what is the issue and i have tried command as well as shell module. actual command executes fine but am not sure why it says stderr? task - name: "List out PROC Stats on DGX/GPU Nodes Nodes" shell: "cat {{…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

ansible multiple with_items and loop on all hosts in inventory group

Team, I have a situation where I need to execute multiple commands on multiple hosts. for singular host case am fine with below but how to iterate the same over multiple hosts? - name: "SMI Tests for ECC singlebit and double bit codes " …
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

ansible use of wild card in with_items and loop

Team, Using single full defined string in with_item I have my task running fine. However, at scale i would like to loop with string inside with_items changing. any hints? - name: "Fetch all CPU nodes from clusters using K8s…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

Ansbile Cron Support for CRON_TZ

I can't seem to find support for the CRON_TZ settings for crontab. How would I configure ansible to run a cron job for a specific timezone? This is what I want my crontab file to look like. This cron config is currently running on a CentOS 7…
Hugh
  • 83
  • 1
  • 11
0
votes
1 answer

ansible lookup dig: list object has no attribute

Team, am unable to understand or resolve this error. My task is pulling server name from a variable and performing dns lookup using dig module. any hint? Exact same task works locally ubuntu desktop but when i run this via jenkins/container/ubuntu…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

Ansible How to loop inside the files for templates

Need to loop through the source files one by one for all hosts. - hosts: epson* become: yes tasks: - name: replace id vars: id: abc template: src: epson1.j2 dest: /home/epson.config HOSTS…
suraj shetty
  • 136
  • 1
  • 6
0
votes
1 answer

What does this ansible-vault format mean?

I am reverse-engineering and refactoring ansible code from a developer who has since left the company. In our ansible-vault file, I would love to know what the following items mean and how they add function/value to the yaml--I can't find any…
RobWieters
  • 43
  • 4
0
votes
1 answer

format stdout output in ansible for shell cat command on fscache stats

Team, I have below output from my task. how can i print it nicely as it shows when i directly get it from linux terminal. My task is below that runs ssh command on all hosts and lists output for each host separately but i want to pretty print it…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

ansible variable reference : unable to read stdout_lines from register variable after ssh and command

Team, My task is running she’ll commands on hosts that are pulled from registered variable. Currently two hosts but there will be 100 in production. am unable to read out stdout or stdout_lines. my task and output is below. Its sshing to the remove…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

How do variables defined in the condition are used as global variables?

I want to take out the ip value of all servers that match the when condition. My ansible-playbook is as follows: - name: Get all the servers with docker installed shell: docker -v failed_when: False register: docker_exists - name: Get the…
cydia
  • 103
  • 12
0
votes
1 answer

run task on node and restart deamon from different node if task failed Ansible

One of the task is to run a curl command on node[A,B,C] and failed it if a speficic string isn't present. If failed, I want to rescue by running an application restart on app[A,B,C]. nodeA ==> appA . nodeB ==> appB . nodeC ==>…
ChefCurry
  • 1
  • 1
0
votes
0 answers

Ansible playbook, retry mechanism

I am running the ansible playbook usually after creation of machines using Terraform, sometimes when ansible try to connecting new machine that creates at the same time and machine is not available yet, the ansible flow failed , in addition ansible…
EyalChn
  • 81
  • 1
  • 10
0
votes
2 answers

ansible ssh to json_query response values in loop

Team, I have response from json_query which is a dict key:value and i would like to iterate over all values and run ssh command for each value Below gets me list of all nodes - name: "Fetch all nodes from clusters using K8s facts" k8s_facts: …
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

Unable to search string in json_query ansible module

Team, I have output and am trying to fail/pass based on existence of a string in the json response that am getting. any hint? - name: "Fetch all gpu/dgx nodes from clusters using K8s facts" k8s_facts: kubeconfig: $WORKSPACE …
AhmFM
  • 1,552
  • 3
  • 23
  • 53