Start a Conversation

Unsolved

Closed

S

1 Message

452

April 4th, 2023 17:00

ECS Ansible error "MODULE FAILURE" when trying to create a directory

Hi team, 

ECS version: v3.7.0.2
Python versions, 2.7 and 3.4 in ECS nodes
Python versions, 2.7 and 3.6 on the Ansible server node { ansible [core 2.14.4]}

I'm trying to create a directory using Ansible. 

- name: Creating promtail directories
file:
path: '{ { item }}'
state: directory
mode: '0755'
loop:
- '/opt/promtail'
- '/usr/local/promtail/bin/'

Error: There was an issue creating /opt/promtail as requested: [Errno 13] Permission denied: '/opt/promtail

I then add sudo :

- name: Creating promtail directories
file:
path: '{ { item }}'
state: directory
mode: '0755'
loop:
- '/opt/promtail'
- '/usr/local/promtail/bin/'
become: true
become_method: sudo


Which gives me the below MODULE error:

failed: [] (item=/usr/local/promtail/bin/) => {
  
"ansible_loop_var": "item","changed": false,
"item": "/usr/local/promtail/bin/",
"module_stderr": "OpenSSH_8.6p1, LibreSSL 3.3.6\r\ndebug1: Reading configuration data /Users/sshrivastava/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files\r\ndebug1: /etc/ssh/ssh_config line 54: Applying options for *\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/sshrivastava/.ssh/known_hosts'\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/sshrivastava/.ssh/known_hosts2'\r\ndebug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 27777\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\nShared connection to closed.\r\n",
"module_stdout": "","msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1}

 
The error is vague it gives me ssh errors, but any other module that doesn't require "sudo" works correctly, 

When I try to make these folders manually on the remote ECS node, I AM SUCCESSFULLY able to do so using "sudo mkdir folder" and "chmod 755 folder"

I'm using python2.7 as 3.4 is not supported

ansible_python_interpreter=/usr/bin/python


Can someone help me out with this?

No Responses!
No Events found!

Top