ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
14.05k stars 3.42k forks source link

Template doesnt create file when using AWX #4693

Closed nprashiyer closed 5 years ago

nprashiyer commented 5 years ago
ISSUE TYPE
SUMMARY

I'm using a playbook to create a file on my remote server. However, file creation is not happening. When I use the command option within Inventories-->Host, it works. But file creation doest happen when using template/playbook.

ENVIRONMENT
STEPS TO REPRODUCE

Run the playbook.

- name: Create test file
  hosts: controller
  gather_facts: False
  tasks:
    - name: Creating test file
      file:
        path: $HOME/github.yaml
        state: touch
EXPECTED RESULTS

The test file to be created in controller hosts.

ACTUAL RESULTS

File is not created. Running locally works. Also this works if I try Run Command option available under Inventory > Hosts

ADDITIONAL INFORMATION

This is the output I get upon running the template

{
    "_ansible_no_log": false,
    "invocation": {
        "module_args": {
            "directory_mode": null,
            "force": false,
            "remote_src": null,
            "access_time": null,
            "access_time_format": "%Y%m%d%H%M.%S",
            "_original_basename": null,
            "follow": true,
            "owner": null,
            "path": "/home/sysadmin/github.yaml",
            "src": null,
            "group": null,
            "modification_time": null,
            "unsafe_writes": null,
            "delimiter": null,
            "regexp": null,
            "seuser": null,
            "recurse": false,
            "serole": null,
            "_diff_peek": null,
            "content": null,
            "state": "touch",
            "mode": null,
            "modification_time_format": "%Y%m%d%H%M.%S",
            "selevel": null,
            "attributes": null,
            "backup": null,
            "setype": null
        }
    },
    "dest": "/home/sysadmin/github.yaml",
    "changed": false
}
nprashiyer commented 5 years ago

Just realized my mistake. Job run was incorrectly set to Check instead of Run