Scripting Differences Between Python 2 & 3
Python V2
--- - hosts: lab gather_facts: false tasks: - name: COPY_FTP_IMAGE cli_command: command: 'copy ftp flash:' check_all: True prompt: - 'Address or name of remote host' - 'Source filename' - 'Destination filename' answer: - '192.168.0.144' - 'c3750e-universalk9-mz.152-4.E7.bin' - 'c3750e-universalk9-mz.152-4.E7.bin' vars: ansible_command_timeout: 600
Python V3
--- - hosts: all gather_facts: no connection: local tasks: - name: GATHER SWITCH FACTS ios_facts: - name: UPGRADE IOS IMAGE IF NOT COMPLIANT block: - name: COPY OVER IOS IMAGE ios_command: commands: - command: "copy ftp://anonymous@192.168.0.144/c3750e-universalk9-mz.152-4.E7.bin flash:" prompt: 'c3750e-universalk9-mz.152-4.E7.bin' answer: "\r" vars: ansible_command_timeout: 600