Unable to download from FTP using Ansible

12 views
Skip to first unread message

Naeem Khan

unread,
Sep 18, 2019, 2:12:56 AM9/18/19
to Ansible Project
Hi Everyone,
I am unable to download the file from FTP server, please suggest how can i download file from FTP. My YAML script is as follows.

YAML:-

---
# tasks file for ac.install
- name: make a new directory for downloading the installer
  shell: mkdir -p /installer/NAM
  #shell: cd /installer/NAM
  #register: make_directory
- name: Download File From FTP
    get_url:
    url: ftp://admin:abc...@172.19.54.10:22/home/admin/TestFtp/AM_431_AccessManagerService_Linux64.tar.gz dest:/installer/NAM/AM_431_AccessManagerService_Linux64.tar.gz
- args: 
    chdir: /installer/NAM/

Error while executing:-

ansible-playbook 2.8.4
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.5 (default, Aug  2 2016, 04:20:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
Parsed /etc/ansible/hosts inventory source with ini plugin
ERROR! Syntax Error while loading YAML.
  mapping values are not allowed in this context

The error appears to be in '/tmp/auto_install/ansible_install_script/roles/ac.install/tasks/main.yml': line 8, column 12, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: Download File From FTP
    get_url:
           ^ here

Reply all
Reply to author
Forward
0 new messages