Strong synchronization with password request

I am using Ansible (1.9.2) to deploy some files on a Redhat 6.4 server.

The playlist looks something like this:

- name: deploy files hosts: web tasks: - name sync files sudo: no synchronize: src={{ local_path }} dest={{ dest_path }} 

And to drop that, I run something like the following

 ansible-playbook -i myinventory myplaybook.yml -u DOMAIN\\user --ask-pass 

When I start the game, I enter my password in the invitation, after which the results will be received successfully, however, as soon as the synchronization task is reached, another invitation again asks for my password, for example the following

 DOMAIN\ user@hostname password: 

If I enter my password again, the deployment will complete correctly.

My questions

  • How can I fix or work around this so that I don’t need to enter a password for each use of the synchronization module?
  • Is this the expected behavior for a sync module? Or is it an error in Ansible?

I cannot use ssh keys due to environmental restrictions.

I do not want to use the copy module for scalability reasons.

Things i tried

Can anyone help?

+5
source share
2 answers

Why not use an inventory like encrypted with Vault (ansible-playbook -ask-vault-pass ...) ?:

 [targets] other1.example.com ansible_connection=ssh ansible_ssh_user=mpdehaan ansible_ssh_pass=foobar other2.example.com ansible_connection=ssh ansible_ssh_user=mdehaan ansible_ssh_pass=foobar123 
0
source

Synchronization will ask you for a password if your credentials for your other user are different from your target host. I tried many suggested workarounds, but none of them worked ...

In the end, I had to go back to the file module using -sftp-extra-args to achieve what I needed. He did the trick.

0
source

All Articles