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

No output observed on k8s_facts module

Team, I have no errors with my playbook but I see no output stored. any hint? Am getting "VARIABLE IS NOT DEFINED!" may be due to no value in it. - name: "Get a list of all pods from any namespace" k8s_facts: kind: Pod …
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
3 answers

Ansible privilege escalation --become

Once upon a time (I think before version 1.9) we could use -s for sudo on command line. Now it does not work. I am using version 2.85 on Ubuntu 18.04. $ ansible all -m apt -a “name=httpd state=latest” - this should give error lack of privilege, but…
Sam-T
  • 1,877
  • 6
  • 23
  • 51
0
votes
1 answer

failed to install dnspython with ansible playbook

Team, I have my playbook as below and i tried with become: yes as well but no luck. how to get around this ? - easy_install: name: dnspython state: present #become: yes - name: Validate DNS record lookup for…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

being prompted for ssh-password by ansible in easy_install

Team, I need to use dig module which my macbook complains dnspython needed. so am installing it with easy_install but am getting prompted for password. How to make it passwordless? - easy_install: name: dnspython state:…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

failed_when with msg in ansible

I am trying to validate the result of a lookup done via dig, but I am receiving a error. Could someone help me? - name: Simple A record (IPV4 address) lookup for {{ kubeapi_server }} debug: msg="{{ lookup('dig', '{{ kubeapi_server }}' )}}" -…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
0 answers

unable to fetch a binary path with ansible shell module

Team, Works locally on my laptop manually but fails only when calling via ansible. Is ansible looking at it in different shell? I have ansible controller as MAC book. I am trying to store the path of a binary in register variable but shell command…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
0 answers

Async and sleep issue in Ansible

I want to perform an async task through ansible, below is the syntax which I am using - name: Create Virtual Machines ansi_generate: verb: 'generate_vm' type: 'generate' body: "{{ create_vm_inputs }}" async: "{{ env.asyncRunTime}}" …
0
votes
1 answer

How to fetch nested variable in ansible template?

How do I get the variable which is nested as below: mongoservers: - mongo_master: dev_01 label: mongomaster dev01 urls: - mongomaster01.dev.local.net - mongomaster02.dev.local.net - mongo_master: dev_02 label: mongomaster dev02 …
shrish
  • 408
  • 2
  • 8
  • 22
0
votes
1 answer

How can I specify different ansible_password for each host in my playbook?

In inventory file(.ini) we can do this by using : app-server-1 ansible_host="123.45.67.8" ansible_user=abcd ansible_password=mypwd but since I want to encrypt the password using ansible vault, I need to put it in a .yml file. A sample example…
0
votes
0 answers

Getting error while deploying .ova file for VMware Network Insight

I am trying to deploy one of the VMware Operation manager tool using ovftool. I'm facing these error lines: Line 55: Duplicate element 'InstanceID'. Line 93: Duplicate element 'InstanceID'. Errors found while parsing OVF descriptor Completed with…
shail
  • 31
  • 1
  • 4
0
votes
1 answer

Ansible - accessing dict of dict of dicts

I have an external data file with the following data structure: --- server1: service_name: jboss_prod_1: enabled: "True" started: "True" jboss_prod_2: enabled: "True" started: "True" jboss_prod_3: enabled:…
0
votes
1 answer

Send a POST if the variable does not exist with the GET

I am trying with ansible to make 2 calls api. The first one is a GET which have to return a json response and match (or not) with a variable. The second one is a POST only if the GET match the variable. - name: check if hostname exist uri: …
hades11
  • 3
  • 1
0
votes
1 answer

How to release an AWS elastic IP with ansible?

I am following the ansible documentation here: https://docs.ansible.com/ansible/latest/modules/ec2_eip_module.html in order to provision an ec2 instance with a new elastic IP. The parameter release_on_disassociation is set to yes but after the…
Rene B.
  • 6,557
  • 7
  • 46
  • 72
0
votes
1 answer

How to set ansible_async_dir in ansbile 2.5?

The default async directory is '~/.ansible_async' in ansible 2.5. I want to change the directory by setting ansible_async_dir like this: - name: this is an async task shell: date async: 30 poll: 0 vars: ansible_async_dir:…
flyingfish
  • 165
  • 1
  • 5
  • 13
0
votes
1 answer

Ansible TypeError: must be string or buffer, not list

Below task is failing with must be string or buffer, not list and when I use the same loop over shell and the output prints string, so not sure where it is going wrong. I have used loop also, it is also giving same output - name: Provide Ambari…
venkata
  • 447
  • 3
  • 15