Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace_config required #129

Closed
t2d opened this issue Jan 4, 2016 · 6 comments
Closed

replace_config required #129

t2d opened this issue Jan 4, 2016 · 6 comments

Comments

@t2d
Copy link
Contributor

t2d commented Jan 4, 2016

Ansible task:

- name: Push configuration with napalm
  napalm_install_config:
    hostname: "{{ inventory_hostname }}.{{ domain }}"
    dev_os: ios
    username: "{{ user }}"
    password: "{{ password }}"
    config_file: cisco-configs/{{ inventory_hostname }}/configuration
    commit_changes: False
    diff_file: cisco-config/{{ inventory_hostname }}/diff

Ansible output:

TASK: [cisco-ios | Push configuration with napalm] **************************** 
failed: [host1] => {"failed": true}
msg: missing required arguments: replace_config
failed: [host2] => {"failed": true}
msg: missing required arguments: replace_config

but the code says

replace_config:
        description: If set to True the entire configuration on the device will be replaced during the commit. If
                     set to False, we will merge the new config with the existing one. Default: False.
        required: False
@GGabriele
Copy link
Contributor

Hi @t2d ,
the code says so because replace_config is not currently supported by the IOS driver :)

@ktbyers
Copy link
Contributor

ktbyers commented Jan 6, 2016

@t2d I am working on a new IOS driver that should have this (see #119 )

@ktbyers
Copy link
Contributor

ktbyers commented Jan 6, 2016

This is a documentation error in the Ansible module (napalm_install_config).

Doc string says:

    replace_config:
        description: If set to True the entire configuration on the device will be replaced during the commit. If
                     set to False, we will merge the new config with the existing one. Default: False.
        required: False

But code says:

def main():
    module = AnsibleModule(
        argument_spec=dict(
            hostname=dict(required=True),
            username=dict(required=True),
            password=dict(required=True),
            timeout=dict(required=False, default=60, type='int'),
            config_file=dict(required=True),
            dev_os=dict(required=True),
            commit_changes=dict(required=True),
            replace_config=dict(required=True),
            diff_file=dict(required=False, default=None),
            get_diffs=dict(required=False, choices=BOOLEANS, type='bool', default=True)

@dbarrosop
Copy link
Member

Yes, this problem will be fixed in #132

            replace_config=dict(required=False, choices=BOOLEANS, type='bool', default=False),

Once it's merged it will start behaving as described in the docstring.

@jedelman8
Copy link
Contributor

Hey guys on a side note, I've been using the NAPALM ios integration with Ansible (before any changes from Kirk). And you may need to use get_diffs=false in the playbook. I originally added this for an older version for Arista, but needed it here so diffs aren't calculated b/c an error was being raised.

@dbarrosop
Copy link
Member

Closing this one as it should be fixed by now. Otherwise, feel free to reopen.

Thanks!

dbarrosop added a commit that referenced this issue Oct 19, 2017
dbarrosop pushed a commit that referenced this issue Oct 20, 2017
Fixes issue #126 and #129; LLDP neighbor detail bug
dbarrosop pushed a commit that referenced this issue Oct 20, 2017
Increasing napalm-base requirement to fix missing 'TRACEROUTE_VRF'
dbarrosop pushed a commit that referenced this issue Oct 22, 2017
Add templates and j2 files to MANIFEST
dbarrosop pushed a commit that referenced this issue Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants