Category "ansible"

Ansible when condition: only run the script if the command failed

I would like a bash script to run only if the command run into an error, yet I am not too familiar how to use the when condition, can someone please help? gaiac

Issue in placing DataDog log annotation on deployment via ansible

I am using ansible version 2.7 for kubernetes deployment. For sending logs to datadog on kubernetes one of the way is to configure annotations like below, tem

Ansible not evaluating correctly mutiple ansible_facts.packages

I have strange issue, I'm sure its just something trivial but I'm stuck. ansible 2.9.21 I have tasks that should not run if any of 3 or 4 packages are not prese

Ansible: Failed to restart apache2.service: Connection timed out

I am using Ansible AWX to issue a restart command to restart an apache2 service on a host. The restart command is contained in a playbook. --- - name: Manage Li

ERROR! couldn't resolve module/action . This often indicates a misspelling, missing collection, or incorrect module path

I've got an Ansible Collections in my Ansible playbook as follows: - name: Create a profile for the user community.windows.win_user_profile: username: tes

How can I write variables inside the tasks file in ansible

I have this play.yml --- - hosts: localhost tasks: - include: apache.yml My apache.yml file looks like this: vars: url: http://example.com/apache

restore backup file created with Copy

If a backup file is created using Copy (with backup=yes), for example, with this task: - name: copy file copy: dest: path/to/dest src: p

Get Volume group attributes to be used in condition using Ansible

I would like to be able to get list of volume groups available and then use the attributes of the volume group to conditionally create the filesystem on volume

Best way to check for installed yum package/rpm version in Ansible and use it

I've been getting my feet wet with Ansible (2.0.0.2) on CentOS 7. I'm trying to obtain a version from an installed rpm/yum package, but ran into a warning messa

How to access a programmatically constructed ansible variable?

I have constructed an ansible variable using two other defined ansible variables. The constructed variable is defined in the vars/main.yml and I want to access

Ansible: Remove item from dict

I have a situation where i am trying to remove the item from a list. but i am not getting expected result. Please help me what I am doing wrong here? here is

How do I write Ansible task for 'systemctl set-default graphical.target' without shell/command modules

I want to write a task in Ansible to perform the following command: "systemctl set-default graphical.target" without using shell/command modules. not sure that

Installing specific apt version with ansible

I used an ansible playbook to install git: --- - hosts: "www" tasks: - name: Update apt repo apt: update_cache=yes - name: Install dependencies ap

Failed to connect to the host via PSRP

I try to run playbook on Ansible tower to connet to window server and got bug this this my playbook --- - name: Tranfer File From Jap hosts: tbdbmonprd tas

Ansible inventory variable undefined

I've defined a variable in my inventory file, but i get error variable is undefined when using it in play condition. inventory.yml: [nodes] node1 .... node1 .

Ansible is being run in a world writable directory (/vagrant), ignoring it as an ansible.cfg source

trying to provision vagrant vm (ubuntu/trusty64) with ansible_local provisioner from cygwin [WARNING] Ansible is being run in a world writable directory (/v

Ansible: To use the 'ssh' connection type with passwords, you must install the sshpass program"

Recently I created new roles called spd in my existing project. While other script works fine in the setup. This newly created fails. Please point me to what is

How to chain two Ansible module in one task

There is something I need to achieve in Ansible that I found no where to start. I need to Login as a non-root user (remote_user: jane) Switch user to root after

Create Ansibles remote_tmp from config file variable

I want to fix the following warning by manually creating the path: Wednesday 22 January 2020 12:50:41 +0100 (0:00:05.878) 0:20:16.431 ***** [WARNING]:

How can I get the installed YUM packages with Ansible?

I am trying to get all the installed YUM packages on an RHEL machine. I can easily get it through using shell commands which is not idempotent and would like to