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

Change parameters in command lines with item

We need to create a standard ansible that will change only one parameter for specific commands in a specific table ex: cmd: Sys; Cl; Codes; DPlan; Entry; get 1 PLO from {{ item.a }}; y cmd: Sys; Cl; Codes; DPlan; Entry; get 1 PLO {{ item.b }} 12L;…
0
votes
2 answers

Unable to connect to Ansible via SSH

I create a host file with the below content [web] 167.172.xxx.xxx I have a user root and dojo360 on the web server and the public key has also been added to authorized_keys file. When I run the command ansible web -m ping -i hosts I get the below…
George
  • 3,757
  • 9
  • 51
  • 86
0
votes
2 answers

How to build Ansible Playbook without username/password

I am new to Ansible and started learning and working on Ansible Playboks especially on network automation. Part of our hosting infra, inorder to login to any device we have default script runs to ssh into the device, something like goto . Hence no…
0
votes
0 answers

Ansible - build error OSError: [Errno 13] Permission denied: '~'

i am running Ansible and Jenkin with docker where i have a webapp.war in /opt/docker/webapp.war and i have a Dockerfile --- - hosts: all become: true tasks: - name: create docker image using war file command: docker build -t…
foy
  • 387
  • 4
  • 15
0
votes
1 answer

Why profile does not get loaded properly?

I have run a playbook with the following content on host: --- - name: Test hosts: debian vars_files: - "./secret.vault.yaml" tasks: # Roles, modules, and any variables - name: Install aptitude using apt apt: name=aptitude…
softshipper
  • 32,463
  • 51
  • 192
  • 400
0
votes
1 answer

How to execute Play 2 only if Play 1 succeeds in Ansible

I have two Plays having one task each. The first Play checks if the /var/test.dat exists on each target. Only if the first play is successful do I want the second play to run which executes these scripts in parallel. If the first play fails i.e the…
Ashar
  • 2,942
  • 10
  • 58
  • 122
0
votes
0 answers

ansible - how to print skipped tasks' names when --check

when I run playbook with --check option I see names only for "ok" or "changed" tasks (trying with ansible 2.5 - 2.9) TASK [playbook : taskN] ************************************************************************************************ ok:…
Dmitry Perfilyev
  • 536
  • 1
  • 4
  • 14
0
votes
1 answer

YAML List Filtering

Could someone please assist me on the below: Either ok: [localhost] => { "tag_info": { "changed": false, "msg": "All items completed", "results": [ {"vm_list": [ "NSY6TFSANSBL01"]}, ] OR ok:…
0
votes
1 answer

Add Conditionals to Ansible Role for Idempotent Tasks Runs

I've been searching for quite some time and tried many variants and similar answers without success. Hopefully this is something simple I am missing. Ansible 2.9.6 I am creating many playbooks that all share a large set of custom Roles for my…
eduncan911
  • 17,165
  • 13
  • 68
  • 104
0
votes
0 answers

Ansible default value not reached when using variable concatenation

my_var: "{{ url_var+'/' | default(default_url_var) }}" I have the above code but when I run it, it errors out when url_var is not set saying 'url_var' is undefined. I want the default value to be taken if url_var is not defined. I believe whats…
0
votes
1 answer

Ho do you change directory and run a command in ansible?

Hi I am struggling to understand why this code is saying that the directory does not exist on the system I see root@Production:~# ls -l /home/azureuser/directory-with-stuff/ and can see that the path exists however, in my ansible code, the stat…
user3700919
  • 325
  • 2
  • 4
  • 19
0
votes
1 answer

ansible lvol module: volume not found

I'am feeling little bit idiot, I'am trying to delete vg and lvm from one serveur but I have message "stdout": "Volume group vgdocker does not exist.", "stdout_lines": ["Volume group vgdocker does not exist."]} Please find below all info: script: -…
rab
  • 133
  • 2
  • 13
0
votes
1 answer

skip multiple values for loop which is passing to a task ansible

how can I filter out unwanted values from loop which are passed from register output (from previous task) code # assume the list_one below register values. list_one = [root, a, b, c] - name: with_together debug: msg: "{{ item.0 }} - {{ item.1…
0
votes
2 answers

Loop over debian files in a directory and install sequentially using ansible

I am having around 250 Debian files in a directory /home/emgda/del/ which periodically changes and must be installed by everyday end. So I am trying to write an Ansible script to loop this directory, hold file names in an array then install all…
Ankur Soni
  • 5,725
  • 5
  • 50
  • 81
0
votes
1 answer

tagging releases in ansible and repo name

I was using semantic-tag before for tagging my releases but now I have a requirements that every release will have a name and number attach to it like rel-1.0.1, rel-1.0.2 ... So if I get that right I cannot use this library anymore because I need…
Learner
  • 1,686
  • 4
  • 19
  • 38