Ansible, Linux, Ubuntu, windows 10

[ansible|windows 10] On ubuntu app ansible.cfg is ignored

os: ubuntu (windows 10)
ansible: 2.6.4

When you launch ansible-playbook and you have a local ansible.cfg, ubuntu throws this error:

[WARNING] Ansible is being run in a world writable directory  (/ mnt / c / code / ansible /....), ignoring it asan ansible.cfg source. For more information see
ERROR! Invalid or no config file was supplied

The problem is related to the permissions that are given to the files by default, since in fact the latest versions see these permissions (777) as a security problem and ignore the file.

To avoid this problem just re-set the permissions of the wsl (windows subsystem linux) by creating the file /etc/wsl.conf

enabled = true
mountFsTab = false
root = / mnt /
options = “metadata, umask = 22, fmask = 11”

generateHosts = true
generateResolvConf = true


Ansible, DevOps, Uncategorized

[Ansible] local_action on aka local_hosts

Ansible allows to execute task on the local machine that launch ansible

for do that use the module local_action:

- name: local authorized key
  local_action: shell cat ~/.ssh/
  register: local_auth_key
  sudo: false

be very careful to always use sudo: false, because without this, ansible will try to run the command as sudo, and if the local user requires the use of the password, the task will fail.


Ansible, DevOps, Uncategorized

[Ansible] Resources, Tutorials, examples