Hi,
I have installed AWX 17.0.1 on Ubuntu OS. I am trying to run a simple
playbook which would copy a zip file from the controller machine (source
machine) to a remote SUSE linux host (/tmp/) location. When i launch the
job from AWX UI, i get this error whereas when i run the ansible playbook
via CLI it works fine.

What could be wrong here?



Error msg seen:

{
  "msg": "Source /tmp/crowdStrike.zip not found",
  "invocation": {
    "module_args": {
      "directory_mode": null,
      "force": true,
      "remote_src": true,
      "_original_basename": null,
      "owner": "root",
      "follow": false,
      "local_follow": null,
      "group": "root",
      "unsafe_writes": null,
      "setype": null,
      "content": null,
      "serole": null,
      "dest": "/tmp/crowdStrike.zip",
      "selevel": null,
      "regexp": null,
      "validate": null,
      "src": "/tmp/crowdStrike.zip",
      "checksum": null,
      "seuser": null,
      "delimiter": null,
      "mode": "0755",
      "attributes": null,
      "backup": false
    }
  },
  "_ansible_no_log": false,
  "changed": false



 cat main.yml
---
# tasks file for crowdstrike
- name: Create a directory if it does not exist
  ansible.builtin.file:
    path: /tmp/crowdstrike
    state: directory
    mode: '0755'

- name: Check if source installation script exists or not
  stat:
    path: "{{ installer_zip }}"
  register: file_data1

- name: validate the source file existence
  debug:
    msg: "The file {{ installer_zip }} exist"
  when: file_data1.stat.exists

- name: Copy crowdStrike.zip with owner and permissions to remote node -
"{{inventory_hostname}}"
  ansible.builtin.copy:
    src: "{{installer_zip}}"
    #src: /tmp/crowdStrike.zip
    dest: /tmp/crowdStrike.zip
    remote_src: true
    owner: root
    group: root
    mode: '0755'
  #become: true

- name: Unarchive a file that is already on the remote machine -
{{inventory_hostname}}
  ansible.builtin.unarchive:
    src: /tmp/crowdStrike.zip
    dest: /tmp/crowdstrike/.
    remote_src: yes

- name: Check if installation script exists or not
  stat:
    path: /tmp/crowdstrike/install.sh
  register: file_data

- name: print the status
  debug:
    msg: "The file exist"
  when: file_data.stat.exists

- name: provide full permission to crowdstrike directory
  file:
    path: /tmp/crowdstrike
    owner: root
    group: root
    mode: '0777'


- name: run install sh from '/tmp/crowdstrike' directory
  command: sh install.sh
  args:
    chdir: /tmp/crowdstrike
  ignore_errors: false

- name: check for service status
  command: sudo systemctl status falcon-sensor
  register: output_data


- name: validate the service status
  debug:
    msg: "Service Started - {{output_data.stdout}}"
  when: output_data.stdout | regex_search('active')

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAE7H9qr2zsf0n7Wup1aEerCeVT0G-3-23%3DLhgs5WJgguCSVSpw%40mail.gmail.com.

Reply via email to