Skip to content

Add support of running general Ansible modules on EosHost#1742

Merged
neethajohn merged 4 commits intosonic-net:masterfrom
wangxin:fix-eoshost
Jun 19, 2020
Merged

Add support of running general Ansible modules on EosHost#1742
neethajohn merged 4 commits intosonic-net:masterfrom
wangxin:fix-eoshost

Conversation

@wangxin
Copy link
Collaborator

@wangxin wangxin commented Jun 8, 2020

Description of PR

Summary:
Fixes # (issue)
This is a re-submit of PR #1721 which was reverted because of an issue.

  • Add support of running general Ansible modules on EosHost

The EOS hosts support two types of command line interface:

  1. Linux shell
  2. EOS shell

This change is to add the support of running general Ansible modules
that can only be executed under Linux shell.

  • If not able to get the explicitly defined username and
    password, fallback to use the value of "fanout_admin_user"
    and "fanout_admin_password". It is unlikely to break the
    existing code.

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

This change is to add the support of running general Ansible modules that can only be executed under Linux shell.

How did you do it?

Improved the EosHost class defined in tests/common/devices.py to make it accepts two sets of credential:

The first set of credential exposes the EOS CLI interface. When use this set of credential, we use ansible_connection network_cli.
The second set of credential exposes the linux shell of EOS. When use this set of credential, we use ansible_connection ssh.
If name of the ansible module to be executed on EOS hosts starts with "eos_", then use ansible_connection network_cli to run the module. Otherwise, use ansible_connection ssh to run the module.

How did you verify/test it?

Test run the test scripts that depend on EosHost.

Any platform specific information?

Only EoSHost is enhanced. The OnyxHost may need to be enhanced in the similar way.

Supported testbed topology if it's a new test case?

Documentation

* Add support of running general Ansible modules on EosHost

The EOS hosts support two types of command line interface:
1. Linux shell
2. EOS shell

This change is to add the support of running general Ansible modules
that can only be executed under Linux shell.

* If not able to get the explicitly defined username and
password, fallback to use the value of "fanout_admin_user"
and "fanout_admin_password". It is unlikely to break the
existing code.

Signed-off-by: Xin Wang <[email protected]>
@wangxin wangxin requested review from lguohan and yxieca June 8, 2020 10:17
@svc-acs
Copy link
Collaborator

svc-acs commented Jun 8, 2020

Build triggered for merge commit.

@svc-acs
Copy link
Collaborator

svc-acs commented Jun 8, 2020

Build started for merge commit.

The fanout device may be EOS type or other type. The credential
name should be more generic.

Signed-off-by: Xin Wang <[email protected]>
@lguohan
Copy link
Contributor

lguohan commented Jun 17, 2020

retest this please

1 similar comment
@lguohan
Copy link
Contributor

lguohan commented Jun 18, 2020

retest this please

@lguohan
Copy link
Contributor

lguohan commented Jun 18, 2020

retest this please

2 similar comments
@lguohan
Copy link
Contributor

lguohan commented Jun 18, 2020

retest this please

@neethajohn
Copy link
Contributor

retest this please

@neethajohn neethajohn mentioned this pull request Jun 18, 2020
3 tasks
@lguohan
Copy link
Contributor

lguohan commented Jun 19, 2020

retest this please

@neethajohn neethajohn merged commit 49fe69c into sonic-net:master Jun 19, 2020
yxieca pushed a commit that referenced this pull request Jun 23, 2020
…n issue (#1805)

PR #1742 introduced two sets of fanout variables as credentials for accessing
the fanout network cli and linux shell. This change explicitly define the variables
in ansible/group_vars/fanout/secrets.yml.

After this PR is merged, please remember to update the credentials in
ansible/group_vars/fanout/secrets.yml file to the actual values of your
lab configuration.

Another change in this PR is to fix the issue of getting results of
FanoutHost shutdown and no_shutdown methods. The results
are directly returned by inner function call. It's unnecessary and
wrong to get results using dictionary `key self.hostname`.

Signed-off-by: Xin Wang <[email protected]>
@wangxin wangxin deleted the fix-eoshost branch June 28, 2020 10:28
neethajohn pushed a commit to neethajohn/sonic-mgmt that referenced this pull request Jan 8, 2021
After Github PR sonic-net#1742 is merged, we need to explicitly define the fanout credentials for accessing fanout network cli and Linux shell.
bingwang-ms pushed a commit to bingwang-ms/sonic-mgmt that referenced this pull request May 20, 2021
After Github PR sonic-net#1742 is merged, we need to explicitly define the fanout credentials for accessing fanout network cli and Linux shell.
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
Why I did it
include changes from sairedis submodule
102d20b | [202211][submodule][SAI]Advance header include 0031470 | improve enum values integration check (sonic-net#1727) (sonic-net#1737)
04d3c41 | [Submodule][upgrade]Upgrade SAI submodule (sonic-net#1204)

updates from SAI
7710e24 | [cherry-pick][202211]Enhance the check enum lock script (sonic-net#1741) (sonic-net#1742)
0031470 | improve enum values integration check (sonic-net#1727) (sonic-net#1737)
4f11c7e | Enable github code scanning to replace LGTM. (sonic-net#1709)

How I did it
How to verify it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants