diff --git a/.github/collector.py b/.github/collector.py new file mode 100644 index 00000000..92add586 --- /dev/null +++ b/.github/collector.py @@ -0,0 +1,90 @@ +#!/usr/bin/python +# coding: utf-8 -*- + +# +# GNU General Public License v3.0+ +# +# Copyright 2020 TiTom73 +# +# Licensed under the Apache License, Version 2.0 (the 'License'); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http: //www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an 'AS IS' BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os +import sys +import requests +from jinja2 import Environment, FileSystemLoader + +GH_API_ENDPOINT = 'https://api.github.com/users/arista-netdevops-community/repos' +JSON_FIELDS = { 'name':'project_name', 'description':'description', 'html_url':'homepage', 'updated_at': 'last_commit'} +TEMPLATE_MARKDOWN = 'page.md.j2' +OUTPUT_FILE = '../docs/index.md' + +def get_gh_api(url): + """ + get_gh_api Extract information using GET + + Collect Github data from their public API + Current version does not support authentication + + Parameters + ---------- + url : string + Github API string to get. + + Returns + ------- + json + Response from GH. + """ + response = requests.get(url) + if response.status_code == requests.codes.ok: + return response.json() + return {} + +def extract_fields(gh_json, fields): + """ + extract_fields Extract field from GH API data + + Extract fields from GH API data and standardize name of keys + + Parameters + ---------- + gh_json : json + JSON content from Github + fields : dict + A list of fields to extract and the name we want to use as standard. + """ + data = list() + for entry in gh_json: + cell = dict() + for field in fields: + cell[fields[field]] = entry[field] + data.append(cell) + return data + + +if __name__ == '__main__': + data = get_gh_api(url=GH_API_ENDPOINT) + projects = extract_fields(gh_json=data, fields=JSON_FIELDS) + root = os.path.dirname(os.path.abspath(__file__)) + env = Environment( loader = FileSystemLoader(root) ) + env.trim_blocks = True + env.lstrip_blocks = True + env.rstrip_blocks = True + template = env.get_template(TEMPLATE_MARKDOWN) + output = template.render(projects=projects) + filename = os.path.join(root, OUTPUT_FILE) + with open(filename, 'w') as fh: + fh.write(output) + + sys.exit(0) \ No newline at end of file diff --git a/.github/page.md.j2 b/.github/page.md.j2 new file mode 100644 index 00000000..419bc32d --- /dev/null +++ b/.github/page.md.j2 @@ -0,0 +1,29 @@ +# Arista Netdevops Community + +!!! warning + Tis page is under construction and will reflect a list of all repositories part of Arista Community Github group. + + +## About + +This page is automatically generated with a Py script to list all repositories part of [`arista-netdevops-community`](https://github.com/arista-netdevops-community) + +## List of projects + +List of all projects available in Arista Netdevops community. Feel free to go through these repositories and find your way. + +| Project's Name | Description | Last Commit | +|------------------|---------------|-------------| +{% for project in projects|sort(reverse=true,attribute='last_commit') %} +| [{{project['project_name']}}]({{project['homepage']}}) | {% if project['description'] != 'None' %} {{project['description']}} {% else %} N/A {% endif %} | Last Commit {{project['last_commit']|truncate(10,end='')}} | +{% endfor %} + + +## List of projects + +Or another presentastion + +{% for project in projects|sort(reverse=true,attribute='last_commit') %} +- __[{{project['project_name']}}]({{project['homepage']}})__: {% if project['description'] != 'None' %} {{project['description']}} {% else %} N/A {% endif %} ({{project['last_commit']|truncate(10,end='')}}) + +{% endfor %} \ No newline at end of file diff --git a/.github/requirements.txt b/.github/requirements.txt new file mode 100644 index 00000000..3009c89a --- /dev/null +++ b/.github/requirements.txt @@ -0,0 +1,14 @@ +Jinja2==2.10.3 +mistune==0.8.4 +mkdocs==1.1.2 +mkdocs-bootswatch==1.1 +requests==2.22.0 +traitlets==4.3.3 +treelib==1.5.5 +urllib3==1.25.9 +mkdocs-bootswatch==1.1 +mkdocs-material==5.1.1 +mkdocs-material-extensions==1.0b2 +fontawesome-markdown==0.2.6 +pymdown-extensions +mkdocs-rtd-dropdown \ No newline at end of file diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml new file mode 100644 index 00000000..499b439a --- /dev/null +++ b/.github/workflows/website.yml @@ -0,0 +1,27 @@ +name: Mkdocs +on: + # Rebuild every day at 00:00 + schedule: + - cron: '0 0 * * *' + # Or on every push as it can change output + push: +jobs: + 'doc': + name: 'Update Public documentation' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: 'Setup Python 3 on runner' + uses: actions/setup-python@v1.2.0 + with: + python-version: '3.x' + - name: 'Build mkdocs content to site folder' + run: | + pip install -r .github/requirements.txt + python .github/collector.py + mkdocs build -f mkdocs.yml + - name: 'Deploy last version to gh-pages' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./site \ No newline at end of file diff --git a/README.md b/README.md index 9fdf72e9..1bf99a0a 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This repository is a central place where Arista demos and examples around netdevops methodology.

- +

## Available content @@ -20,7 +20,7 @@ This repository is a central place where Arista demos and examples around netdev - [__Ansible to sync configlets across CV servers__](ansible/ansible-sync-configlets): Content to synchronize configlets from one CV server to another. Complete documenation is available on our [EOS Central Knowledge base](https://eos.arista.com/synchronising-cloudvision-portal-configlets-with-ansible/) ### Virtual Labs -- [__List of some EVE-NG topologies leveraging vEOS and CV__](virtual_lab/EVE-NG): +- [__List of some EVE-NG topologies leveraging vEOS and CV__](virtual_lab/EVE-NG): - [__L3 Leaf-Spine w/ BGP Unnumbered & EVPN VXLAN__](virtual_lab/EVE-NG/labs/L3LS_Unnumbered_DCI_Type5): full Layer 3 Leaf-Spine fabric in a 2 datacenter setup with BGP Unnumbered and VXLAN/EVPN - [__NSX-T and EVPN in EVE-NG lab__](virtual_lab/EVE-NG/labs/NSX-T_EVPN_Type-5): Lab to demonstrate integration of Arista EOS running EVPN with Vmware NSX-T integration. diff --git a/docs/github.md b/docs/github.md new file mode 100644 index 00000000..e1907183 --- /dev/null +++ b/docs/github.md @@ -0,0 +1,41 @@ +![](https://img.shields.io/badge/Arista-CVP%20Automation-blue) ![](https://img.shields.io/badge/Arista-EOS%20Automation-blue) ![GitHub](https://img.shields.io/github/license/aristanetworks/netdevops-examples) + +# Arista Netdevops Examples + +## About + +This repository is a central place where Arista demos and examples around netdevops methodology. + + +## Available content + +### Demo Content + +- [__Arista Validated Design__](https://github.com/aristanetworks/netdevops-examples/tree/master/ansible/avd-evpn-l3ls-1/): Generate EOS EVPN/VXLAN Fabric deployed using CloudVision and with pre/post deployment tests. +- [__Zero Touch Provisioning to EVPN Fabric__](https://github.com/aristanetworks/netdevops-examples/tree/master/ansible/ztp-avd-cvp): Build a complete EVPN/VXLAN fabric using CloudVision and Zero Touch Provisioning process. +- [__Ansible AVD & CVP Transfer of Information__](https://github.com/aristanetworks/netdevops-examples/tree/master/ansible/avd-cvp-toi): Content to build a Transfer of Information on Arista Validated Design and Cloudvision collection. +- [__Ansible to sync configlets across CV servers__](https://github.com/aristanetworks/netdevops-examples/tree/master/ansible/ansible-sync-configlets): Content to synchronize configlets from one CV server to another. Complete documenation is available on our [EOS Central Knowledge base](https://eos.arista.com/synchronising-cloudvision-portal-configlets-with-ansible/) + +### Virtual Labs +- [__List of some EVE-NG topologies leveraging vEOS and CV__](https://github.com/aristanetworks/netdevops-examples/tree/master/virtual_lab/EVE-NG): +- [__L3 Leaf-Spine w/ BGP Unnumbered & EVPN VXLAN__](https://github.com/aristanetworks/netdevops-examples/tree/master/virtual_lab/EVE-NG/labs/L3LS_Unnumbered_DCI_Type5): full Layer 3 Leaf-Spine fabric in a 2 datacenter setup with BGP Unnumbered and VXLAN/EVPN +- [__NSX-T and EVPN in EVE-NG lab__](https://github.com/aristanetworks/netdevops-examples/tree/master/virtual_lab/EVE-NG/labs/NSX-T_EVPN_Type-5): Lab to demonstrate integration of Arista EOS running EVPN with Vmware NSX-T integration. + +### Webinar & Presentation content + +- [__Network Field Days 22__](https://github.com/aristanetworks/netdevops-examples/tree/master/demo/ansible-batfish-cv-nfd22/): Ansible & Batfish ([NFD22 webpage](https://techfieldday.com/appearance/arista-networks-presents-at-networking-field-day-22/)) +- [__Tech Friday March 2020__](https://github.com/aristanetworks/netdevops-examples/tree/master/demo/tech-friday-march2020/): Lab used during Tech Friday event. +- [__Network Automation with Ansible & Cloudvision - EMEA Webinar April 2020__](https://github.com/aristanetworks/netdevops-examples/tree/master/demo/emea-2020-ansible-cvp-automation): Build an EVPN/VXLAN Fabric using Ansible & Cloudvision with pot deployment validation using WARD +- [__Network Field Days 22__](https://github.com/aristanetworks/netdevops-examples/tree/master/demo/ansible-batfish-cv-nfd22/): Ansible & Batfish ([NFD22 webpage](https://techfieldday.com/appearance/arista-networks-presents-at-networking-field-day-22/)). + +## License + +All examples and demos available in this repository are provided under [Apache License](https://github.com/aristanetworks/netdevops-examples/tree/master/LICENSE) + +# Ask question or report issue + +Please open an issue on Github this is the fastest way to get an answer. + +# Contribute + +Contributing pull requests are gladly welcomed for this repository. If you are planning a big change, please start a discussion first to make sure we’ll be able to merge it. diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..71165408 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,31 @@ +# Arista Netdevops Community + +!!! warning + Tis page is under construction and will reflect a list of all repositories part of Arista Community Github group. + + +## About + +This page is automatically generated with a Py script to list all repositories part of [`arista-netdevops-community`](https://github.com/arista-netdevops-community) + +## List of projects + +List of all projects available in Arista Netdevops community. Feel free to go through these repositories and find your way. + +| Project's Name | Description | Last Commit | +|------------------|---------------|-------------| +| [kvm-lab-for-network-engineers](https://github.com/arista-netdevops-community/kvm-lab-for-network-engineers) | cheatsheet explaining how to build vEOS lab based on KVM | Last Commit 2020-06-03 | +| [CVP_Provisioning](https://github.com/arista-netdevops-community/CVP_Provisioning) | None | Last Commit 2020-05-26 | +| [docker-avd-base](https://github.com/arista-netdevops-community/docker-avd-base) | None | Last Commit 2020-05-01 | + + +## List of projects + +Or another presentastion + +- __[kvm-lab-for-network-engineers](https://github.com/arista-netdevops-community/kvm-lab-for-network-engineers)__: cheatsheet explaining how to build vEOS lab based on KVM (2020-06-03) + +- __[CVP_Provisioning](https://github.com/arista-netdevops-community/CVP_Provisioning)__: None (2020-05-26) + +- __[docker-avd-base](https://github.com/arista-netdevops-community/docker-avd-base)__: None (2020-05-01) + diff --git a/media/figure-1-arista-automation.png b/docs/media/figure-1-arista-automation.png similarity index 100% rename from media/figure-1-arista-automation.png rename to docs/media/figure-1-arista-automation.png diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css new file mode 100644 index 00000000..70dc52d7 --- /dev/null +++ b/docs/stylesheets/extra.css @@ -0,0 +1,84 @@ +:root { + /* Color schema based on Arista Color Schema */ + /* Default color shades */ + --md-default-fg-color: #000000; + --md-default-fg-color--light: #a1a0a0; + --md-default-fg-color--lighter: #FFFFFF; + --md-default-fg-color--lightest: #FFFFFF; + --md-default-bg-color: #FFFFFF; + --md-default-bg-color--light: #FFFFFF; + --md-default-bg-color--lighter: #FFFFFF; + --md-default-bg-color--lightest: #FFFFFF; + + /* Primary color shades */ + --md-primary-fg-color: #5487B7; + --md-primary-fg-color--light: #FFFFFF; + --md-primary-fg-color--dark: #5487B7; + --md-primary-bg-color: #FFFFFF; + --md-primary-bg-color--light: #FFFFFF; + + /* Accent color shades */ + --md-accent-fg-color: #5487B7; + --md-accent-bg-color: #5487B7; + --md-accent-bg-color--light: #5487B7; + + /* Code block color shades */ + --md-code-bg-color: #f6f8fa; + /* --md-code-fg-color: ...; */ +} + +@media only screen and (min-width: 76.25em) { + .md-main__inner { + max-width: 85%; + } + .md-sidebar--primary { + left: 5%; + } + .md-sidebar--secondary { + right: 5%; + margin-left: 0; + -webkit-transform: none; + transform: none; + } +} + +@media only screen { + .md-footer-nav { + background-color: var(--md-default-bg-color--light); + color: var(--md-accent-fg-color--transparent) + } + .md-typeset code { + padding: 0 .2941176471em; + font-size: 1; + word-break: break-word; + background-color: var(--md-code-bg-color); + border-radius: .1rem; + -webkit-box-decoration-break: clone; + box-decoration-break: clone; + } + .md-footer { + height: 2%; + } + .md-footer-nav__direction { + position: absolute; + right: 0; + left: 0; + margin-top: -1rem; + padding: 0 1rem; + color: var(--md-default-fg-color--light); + font-size: .64rem; + } + .md-footer-nav__title { + font-size: .9rem; + line-height: 2.4rem; + color: var(--md-default-fg-color--light); + } + .md-typeset table:not([class]) th { + min-width: 5rem; + padding: .6rem .8rem; + color: var(--md-default-fg-color--lighter); + vertical-align: top; + background-color: var(--md-accent-bg-color); +} +} + diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000..ea87ee41 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,49 @@ +site_name: Arista Devops Community +site_author: Arista Ansible Team +site_description: A List of contribution in devops world +docs_dir: docs/ +theme: + name: 'readthedocs' + features: + - instant + font: + text: Ubuntu + code: Ubuntu Mono +extra_css: + - stylesheets/extra.css +copyright: Copyright © 2019 - 2020 Arista Networks +repo_name: 'Arista Netdevops Community' +repo_url: https://github.com/aristanetworks/netdevops-examples +use_directory_urls: true +nav: + - Arista Netdevops Repositories: index.md + - Existing Netdevops Examples: github.md + - About: + - Ansible Galaxy page: https://galaxy.ansible.com/arista/cvp + - Arista Validated Design: https://github.com/aristanetworks/ansible-avd + - Arista Automation Community: https://github.com/arista-netdevops-community + +markdown_extensions: + - smarty + - pymdownx.arithmatex + - pymdownx.betterem: + smart_enable: all + - pymdownx.caret + - pymdownx.critic + - pymdownx.details + - pymdownx.inlinehilite + - pymdownx.magiclink + - pymdownx.mark + - pymdownx.smartsymbols + - pymdownx.superfences + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.tilde + - fontawesome_markdown + - admonition + - codehilite: + guess_lang: true + - toc: + separator: "-" + permalink: "#" + baselevel: 1