Learncado
Learncado

Learncado brings together a vast collection of questions and answers. Expand your knowledge, learn new skills, and find solutions to your queries effortlessly. Enhance your learning experience and save valuable time by exploring our website today.

Resources

  • Questions
  • Question By Tags

Help and support

  • Contact
  • About

  • Geniecourse
  • Jetsodeals
  • Rentcado
  • Dealcado
© 2021-2023 Learncado All Rights Reserved.

Search Results (141)

Results for ansible

November 27th, 2023
Extract Specific data from json in ansible

I have a big json var, the structure is like this: { "ad_groups": [ { "display_name": "GROUPNAME", "group_members"...

jsonansibleazure-active-directory
Read more
November 23rd, 2023
Difference between using prefix "ansible.builtin" and without

In tutorials I find sometimes: - name: Copy something ansible.builtin.copy: src: "src/foo" dest: "dest/foo" but sometimes: - name: Copy some...

ansible
Read more
November 23rd, 2023
Ansible - Concatenate list of items for command module without surrounding quotes

I'm trying to concatentate an Ansible list into a space seperate string without surrounding quotes within a shell or command module call. The command ...

ansiblelistshell
Read more
November 23rd, 2023
Precedence order in Ansible variable assignments, confused

I have the following playbook: - hosts: localhost vars_files: - vars/common_vars.yml vars: deploy_folder: "win" in my vars/common_vars.yml...

ansible
Read more
November 21st, 2023
Using a variable from a previous play along with patterns in the 'hosts' keyword of an Ansible playbooks

I have this playbook. It will eventually be used to execute SQL on a MySQL database. --- # This playbook sets a bunch facts/variables # including mys...

ansible
Read more
November 18th, 2023
Ansible: How to determine if a specified host is listed in a list of string arrays?

I want to create a vault (1password, not Ansible vaults) for each host in the inventory. - name: Get the vault list ansible.builtin.shell: cmd: ...

ansiblejinja2
Read more
November 24th, 2023
Ansible - using delegate_to run tasks on the same remote machine as a different user

I have a playbook to execute a few tasks on a remote node. The requirement is that I have to execute some of those tasks as one user (say foo-user) an...

ansibleansible-2.x
Read more
November 15th, 2023
Render numbers inside an Ansible yaml template

Very close to Create an int var with Ansible's ternary operator and that answer https://stackoverflow.com/a/69109779/446302 In an Ansible project, I'm...

ansiblejinja2castingansible-template
Read more
November 14th, 2023
Ansible looping through different item within the same task

I want to apply the specific tag or tags for the ec2 instance to the attached EBS volumes. Form the amazon.aws.ec2_instance_info: I get the all inform...

amazon-web-servicesansibleautomation
Read more
November 10th, 2023
Ansible playbook to compare package versions and send alert

I am having 1 node where the multiple (deb) packages are deployed. I want to check the version if correct one is deployed or not, if miss match i have...

ansible
Read more
November 7th, 2023
Why cannot I get a loop to work with a dictionary replacement in Ansible?

I have an Ansible playbook that will be pulling a list of VMs from a Nutanix Prism Central, capture the vm_name and the UUID, parse the short name of ...

ansible
Read more
November 9th, 2023
How do I remove a trailing ' in Ansible from a string?

I am working on an Ansible script that parses a return from the nslookup command. The regex_search pattern returns a trailing '. I have been trying t...

ansible
Read more
November 3rd, 2023
How to fetch record of database table using ansible

The error appears to be in '/home/jasmi/sprint5/us2/zuul-config/scenario/test/testservice.yaml':fatal: [localhost]: FAILED! => {"changed": false, "ms...

ansiblemysql
Read more
October 31st, 2023
Preserve value of a variable in Ansible when looping through 'include_role'

So let's say I have a role in Ansible that takes one input parameter and, at the end of its execution, uses the set_fact module to write the output to...

ansible
Read more
November 1st, 2023
How to pass the json_query value into Ansible playbook parameter?

I have an Ansible playbook (as shown below) which contains 2 tasks: create folders, and copy a file into one of the created folder. - hosts: test2 b...

ansible
Read more
October 26th, 2023
How to overwrite loop var on launching ansible-playbook

I have this playbook to create multiple users with loop - name: creation des users become: yes become_method: sudo become_user: root user: ...

ansibleloopsvariables
Read more
November 14th, 2023
Ansible Playbook lineinfile insertafter is placed at end of file rather than designated destination

I have a task within my playbook where I want to add a new line and then place it after a certain line but after I run it, it adds to the bottom of th...

linuxansiblessh
Read more
October 24th, 2023
ansible.builtin.uri expects a base64 body

I have an Ansible task that performs a curl on the databricks API. Here's what it looks like : --- - name: Databricks dbfs deploy shell: "curl -H 'A...

curlansiblebase64databricks
Read more
November 23rd, 2023
Convert YML object/dict to paths of directories using Ansible/Jinja/Python?

For an Ansible role that needs to create multiple folders I want to work with a simple representation of the list of paths to create: an human readabl...

pythonansiblejinja2
Read more
October 29th, 2023
Formatting yaml block text for use in an ansible assert test

I'm trying to write a fairly simply unittest for an ansible task. Here is the basic task: --- - name: Test task host: localhost task: - name:...

ansibleyaml
Read more
September 29th, 2023
Ansible Reading Python Script as JSON

I'm new to using Ansible and was hoping to be able to write basic python scripts then run them on remote machines. I have tried the various execution...

ansible
Read more
September 28th, 2023
Nested variable in Ansible referencing a list

I'm hoping to get some guidance on the following code which involves a nested variable in Ansible. Here's the playbook: --- - name: Testing hosts: l...

ansiblejinja2variables
Read more
September 23rd, 2023
Upload '.xml' files to server using 'curl' in an Ansible playbook

I am trying to upload multiple .xml files to a server and my Ansible playbook indicates the path isn't a directory, but the path and files are there. ...

curlansible
Read more
September 22nd, 2023
Append string to list contained in dictionary value in Ansible

I have a dictionary that looks something like this (but much bigger): my_dict: "id1": "name1" "id2": "name2" "id3": "name1" "id4": "name2" "...

ansible
Read more
September 22nd, 2023
How to run Python code on the host like the 'ansible.builtin.shell' module does for Bash?

Sometimes I cannot use the native Ansible / Jinja2 functions to get what I want, so I go get it via Bash. For example, I had to type yesteday's date i...

pythonansiblebashcmdstdout
Read more

Hot Topic

  • 25881

    How do I undo the most recent local commits in Git?

  • 11618

    How can I remove a specific item from an array in JavaScript?

  • 20343

    How do I delete a Git branch locally and remotely?

  • 7387

    How can I find all files containing a specific text (string) on Linux?

  • 7330

    How to find all files containing specific text (string) on Linux?

  • 7611

    How do I revert a Git repository to a previous commit?

  • 2671

    How do I create an HTML button that acts like a link?

  • 8481

    How do I check out a remote Git branch?