Category "ansible"

VirtualBox silent install via Ansible fails?

$ ansible --version ansible 2.10.8 Per Oracle VM VirtualBox 6.1 Silent Install (How-To Guide), I should be able to install VirtualBox silently like this C:\tem

VirtualBox silent install via Ansible fails?

$ ansible --version ansible 2.10.8 Per Oracle VM VirtualBox 6.1 Silent Install (How-To Guide), I should be able to install VirtualBox silently like this C:\tem

Order of notify handlers

I have a task: - name: uploads docker configuration file template: src: 'docker.systemd.j2' dest: '/etc/systemd/system/docker.service' notify:

Ansible AnsibleUndefinedVariable no attribute

I have the following files vars/main.yml testconfig: - {hostname: router123, example: no ip cef} cisco_891_l2interfaces: - FastEthernet0 - FastEthernet1 -

How do I create an Ansible "pre-handler" that runs before the task but only if the task needs to run?

How do I create an Ansible "pre-handler" that runs before the task, but only if the task needs to run? In other words, Ansible will first check if the task need

Check if arrays are defined and not empty in ansible

I have the following code - set_fact: MY_HOSTNAME: "SOME VALUE" MY_SERVER: "00.00.00.00" - name: Get MY server set_fact: MY_SERVER: "{{ groups[MY

How to prompt user for a target host in Ansible?

I want to write a bootstrapper playbook for new machines in Ansible which will reconfigure the network settings. At the time of the first execution target machi

How to generate variable using ansible parameters like args, slurp, register and set_fact inside a doit task?

I am creating a doit task where I need to use ansible parameters like args, slurp, register and set_fact inside the task within actions to make sure the variab

Append a string to a List in Ansible

I'm trying to append a string to a list in ansible , so basically i'll be building a payload to delete few of the topology records in the F5 GTM network gear. I

ansible playbook error was: ModuleNotFoundError: No module named 'azure.mgmt.monitor.version' although the module is installed

After upgrading ansible to version 2.10.5 and python3.8.10 my playbook.yml fails with this error. ModuleNotFoundError: No module named 'azure.mgmt.monitor.versi

Ansible change all dict key values only by filters

I have an ansible dict like ports: webui: 7200 webadmin: 7209 core_api: 7201 stock_api: 7204 import_export: 7207 And i want to transform all keys i

How can I get the installed apt packages with Ansible?

I am trying to list all installed packages on my Debian 7 (Wheezy), 8 (Jessie), and 9 (Stretch) machines. There are easy ways dealing with it using APT or

How to run a task when variable is undefined in ansible?

I am looking for a way to perform a task when ansible variable is not registers /undefined e.g -- name: some task command: sed -n '5p' "{{app.dirs.include

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