Skip to content
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 18 additions & 30 deletions ansible/README.deploy.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,32 @@
# Deploy SONiC with ansible playbook

This doc describes the steps for deploy SONiC software on top of SONiC base image.
This doc describes the steps for deploy SONiC software on top of SONiC base image. By default,
the playbook will use public [sonicdev debian APT repository](http://packages.microsoft.com/repos/sonic-dev/)
and public [sonicdev Docker registry](https://sonicdev-microsoft.azurecr.io/).

## Requirements

- Prepare a switch with the SONiC base image. See [this link](https://github.com/Azure/SONiC/blob/gh-pages/quickstart.md)
- Setup debian APT repository for deb packages to be installed into the base image directly, such as [DELL platform drivers](https://github.com/Azure/sonic-platform-modules-s6000).
- Setup Docker registry for docker images, such as syncd docker built from [sonic-buildimage](https://github.com/Azure/sonic-buildimage)

Packages and docker images must be uploaded to the repositories before running following steps.

### Setup docker registry

- Update vars/docker_registry.yml:
* docker_registry_host = FQDN:port of your docker registry
* docker_registry_username = username of your docker registry
* docker_registry_password = password of your docker registry

### Setup debian repository

- Prepare debian repository
* TBD

- Update roles/sonic-common/files/apt/sonic.gpg.key with the contents of your apt repo signing key.
- If you are using your own APT repo or docker registry, packages and docker images must be uploaded to the repositories before running following steps.

## Deploy SONiC

- Update inventory file with appropriate information for your environment:
- Update [inventory](/ansible/inventory/) file with correct information for your environment.
* ansible_host = management ip address
* sonic_hwsku = Supported Hardware SKU, e.g. ACS-S6000
- Update group_vars/sonic/vars file with:
* Replace 'password' with your own passwords. Note: Leave the initial_password as 123456.
* apt_repo_ip = The ip address (or FQDN) of your APT mirror, typically private.
* [ntp,syslog,dns]_servers = A list of your server IPs for these services.
* snmp_rocommunity = your internal snmp community string.
* Replace sonicadmin_user and ansible_ssh_user with the username you built into the baseimage
- Update host_vars/switch1/minigraph_facts.yml:
* Update minigraph_mgmt_interface block with the address/gateway/mask/prefix information for your management interface
* sonic_hwsku = Supported Hardware SKU, e.g. ACS-S6000, ACS-MSN2700
- Update [group_vars/sonic/vars](/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.
* Update APT repository if you are using private repo.
* Update Docker [registry](/vars/docker_registry.yml/) if you are using private registry.
- Update management IP of switch1
* Find the ManagementIPInterfaces xml block in [minigraph/switch1.xml](/minigraph/switch1.xml/) and change both IP addresses.

- Run the playbook:

```
ansible-playbook deploy_sonic.yml -i inventory --limit switch1 --become -e "bootstrap=yes"
```

Note: '-e "bootstrap=yes"' passes a special flag to update the initial admin password to the permenant password. This is not required after the first run.
Note: ```-e "bootstrap=yes"``` passes a special flag to update the initial admin password to the permanent password. This is not required after the first run.
Loading