Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Software for Open Networking in the Cloud - SONiC
# Management

# cls test
# Description
Tools for managing, configuring and monitoring SONiC

Expand Down
2 changes: 1 addition & 1 deletion ansible/README.deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and public [sonicdev Docker registry](https://sonicdev-microsoft.azurecr.io/).
- Update [inventory](/ansible/inventory/) file with correct information for your environment.
- ansible_host = management ip address
- sonic_hwsku = Supported Hardware SKU, e.g. Force10-S6000, ACS-MSN2700
- Update [group_vars/sonic/variables](/ansible/group_vars/sonic/variables/) file with:
- Update [group_vars/sonic/vars](/ansible/group_vars/sonic/vars/) file with:
- Replace `sonicadmin_user` and `ansible_ssh_user` with the username you built into the baseimage
- Replace `sonicadmin_initial_password` with the password you built into baseimage.
- Update `[ntp,syslog,dns]_servers` with a list of your server IPs for these services.
Expand Down
266 changes: 61 additions & 205 deletions ansible/README.test.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion ansible/README.testbed.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

- [Overview](doc/README.testbed.Overview.md)
- [Setup](doc/README.testbed.Setup.md)
- [Virtual Switch Testbed Setup](doc/README.testbed.VsSetup.md)
- [Topology](doc/README.testbed.Topology.md)
- [Configuration](doc/README.testbed.Config.md)
- [Minigraph](doc/README.testbed.Minigraph.md)
Expand Down
60 changes: 30 additions & 30 deletions ansible/ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# config file for ansible -- http://ansible.com/
# ==============================================

# nearly all parameters can be overridden in ansible-playbook
# nearly all parameters can be overridden in ansible-playbook
# or with command line flags. ansible will read ANSIBLE_CONFIG,
# ansible.cfg in the current working directory, .ansible.cfg in
# the home directory or /etc/ansible/ansible.cfg, whichever it
Expand All @@ -11,7 +11,8 @@

# some basic default values...

inventory = /etc/ansible/hosts
#inventory = /etc/ansible/hosts
inventory = /var/clsnet/git-sw-csa/sonic-mgmt/ansible
library = library:library/ixia
remote_tmp = $HOME/.ansible/tmp
pattern = *
Expand All @@ -23,7 +24,6 @@ sudo_user = root
transport = smart
#remote_port = 22
module_lang = C
max_diff_size = 512000

# plays will gather facts by default, which contain information about
# the remote system.
Expand Down Expand Up @@ -56,7 +56,7 @@ timeout = 10

# logging is off by default unless this path is defined
# if so defined, consider logrotate
# log_path = $HOME/ansible.log
log_path = $HOME/ansible.log

# default module name for /usr/bin/ansible
#module_name = command
Expand All @@ -74,22 +74,22 @@ timeout = 10
# list any Jinja2 extensions to enable here:
#jinja2_extensions = jinja2.ext.do,jinja2.ext.i18n

# if set, always use this private key file for authentication, same as
# if set, always use this private key file for authentication, same as
# if passing --private-key to ansible or ansible-playbook
#private_key_file = /path/to/file

# format of string {{ ansible_managed }} available within Jinja2
# format of string {{ ansible_managed }} available within Jinja2
# templates indicates to users editing templates files will be replaced.
# replacing {file}, {host} and {uid} and strftime codes with proper values.
ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}

# by default, ansible-playbook will display "Skipping [host]" if it determines a task
# should not be run on a host. Set this to "False" if you don't want to see these "Skipping"
# messages. NOTE: the task header will still be shown regardless of whether or not the
# should not be run on a host. Set this to "False" if you don't want to see these "Skipping"
# messages. NOTE: the task header will still be shown regardless of whether or not the
# task is skipped.
#display_skipped_hosts = True

# by default (as of 1.3), Ansible will raise errors when attempting to dereference
# by default (as of 1.3), Ansible will raise errors when attempting to dereference
# Jinja2 variables that are not set in templates or action lines. Uncomment this line
# to revert the behavior to pre-1.3.
#error_on_undefined_vars = False
Expand All @@ -108,46 +108,46 @@ deprecation_warnings = False
# (as of 1.8), Ansible can optionally warn when usage of the shell and
# command module appear to be simplified by using a default Ansible module
# instead. These warnings can be silenced by adjusting the following
# setting or adding warn=yes or warn=no to the end of the command line
# setting or adding warn=yes or warn=no to the end of the command line
# parameter string. This will for example suggest using the git module
# instead of shelling out to the git command.
# command_warnings = False


# set plugin path directories here, separate with colons
action_plugins = plugins/action
callback_plugins = plugins/callback
# callback_plugins = /usr/share/ansible_plugins/callback_plugins
connection_plugins = plugins/connection
# lookup_plugins = /usr/share/ansible_plugins/lookup_plugins
# vars_plugins = /usr/share/ansible_plugins/vars_plugins
filter_plugins = plugins/filter
callback_whitelist = profile_tasks

# by default callbacks are not loaded for /bin/ansible, enable this if you
# want, for example, a notification or logging callback to also apply to
# want, for example, a notification or logging callback to also apply to
# /bin/ansible runs
#bin_ansible_callbacks = False


# don't like cows? that's unfortunate.
# set to 1 if you don't want cowsay support or export ANSIBLE_NOCOWS=1
# set to 1 if you don't want cowsay support or export ANSIBLE_NOCOWS=1
#nocows = 1

# don't like colors either?
# set to 1 if you don't want colors, or export ANSIBLE_NOCOLOR=1
#nocolor = 1

# the CA certificate path used for validating SSL certs. This path
# the CA certificate path used for validating SSL certs. This path
# should exist on the controlling node, not the target nodes
# common locations:
# RHEL/CentOS: /etc/pki/tls/certs/ca-bundle.crt
# Fedora : /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
# Ubuntu : /usr/share/ca-certificates/cacert.org/cacert.org.crt
#ca_file_path =
#ca_file_path =

# the http user-agent string to use when fetching urls. Some web server
# operators block the default urllib user agent as it is frequently used
# by malicious attacks/scripts, so we set it to something unique to
# by malicious attacks/scripts, so we set it to something unique to
# avoid issues.
#http_user_agent = ansible-agent

Expand All @@ -156,9 +156,9 @@ callback_whitelist = profile_tasks
# wanting to use, for example, IP information from one group of servers
# without having to talk to them in the same playbook run to get their
# current IP information.
fact_caching = memory
fact_caching = jsonfile
fact_caching_connection = ~/.ansible/cache
fact_caching_timeout = 86400
fact_caching_timeout = 1200


# retry files
Expand All @@ -185,33 +185,33 @@ become_method='sudo'
[ssh_connection]

# ssh arguments to use
# Leaving off ControlPersist will result in poor performance, so use
# Leaving off ControlPersist will result in poor performance, so use
# paramiko on older platforms rather than removing it
ssh_args = -o ControlMaster=auto -o ControlPersist=120s -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
ssh_args = -o ControlMaster=auto -o ControlPersist=120s -o UserKnownHostsFile=/dev/null


# The path to use for the ControlPath sockets. This defaults to
# "%(directory)s/ansible-ssh-%%h-%%p-%%r", however on some systems with
# very long hostnames or very long path names (caused by long user names or
# very long hostnames or very long path names (caused by long user names or
# deeply nested home directories) this can exceed the character limit on
# file socket names (108 characters for most platforms). In that case, you
# file socket names (108 characters for most platforms). In that case, you
# may wish to shorten the string below.
#
# Example:
#
# Example:
# control_path = %(directory)s/%%h-%%r
#control_path = %(directory)s/ansible-ssh-%%h-%%p-%%r

# Enabling pipelining reduces the number of SSH operations required to
# execute a module on the remote server. This can result in a significant
# performance improvement when enabled, however when using "sudo:" you must
# Enabling pipelining reduces the number of SSH operations required to
# execute a module on the remote server. This can result in a significant
# performance improvement when enabled, however when using "sudo:" you must
# first disable 'requiretty' in /etc/sudoers
#
# By default, this option is disabled to preserve compatibility with
# sudoers configurations that have requiretty (the default on many distros).
#
#
pipelining = True

# if True, make ansible use scp if the connection type is ssh
# if True, make ansible use scp if the connection type is ssh
# (default is sftp)
#scp_if_ssh = True

Expand All @@ -222,7 +222,7 @@ accelerate_connect_timeout = 5.0

# The daemon timeout is measured in minutes. This time is measured
# from the last activity to the accelerate daemon.
accelerate_daemon_timeout = 30
accelerate_daemon_timeout = 30

# If set to yes, accelerate_multi_key will allow multiple
# private keys to be uploaded to it, though each user must
Expand Down
2 changes: 1 addition & 1 deletion ansible/basic_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
minigraph_facts: host={{ inventory_hostname }}
tags: always

- include_tasks: roles/test/tasks/interface.yml
- include: roles/test/tasks/interface.yml

11 changes: 2 additions & 9 deletions ansible/config_sonic_basedon_testbed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
remote_dut: "{{ ansible_ssh_host }}"

- name: gather testbed VM informations
testbed_vm_info: base_vm={{ testbed_facts['vm_base'] }} topo={{ testbed_facts['topo'] }} vm_file={{ vm_file }}
# testbed_vm_info: base_vm={{ testbed_facts['vm_base'] }} topo={{ testbed_facts['topo'] }} vm_file={{ vm_file }}
testbed_vm_info: base_vm="{{vm_base}}" topo="{{topo}}"
delegate_to: localhost
when: "VM_topo | bool"

Expand All @@ -93,14 +94,6 @@
with_items: "{{ host_if_indexes }}"
when: "('host_interfaces' in vm_topo_config) and ('tor' in vm_topo_config['dut_type'] | lower)"

- name: find all vlan configurations for T0 topology
vlan_config:
vm_topo_config: "{{ vm_topo_config }}"
port_alias: "{{ port_alias }}"
vlan_config: "{{ vlan_config | default(None) }}"
delegate_to: localhost
when: "('host_interfaces' in vm_topo_config) and ('tor' in vm_topo_config['dut_type'] | lower)"

- name: find all interface indexes mapping connecting to VM
set_fact:
interface_to_vms: "{{ interface_to_vms|default({}) | combine({ item.key: item.value['interface_indexes'] }) }}"
Expand Down
6 changes: 4 additions & 2 deletions ansible/doc/README.new.testbed.Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Like the veos_groups section, this section contains information about the server
Confirm the following:
- root_path - server's root path to building the VMs
- cd_image_filename - you should be able to locate "Aboot-veos-serial-8.0.0.iso"
- hdd_image_file: you should also be able to locate "vEOS-lab-4.20.15M.vmdk"
- hdd_image_file: you should also be able to locate "vEOS-lab-4.15.10M.vmdk"

Define:
- vm_console_base - if you are running multiple sets of sonic-mgmt VMs, define a conflict-free vm_console_base
Expand Down Expand Up @@ -154,9 +154,11 @@ From the leaf-fanout to the server, make sure to define:
### docker_registry section:
**USAGE**: /vars/docker_registry.yml

The docker registry container below information:
The docker registry container 3 pieces of information:

1. docker_registry_host
2. docker_registry_username
3. docker_registry_password

If you already have this information set up, you can choose to leave this section blank and the script will skip this section.

Expand Down
24 changes: 2 additions & 22 deletions ansible/doc/README.testbed.Cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## Add/Remove topo
```
# conf-name,testbed-name,topo,ptf_image_name,ptf_ip,server,vm_base,dut,owner
# uniq-name,testbed-name,topo,ptf_image_name,ptf_ip,server,vm_base,dut,owner
vms1-1-t1,vms1-1,t1,docker-ptf-sai-mlnx,10.0.10.5/23,server_1,VM0100,str-msn2700-11,t1 tests
vms1-1-t1-lag,vms1-1,t1-lag,docker-ptf-sai-mlnx,10.0.10.5/23,server_1,VM0100,str-msn2700-11,t1-lag tests

Expand All @@ -32,7 +32,7 @@ Caveat: Have to remember what was the initial topology. Should be fixed in futur

# Renumber topo
```
# conf-name,testbed-name,topo,ptf_image_name,ptf_ip,server,vm_base,dut,owner
# uniq-name,testbed-name,topo,ptf_image_name,ptf_ip,server,vm_base,dut,owner
vms2-2-b,vms2-2,t1,docker-ptf-sai-brcm,10.0.10.7/23,server_1,VM0100,str-d6000-05,brcm test
vms2-2-m,vms2-2,t1,docker-ptf-sai-mlnx,10.0.10.7/23,server_1,VM0100,str-msn2700-5,mlnx test

Expand All @@ -48,23 +48,3 @@ Goal is to use one VM set against different DUTs
Feature: The VMs configuration will NOT be updated while switching from one topo to another (faster).

TODO: check topo field when renumbering between topologies

# Deploy Ixia IxNetwork API server
```
# conf-name,group-name,topo,ptf_image_name,ptf,ptf_ip,ptf_ipv6,server,vm_base,dut,comment
example-ixia,vms6-1,t0-64,docker-keysight-api-server,example-ixia-ptf-1,10.0.0.30/32,,server_1,,example-s6100-dut-1,Test with Keysight API Server
```
- To add a new testbed “example-ixia”:
- ./testbed-cli add-topo example-ixia ~/.password

- To remove a Keysight API server docker container
- ./testbed-cli remove-topo example-ixia ~/.password

Note that it's mandatory to name the image "docker-keysight-api-server", as that triggers the Ixia IxNetwork API server deployment.
Much like the PTF docker image, this image will be pulled from the configured docker registry.

Also, topologies with the Keysight API server will not be using any VMs.

The most recent IxNetwork API Server docker image can be found [here](http://downloads.ixiacom.com/support/downloads_and_updates/public/ixnetwork/9.00_Update-3/Ixia_IxNetworkWeb_Docker_9.00.100.213.tar.bz2).
See also the [Ixia software download](https://support.ixiacom.com/public/support-overview/product-support/downloads-updates/versions/68) page for any newer versions.

4 changes: 2 additions & 2 deletions ansible/doc/README.testbed.Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ vms-t1-lag,vms1-1,t1-lag,docker-ptf-sai-mlnx,10.255.0.178/24,server_1,VM0100,str

### ```testbed.csv``` consistency rules
```
# conf-name,testbed-name,topo,ptf_image_name,ptf_ip,server,vm_base,dut,owner
# uniq-name,testbed-name,topo,ptf_image_name,ptf_ip,server,vm_base,dut,owner
vms2-2-b,vms2-2,t1,docker-ptf-sai-brcm,10.0.10.7/23,server_1,VM0100,str-d6000-05,brcm test
vms2-2-m,vms2-2,t1,docker-ptf-sai-mlnx,10.0.10.7/23,server_1,VM0100,str-msn2700-5,mlnx test

```
Must be strictly checked in code reviews
- conf-name must be unique
- uniq-name must be unique
- All testbed records with the same testbed-name must have the same:
- ptf_ip
- server
Expand Down
Loading