Skip to content
Advertisement

Tag: ansible

How to get any command / task (ex: Ansible – Yum Install ) / stdout output i.e. Pretty print or Beautify / Lint aligned output

Ansible version: 2.8.3 or Any I’m using -m <module> Ansible’s ad-hoc command to ensure the following package is installed –OR– let’s say if I have a task to install few yum packages, like (i.e. How can I do the same within a task (possibly when I’m not using ansible’s shell / command modules): It works, but how can I get

Can’t assign password to user with ansible user module

When I run this it does what it’s supposed to do. It creates the user and the home directory that I specify. It also prints out a password and the hash but I can’t log change to this user no matter what I do. Any suggestions on how I can get a password assigned to this user correctly would be

Iterating Ansible setup command

I want to use ansible setup module to retrieve hosts specs and I tried with a bash for loop. Ansible version: 2.4 My hosts inventory has been defined in a group of machines which I called rhelmachines I would like to collect the following list of variables called “specs” I am then trying to include the ansible command in a

How to remove temp file in ansible using copy module

I’m using adhoc command for example After copy in the remote host. I found temp files in the directory ~/.ansible/tmp How to remove this temp directory on remote host? Using another module like “commmand” ? In the reference of copy ansible module i did not found about remove temp file after copy. Answer ~/.ansible/tmp is a “working” directory for Ansible

Using register with a loop in Ansible

i want to code a playbook which IF a user exists changes the pw of it. The playbook should be able to take n User’s and change the pw of those Users. At the moment im having the issue that the when is empty due to the loop, i tried using with_items: {{ user_exists.results }} but this is somehow not

Advertisement