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

ntc_install_os updates boot variable only on primary switch in stack #217

Closed
m0ps opened this issue Jul 23, 2018 · 5 comments
Closed

ntc_install_os updates boot variable only on primary switch in stack #217

m0ps opened this issue Jul 23, 2018 · 5 comments

Comments

@m0ps
Copy link

m0ps commented Jul 23, 2018

I have a few c2960x stacks and I wrote a playbook that upgrades IOS on it. But while I set a boot variable via ntc_install_os it updates it only on primary switch, all other stack members left untouched. Is there a chance that this function will be added in a near future, or is there any workaround can be applied?

@OzNetNerd
Copy link

Can you please provide your playbook? It will aid in troubleshooting and fixing the issue.

@m0ps
Copy link
Author

m0ps commented Aug 3, 2018

  tasks:
  - name: "COPYING IMAGE TO flash1:"
    ntc_file_copy:
      platform: cisco_ios_ssh
      file_system: "flash1:"
      local_file: "images/{{ target_image }}"
      remote_file: "{{ target_image }}"
      host: "{{ inventory_hostname }}"
      username: "{{ ansible_user }}"
      password: "{{ ansible_ssh_pass }}"
    notify:
      - SET BOOT VARIABLE

  - name: "COPYING IMAGE TO flash2:"
    ntc_file_copy:
      platform: cisco_ios_ssh
      file_system: "flash2:"
      local_file: "images/{{ target_image }}"
      remote_file: "{{ target_image }}"
      host: "{{ inventory_hostname }}"
      username: "{{ ansible_user }}"
      password: "{{ ansible_ssh_pass }}"
    notify:
      - SET BOOT VARIABLE

  handlers:
  - name: "SET BOOT VARIABLE"
    ntc_install_os:
      platform: cisco_ios_ssh
      host: "{{ inventory_hostname }}"
      username: "{{ ansible_user }}"
      password: "{{ ansible_ssh_pass }}"
      system_image_file: "{{ target_image }}"

It looks like ntc_install_os execute:
boot system <pathlist of boot file>
But when switches are stacked, it must execute:
boot system switch all <pathlist of boot file>

C2960X-STACK1(config)#boot system ?      
  WORD    pathlist of boot file(s) ... file1;file2;...
  switch  Set system image for switches in the stack
C2960X-STACK1(config)#boot system switch ?   
  <1-8>  Switch number
  all    Set system image for all switches in the stack

@Ondjultomte
Copy link

Is this solved?

@FragmentedPacket
Copy link
Contributor

This is not solved within our modules. It does look like there is some work to do within pyntc and these modules to add support for that.

@jeffkala
Copy link
Collaborator

closing. Please retest now that #268 is deployed and 1.0.0 of this collection is in ansible-galaxy now. Logic itself should be in pyntc.

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