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

How do I get my ansible playbook to gather the desired AWS EC2 information and wrap properly in a text output file?

I have an ansible playbook pretty much written out, including output to a file. I have the few fields that I want to gather from my EC2 environment (simply tag:Name; Public IP, Private IP). I'm having two small issues that I cannot seem to figure…
Cochise
  • 1
  • 4
0
votes
1 answer

Ansible unable fail a task based on string search on stdout_lines list

Team, My below task is supposed to failed based on string in output but its not. what am i missing? Validate all nodes have labels should fail. - name: "list node labels" debug: var: nodeType_label_info.stdout_lines …
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

Unable to read ansible shell module output due to quotes

Team, I have below output but i can't read its values.. I cannot use K8s module due to environmental limitations and need to use shell or command module only. any hint how to tackle this? I would like to fetch values like…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

Ansible playbook complains about quotes

I'm using Ubuntu 16 with Ansible 2.2.1.0. I am trying to install docker-compose with the following playbook: - name: Install Docker Compose. shell: "curl -L https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname…
Batchen Regev
  • 685
  • 1
  • 7
  • 28
0
votes
1 answer

ansible loop on group nodes with_items and avoid ssh

Team, I have below task where I want to use the node name in my kubectl command but ansible is doing ssh to those nodes. where as i don't want ssh to happen at all since kubectl command is going to be run locally and not on the host. how to modify…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
2 answers

ansible loop with failed_when on register variable list output

Team, I have below task working fine when i only have one node or only one item but I need to modify it work for all items returned in the list that is stored in register variable. - name: "Fetch all CPU nodes from clusters using K8s…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

Ansible 2.4 when var is defined and contains

I'm currently writing a ansible playbook with several conditions. I have a uri block with a when condition. The when condition checks if the var is defined and contains 0: when: (logs_table_exist.stdout == "0") or ("0" in logs_table_old) Now…
Simon
  • 15
  • 3
0
votes
1 answer

What are the files in the group_vars/all/ directory?

I wonder what is the difference between a file placed under group_vars/ and group_vars/all/ directories? Aren't they serve for the same purpose of storing inventory group files?
l00p
  • 392
  • 2
  • 17
0
votes
1 answer

parse json response using ansible

I need to parse the json response from an API request using ansible and then take action on items returned in the response. Here is part of my ansible playbook - ```- name: Invoke Import API uri: url: "{{ atl_bitbucket_dataset_url…
raj.andy1
  • 121
  • 1
  • 7
0
votes
1 answer

ansible display output for every looped variable

Team, I have my below task that runs on all nodes in a group and i need to display the output for every node that was used in loop. any hint? command: cat "{{ proc_stats }}" register: stats delegate_to: "{{ item }}" …
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

anislble with_items with with_nested in loop inside role task

Team, i need to run a task on all nodes by pulling nodes using with_items then using with_nested I need to perferm check on each of the node pulled in with_item. any hint? I cannot run this from playbook. I have to run it from tasks file inside…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

Problem assigning variable per environment in Ansible

I'm building an AMI with packer and providing it with Ansible. The AMI needs to be build with different variables depending on the environment.Therefore I used the below structure based on this article: ├── ansible.cfg ├──…
hidetoxin
  • 1
  • 1
  • 2
0
votes
0 answers

Ansible group_vars referencing and loading another var file

Based on the following Ansible inventory directory tree: inventories/region ├── staging │ ├── group_vars │ │ ├── all.yml │ │ │ │── hosts.yml │ └── site1 │ ├── group_vars │ │ ├── all.yml │ │ │ ├── hosts.yml │…
Lubos A.
  • 1
  • 2
0
votes
1 answer

Validate registered value for all nodes using shell command

I have below task that search for a string in the mount output for all nodes and am registering it as well. But I want to validate that all nodes did have the string and not just validate the last node as register variable is i believe replaced…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

ansible task failing to search a string in list output from ansible shell result

Team, I have below task but I need to search for sdd in its output which is a list. listing the output and my assert is failing. I just want to print a message sdd found and not found on this task based on result. #Local volume provision sdd check…
AhmFM
  • 1,552
  • 3
  • 23
  • 53