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

How to override child element of default paramter in ansible?

I have following parameter set in role/downloader/defaults/main.yml download: location: "/tmp/download" file: "EXAMPLE.tar.gz" url: "http:///repo//" file_permission: '755' checksum: md5:e207d015e0a435193afbc82e15bba19c …
Vishnu
  • 97
  • 1
  • 13
0
votes
1 answer

Line not updating in a file using win_lineinfile

I'm trying to update an appsettings.json file on each one of my nodes. When I run my playbook, I'm getting a changed state for all my nodes but when I check the node I don't see any changes to the line. I'm also trying to update the string with the…
TravelingLex
  • 399
  • 1
  • 3
  • 16
0
votes
1 answer

Unable to add single quotes between single quotes in ansible

Below is my playbook: - set_fact: excludefolders: "{{ excludefolders + ' -o -name ' + item | default('') }}" with_items: "{{ lookup('vars', 'MY_' + Layer).split(',') }}" - debug: msg: "exfolderr is {{ excludefolders }}" I…
Ashar
  • 2,942
  • 10
  • 58
  • 122
0
votes
0 answers

Ansible ios playbook to gather IOS runinng config of diferents hosts to files

I'm looking to create a playbook on ansible to gather info of more than 300 hosts and save the info to a file. I get 2 diffente issues, one not being able to save the info to a file and the second issue comes because of telnet connection of some…
0
votes
1 answer

ansible create local directory (master)

I forgot how to create on localhost ( ansible svr ) directory. I'am using my ansible server as cache to download file and to copy them after that to the remote hosts. Here example of task and playbook tasks - name: Create temp folder file: …
rab
  • 133
  • 2
  • 13
0
votes
1 answer

Implement openssl standard commands (e.g. pkcs12) in Ansible 2.4

I need to implement openssl command pkcs12 in Ansible 2.4 The latest Ansible version provides a module called openssl_pkcs12, but how to implement this in Ansible 2.4? So far, I have tried to put this command in the action of openssl_certificate…
mythr
  • 80
  • 1
  • 10
0
votes
1 answer

Jenkis pipeline with extra credentials for ansible

I have problem with conditions in ansible. Here is my code sample: // some code that generates result with lines when: result.stdout_lines | length > 0 block: - name: generates json // some magic register: jsonFile - name:…
UNIm95
  • 242
  • 4
  • 14
0
votes
4 answers

Ansible force to use --limit and --tags when run playbook

I am using ansible 2.9.4. My goal is to deny run some playbook on all nodes by accident or without tags. This is my app.yaml: - hosts: all remote_user: root vars: server_domain: mydomain.com project_name: project tasks: …
dorinand
  • 1,397
  • 1
  • 24
  • 49
0
votes
1 answer

how to use ansible to execute shell script against gce instances

how to use ansible to execute shell script against gce instances. I have a service account and it has compute admin permission. How to write ansible playbook so that i can execute shell scripts against all vm in my gcp project. Below links don't…
Gabriel Wu
  • 1,938
  • 18
  • 30
0
votes
1 answer

Ansible map filter from a registered var output

I'm getting with ansible through a registered variable a full copy of the dhcpd.leases file from one server. The output with ansible debug looks like this: TASK [Show passive storage nodes info]…
Bogdan Stoica
  • 4,349
  • 2
  • 23
  • 38
0
votes
1 answer

responsse module no path loaded

EDIT: I'am using the same user and the deamon is running, I can do all my docker command on the target without any issue. Trying to use reponsse module without success. I think the issue is comming from PATH what's not be loaded so cannot found…
rab
  • 133
  • 2
  • 13
0
votes
1 answer

sed syntax does not work with Ansible shell module

I wish to check if my text Options exists between opening and closing LocationMatch tags. Below sed command gives me the desired result. $ sed -n '/^/,/^<\/LocationMatch/p' httpd.conf | grep -i 'Options ' Options…
Ashar
  • 2,942
  • 10
  • 58
  • 122
0
votes
2 answers

Ansible : appending data of file using template module

Is there a way to append data using a template module in ansible. There are options for lineinfile and blockinfile in ansible. But I have to append data to the host's file. I want to preserve original hosts and add new hosts to the existing file.
Chaitali
  • 87
  • 13
0
votes
1 answer

blockinfile Ansible module does not insert at the given regex

Below is the test.conf where i wish to add a block before the line closing tags i.e. before the line which starts with cat test.conf # ## #ProxyPreserveHost On Below is my…
Ashar
  • 2,942
  • 10
  • 58
  • 122
0
votes
1 answer

Filter output with ansible

So I'm connecting with ansible to an interconnect device running PicOS8. I'm issuing a command which has the following…
Bogdan Stoica
  • 4,349
  • 2
  • 23
  • 38