ansible-collections / community.network

Ansible Community Network Collection
http://galaxy.ansible.com/community/network
Other
125 stars 90 forks source link

exos_config: unable to issue 'restart process' when config isn't saved #109

Open uedvt359 opened 4 years ago

uedvt359 commented 4 years ago
SUMMARY

Issuing restart process XXX will show a prompt (different to the normal one) to ask whether to save the config. The exos_config module does not expect a prompt at this time, and runs into a timeout. A minimal test case playbook to reproduce the issue is posted in the section below.

This is the prompt that is displayed when restarting a process while the config isn't saved (it is allowed to say "n" and the process will still be restarted)

Do you want to save configuration changes to currently selected configuration
file (primary.cfg)? (y or n)

Note that this is a different prompt to the one displayed by the save command:

Do you want to save configuration to primary.cfg and overwrite it? (y/N) 
ISSUE TYPE
COMPONENT NAME

exos_config

ANSIBLE VERSION
ansible 2.9.9
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/uedvt359/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.7.7 (default, Mar 13 2020, 21:39:43) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)]
CONFIGURATION
# no output
OS / ENVIRONMENT
Image   : ExtremeXOS version 22.7.1.2 22.7.1.2-patch1-21 by release-manager
          on Wed Jan 22 12:22:48 EST 2020
BootROM : 1.0.1.8
Diagnostics : 5.12
Certified Version : EXOS Linux  3.18.123, FIPS fips-ecp-2.0.16
STEPS TO REPRODUCE
---
- hosts: all
  connection: network_cli
  user: root
  vars:
    ansible_network_os: exos

  tasks:
  - name: do something to make the config change
    exos_config:
      commands:
      - delete process testProcess
      - create process testProcess python-module __future__

#  - name: if we don't save the config, process restarting will fail
#    exos_config:
#      save_when: modified

  - name: restart process will fail, because of the prompt to save the config
    exos_config:
      commands: restart process testProcess

If we were to uncomment the save_when task, it would work (but we want to only save the config once everything is done, not in the middle).

EXPECTED RESULTS
ACTUAL RESULTS
PLAY [all] ****************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ****************************************************************************************************************************************************************************************
ok: [HOSTNAME_OMITTED]

TASK [do something to make the config change] *****************************************************************************************************************************************************************
changed: [HOSTNAME_OMITTED]

TASK [restart process will fail, because of the prompt to save the config] ************************************************************************************************************************************
fatal: [HOSTNAME_OMITTED]: FAILED! => {"changed": false, "msg": "command timeout triggered, timeout value is 30 secs.\nSee the timeout setting options in the Network Debug and Troubleshooting Guide."}

PLAY RECAP ****************************************************************************************************************************************************************************************************
HOSTNAME_OMITTED : ok=2    changed=1    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
ansibullbot commented 4 years ago

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 4 years ago

cc @LindsayHill @bigmstone @hlrichardson @rdvencioneck @ujwalkomarla click here for bot help

ansibullbot commented 4 years ago

@uedvt359, just so you are aware we have a dedicated Working Group for network. You can find other people interested in this in #ansible-network on Freenode IRC For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help