rename network_get network_put modules to net_get net_put (#40381)

This commit is contained in:
Deepak Agrawal 2018-05-18 14:41:47 +05:30 committed by GitHub
parent de2c1dc241
commit 9e3ad96fa9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 16 deletions

View file

@ -15,7 +15,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = """ DOCUMENTATION = """
--- ---
module: network_get module: net_get
version_added: "2.6" version_added: "2.6"
author: "Deepak Agrawal (@dagrawal)" author: "Deepak Agrawal (@dagrawal)"
short_description: Copy files from a network device to Ansible Controller short_description: Copy files from a network device to Ansible Controller
@ -57,7 +57,7 @@ notes:
EXAMPLES = """ EXAMPLES = """
- name: copy file from the network device to ansible controller - name: copy file from the network device to ansible controller
network_get: net_get:
src: running_cfg_ios1.txt src: running_cfg_ios1.txt
- name: copy file from ios to common location at /tmp - name: copy file from ios to common location at /tmp

View file

@ -15,7 +15,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = """ DOCUMENTATION = """
--- ---
module: network_put module: net_put
version_added: "2.6" version_added: "2.6"
author: "Deepak Agrawal (@dagrawal)" author: "Deepak Agrawal (@dagrawal)"
short_description: Copy files from Ansibe controller to a network device short_description: Copy files from Ansibe controller to a network device
@ -57,11 +57,11 @@ notes:
EXAMPLES = """ EXAMPLES = """
- name: copy file from ansible controller to a network device - name: copy file from ansible controller to a network device
network_put: net_put:
src: running_cfg_ios1.txt src: running_cfg_ios1.txt
- name: copy file at root dir of flash in slot 3 of sw1(ios) - name: copy file at root dir of flash in slot 3 of sw1(ios)
network_put: net_put:
src: running_cfg_sw1.txt src: running_cfg_sw1.txt
protocol: sftp protocol: sftp
dest : flash3:/running_cfg_sw1.txt dest : flash3:/running_cfg_sw1.txt

View file

@ -47,7 +47,7 @@ class ActionModule(ActionBase):
if play_context.connection != 'network_cli': if play_context.connection != 'network_cli':
# It is supported only with network_cli # It is supported only with network_cli
result['failed'] = True result['failed'] = True
result['msg'] = ('please use network_cli connection type for network_get module') result['msg'] = ('please use network_cli connection type for net_get module')
return result return result
try: try:

View file

@ -47,7 +47,7 @@ class ActionModule(ActionBase):
if play_context.connection != 'network_cli': if play_context.connection != 'network_cli':
# It is supported only with network_cli # It is supported only with network_cli
result['failed'] = True result['failed'] = True
result['msg'] = ('please use network_cli connection type for network_put module') result['msg'] = ('please use network_cli connection type for net_put module')
return result return result
src_file_path_name = self._task.args.get('src') src_file_path_name = self._task.args.get('src')

View file

@ -1,5 +1,5 @@
--- ---
- debug: msg="START ios cli/network_get.yaml on connection={{ ansible_connection }}" - debug: msg="START ios cli/net_get.yaml on connection={{ ansible_connection }}"
# Add minimal testcase to check args are passed correctly to # Add minimal testcase to check args are passed correctly to
# implementation module and module run is successful. # implementation module and module run is successful.
@ -13,7 +13,7 @@
match: none match: none
- name: setup (copy file to be fetched from device) - name: setup (copy file to be fetched from device)
network_put: net_put:
src: ios1.cfg src: ios1.cfg
register: result register: result
@ -22,7 +22,7 @@
- result.changed == true - result.changed == true
- name: get the file from device with dest unspecified - name: get the file from device with dest unspecified
network_get: net_get:
src: ios1.cfg src: ios1.cfg
register: result register: result
@ -31,7 +31,7 @@
- result.changed == true - result.changed == true
- name: get the file from device with relative destination - name: get the file from device with relative destination
network_get: net_get:
src: ios1.cfg src: ios1.cfg
dest: 'ios_{{ ansible_host }}.cfg' dest: 'ios_{{ ansible_host }}.cfg'
register: result register: result
@ -40,4 +40,4 @@
that: that:
- result.changed == true - result.changed == true
- debug: msg="END ios cli/network_get.yaml on connection={{ ansible_connection }}" - debug: msg="END ios cli/net_get.yaml on connection={{ ansible_connection }}"

View file

@ -1,5 +1,5 @@
--- ---
- debug: msg="START ios cli/network_put.yaml on connection={{ ansible_connection }}" - debug: msg="START ios cli/net_put.yaml on connection={{ ansible_connection }}"
# Add minimal testcase to check args are passed correctly to # Add minimal testcase to check args are passed correctly to
# implementation module and module run is successful. # implementation module and module run is successful.
@ -13,7 +13,7 @@
match: none match: none
- name: copy file from controller to ios + scp (Default) - name: copy file from controller to ios + scp (Default)
network_put: net_put:
src: ios1.cfg src: ios1.cfg
register: result register: result
@ -22,7 +22,7 @@
- result.changed == true - result.changed == true
- name: copy file from controller to ios + dest specified - name: copy file from controller to ios + dest specified
network_put: net_put:
src: ios1.cfg src: ios1.cfg
dest: ios.cfg dest: ios.cfg
register: result register: result
@ -31,4 +31,4 @@
that: that:
- result.changed == true - result.changed == true
- debug: msg="END ios cli/network_put.yaml on connection={{ ansible_connection }}" - debug: msg="END ios cli/net_put.yaml on connection={{ ansible_connection }}"