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

Module "napalm_install_config" fails when the parameter "config_file" is located in a home directory (i.e. '~/.compiled/`) #71

Closed
bdlamprecht opened this issue Jul 12, 2017 · 3 comments
Labels

Comments

@bdlamprecht
Copy link

As stated in the title, this appears to be an problem with just napalm_install_config module due to the fact that the stat module is able to locate it fine.

Running the install role:

TASK [install : Ensure assembled configuration file exists] ******************************************                                                                                               [32/966]
ok: [rtp-vba-a]

TASK [install : debug] *******************************************************************************
ok: [rtp-vba-a] => {
    "result.stat": {
        "atime": 1499900564.0014858,
        "attr_flags": "e",
        "attributes": [
            "extents"
        ],
        "block_size": 4096,
        "blocks": 152,
        "charset": "us-ascii",
        "checksum": "05a37e3fdb9a92e7efd17e3210bdde77d23bb729",
        "ctime": 1499900527.9213126,
        "dev": 64512,
        "device_type": 0,
        "executable": false,
        "exists": true,
        "gid": 901000001,
        "gr_name": "coc-users",
        "inode": 147520,
        "isblk": false,
        "ischr": false,
        "isdir": false,
        "isfifo": false,
        "isgid": false,
        "islnk": false,
        "isreg": true,
        "issock": false,
        "isuid": false,
        "md5": "345db65692def774e6af2e24f9d60bdb",
        "mimetype": "text/plain",
        "mode": "0644",
        "mtime": 1499900527.9213126,
        "nlink": 1,
        "path": "/home/bl839s/.compiled/rtp-vba-a/assembled.conf",
        "pw_name": "bl839s",
        "readable": true,
        "rgrp": true,
        "roth": true,
        "rusr": true,
        "size": 77357,
        "uid": 901000002,
        "version": "18446744072107431939",
        "wgrp": false,
        "woth": false,
        "writeable": true,
        "wusr": true,
        "xgrp": false,
        "xoth": false,
        "xusr": false
    }
}

TASK [install : Fail is the configuration file cannot be located] ************************************
skipping: [rtp-vba-a]

TASK [install : Push configuration onto the device] **************************************************
fatal: [rtp-vba-a]: FAILED! => {"changed": false, "failed": true, "msg": "cannot load config: [Errno 2] No such file or directory: '~/.compiled/rtp-vba-a/assembled.conf'"}

PLAY RECAP *******************************************************************************************
rtp-vba-a                  : ok=2    changed=0    unreachable=0    failed=1

Contents of the install role:

$ cat roles/install/tasks/main.yml
- name: Ensure assembled configuration file exists
  stat:
    path: "{{ host_dir }}/assembled.conf"
  register: result

- debug:
    var: result.stat

- name: Fail is the configuration file cannot be located
  fail:
    msg: "Cannot locate configuration file to push!"
  when: result.stat.exists == False

- name: Push configuration onto the device
  napalm_install_config:
    provider: "{{ napalm }}"
    config_file: "{{ host_dir }}/assembled.conf"
    commit_changes: "{{ not ansible_check_mode }}"
    get_diffs: true
    diff_file: "{{ host_dir }}/config.diff"
@dbarrosop
Copy link
Member

dbarrosop commented Jul 13, 2017

Hi,
the error is probably in the driver itself as the module doesn't deal with the file. Which driver were you using for that device?

Regards

@bdlamprecht
Copy link
Author

bdlamprecht commented Jul 13, 2017

It was for a junos device, but I'm fairly certain I also tried it for an ios device as well.
Should I open issue for each of those drivers or would this single one suffice?

@dbarrosop dbarrosop added the bug label Aug 13, 2017
@ktbyers
Copy link
Collaborator

ktbyers commented Mar 2, 2022

I am going to close as this issue is so old and not being actively worked on.

@ktbyers ktbyers closed this as completed Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants