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

preceding environment variable setting in ansible-playbook command

Need help in understanding what these preceding key value pairs in ansible-playbook command are? What are ABCD_ISACTIVATED_CHECK and ABCD_PYTHON_INTERPRETER in the example below? Is there any other way to set it? ABCD_ISACTIVATED_CHECK=false…
kk.
  • 667
  • 1
  • 15
  • 33
0
votes
0 answers

how to use extends_documentation_fragment. getting error while using it

I am writing my own ansible modules which shares the same document across multiple modules which I need to develop. As per the ansible website https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_documenting.html we can use…
Alok Ranjan
  • 158
  • 10
0
votes
1 answer

Why does Ansible return a differently formatted ifconfig output?

The following Ansible ad-hoc command runs ifconfig on the host machine: ansible all -i "192.168.3.5," -m shell -a "ifconfig" -u root (notice the MAC 00:aa:bb:cc:dd:11 in the following output is lowercase) 192.168.3.5 | CHANGED | rc=0 >> eth0:…
0
votes
0 answers

Fetching ansible inventory based on a filter

I want to the fetch the ansible inventory list from an api which accepts a filter parameter. I am wondering if there is any way I can pass this filter parameter to either dynamic inventory or write custom inventory plugin from my playbook? Ideally,…
RKM
  • 67
  • 1
  • 5
0
votes
1 answer

Getting : error while evaluating conditional (my_result.stat.exists): 'bool object' has no attribute 'stat' while expcting to be dictionary

i have this ansible simple playbook : where "/home/ec2-user/test1.txt" exists on disk --- - name: check if exsist hosts: localhost gather_facts: false tasks: - name: Get project name shell: "echo 'hhhhhhhh'" register:…
user63898
  • 29,839
  • 85
  • 272
  • 514
0
votes
2 answers

delete pods returned in stdout in ansible loop

Team, I am trying to loop over the pods from all hosts returned and delete them. but am getting error. not sure if my loop is right? am pulling pods with kubectl on node. output: ok: [node0117d] => { 00:11:05 "kos_pod": { 00:11:05 …
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

syntax error in shell command over ansible

Team, my task is below and am just trying to pull a pod with a pattern match upto 5chars but am getting error in ansible output. - name: "fetch csi pod on node" #command: "kubectl get pods -n csi-vdiskplugin --no-headers --field-selector…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

ansible debug msg throws error inside handler

Playbook runs fine but debug msg module throws undefined variable error. --- - hosts: labservers become: yes tasks: - name: restart httpd service: name: httpd state: restarted notify: - cmds handlers: - name: change file…
evanooruvan
  • 25
  • 1
  • 6
0
votes
2 answers

Run a command with different args everytime in Ansible playbook

I am trying to run a command in Ansible so as to find the neighbors in my network: - name: Get neighbors junos_rpc: rpc: "get-lldp-interface-neighbors" output: 'xml' args: interface_device: A register: net_topology So my…
Xenia Ioannidou
  • 67
  • 1
  • 1
  • 8
0
votes
1 answer

run yz tasks only if x task condition is met in ansible

Team, I have 10 tasks and I want to run 2-10 only if condition in task1 is met. - name: 1Check if the node needs to be processed stat: /tmp/fscache-cleaned-up1.log register: dc_status - name: 2Check if the node needs to be processed stat:…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
0
votes
1 answer

Ansible unable to access group_vars

I am not able to access my group_vars. My current directory where i have my inventory file [ansible@akashd1c inventory]$ pwd /home/ansible/inventory created group_vars directory in inventory [ansible@akashd1c inventory]$ ls group_vars …
0
votes
1 answer

mysql_db - remove all databases

I wanted to remove multiple databases by setting 'name' to all, and with 'when' condition regarding specific name. Unfortunately after this failed I checked in documentation: name=all May only be provided if state is dump or import. Is there a…
Frederigo
  • 226
  • 1
  • 4
  • 13
0
votes
0 answers

Use ansible to configure management ip of inventory device

I'm trying to apply a new configuration to some devices. This new config will also update the management ip of the devices, the same management ip that ansible used to connect to the device. Will the connection break immediately after ansible has…
Mo Fatty
  • 317
  • 2
  • 8
0
votes
1 answer

Conditional Delegation to a host for synchronize module

I am a newbie to Ansible and trying to figure out how to synchronize between 3 hosts based on condition. Below are details: There are 3 nodes and based on which node is primary (I was able to get a custom fact set for it) need to delegate to that…
0
votes
1 answer

Ansible error using `win_copy`: "Unexpected failure during module execution"

I upgraded to Python 3.5 and Ansible deployment started failing, not sure if they are related, but here is the info: Ansible version: 2.3.2 yaml file: - name: Collect compiled DLLs for publishing win_copy: src: '{{ download_dir…
Jee Mok
  • 6,157
  • 8
  • 47
  • 80