0

while trying to setup a remote machine using ansible, I am running into the following issue:

FAILED! => {"changed": false, "module_stderr": "sudo: a password is required\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

I am already escalating privileges in the playbook using the following method:

  become: yes
  become_method: community.general.sudosu 

two of the tasks are successfully being executed with escalated privileges as well. i am running into this error when I run the following task:

    - name: Pushing Nebula configs to node
      synchronize: 
        src: <local dir>
        dest: "/etc/<target_dir>/"
        dest_port: "{{ ssh_port }}"
        mode: push
      delegate_to: localhost

the user I am using does not require a sudo password.

1 Answer 1

0

Try this, please

- name: Pushing Nebula configs to node
  synchronize: 
    src: <local dir>
    dest: "/etc/<target_dir>/"
    dest_port: "{{ ssh_port }}"
    mode: push
  delegate_to: localhost
  vars:
    ansible_become: false

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.