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