Hamza HEBHOUB:
Hello everyone
I’m using Jenkins to launch a simple Ansible Pipeline (to create a folder on localhost as follow
-
name: Play1
hosts: localhost
become: true
remote_user: ec2-user
tasks:
#- ping:
- name: Create directory
file:
#path: /var/lib/jenkins/workspace/
path: /home/ec2-user/Newfolder
state: directory
group: ec2-user
owner: ec2-user
mode: 0700
But when i build the pipeline I got this error message:
TASK [Gathering Facts] *********************************************************
fatal: [localhost]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"failed": true, "module_stderr": "sudo: a password is required\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}}, "msg": "The following modules failed to execute: ansible.legacy.setup\n"}
Have you an idea about this error please ?