NSO-Services CI #449
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: NSO-Services CI | |
on: | |
pull_request_review: | |
types: [ submitted ] | |
branches: [ main ] | |
jobs: | |
build-lab-xe: | |
runs-on: self-hosted | |
container: | |
image: ghcr.io/model-driven-devops/ansible-mdd/mdd:1.2.10 | |
if: github.event.review.state == 'approved' | |
steps: | |
- run: echo "The name of your repository is ${{ github.repository }}." | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- run: echo "The ${{ github.repository }} repository has been cloned to the runner." | |
- run: echo "The workflow is now ready to test your code on the runner." | |
- name: Create Archive of the mdd directory | |
run: | | |
tar -czvf mdd.tgz mdd | |
- name: update ubuntu | |
run: apt-get update | |
- name: install sshpass | |
run: apt-get install sshpass -y | |
- name: install git | |
run: apt-get install git -y | |
- name: clone mdd | |
run: git clone https://github.com/model-driven-devops/mdd.git mdd_repo | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Install PIP requirements | |
run: pip install -r ./mdd_repo/requirements.txt | |
- name: Install PIP virl2_client | |
run: pip install ./mdd_repo/files/virl2_client-2.4.0+build.2-py3-none-any.whl | |
- name: Install Collections | |
run: ansible-galaxy collection install -r ./mdd_repo/requirements.yml | |
- name: Remove nso-oc from runner to use our latest changes for testing | |
run: pip uninstall nso-oc -y | |
- name: Delete CML | |
run: ansible-playbook cisco.cml.clean | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
- name: Build CML | |
run: ansible-playbook cisco.cml.build -e startup='host' -e wait='yes' -e cml_lab_file=/__w/nso-oc-services/nso-oc-services/test/arch/test_lab_xe.yaml | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
- name: Build NSO | |
run: ansible-playbook ciscops.mdd.nso_install | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
- name: Install NSO MDD package | |
run: ansible-playbook ./test/install-nso-oc-services.yml | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
- name: NSO add default auth group | |
run: ansible-playbook ciscops.mdd.nso_init | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
- name: Inventory CML | |
run: ansible-playbook cisco.cml.inventory | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
- name: NSO add devices from inventory | |
run: ansible-playbook ciscops.mdd.nso_update_devices | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
- name: NSO Re-sync configuration from the devices | |
run: ansible-playbook ciscops.mdd.nso_sync_from | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
- name: Save host IPs | |
run: ansible-playbook ./test/save_cml_node_ips.yml | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
- name: Write contents of xeswitch1 IP file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/xeswitch1_host.txt >> $GITHUB_ENV | |
- name: PIP Install paramiko | |
run: pip install paramiko | |
- name: Reload XESWITCH1 | |
run: python3 ./test/tools/reload_ios.py | |
env: | |
XESWITCH1_HOST: ${{ env.XESWITCH1_HOST }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
- name: Inventory CML | |
run: ansible-playbook cisco.cml.inventory | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
- name: NSO add devices from inventory | |
run: ansible-playbook ciscops.mdd.nso_update_devices | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
- name: NSO Re-sync configuration from the devices | |
run: ansible-playbook ciscops.mdd.nso_sync_from | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
test-oc-xe: | |
runs-on: self-hosted | |
container: | |
image: ghcr.io/model-driven-devops/ansible-mdd/mdd:1.2.10 | |
if: github.event.review.state == 'approved' | |
needs: build-lab-xe | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- run: echo "The workflow is now ready to test your code on the runner." | |
- name: update ubuntu | |
run: apt-get update | |
- name: install sshpass | |
run: apt-get install sshpass -y | |
- name: install git | |
run: apt-get install git -y | |
- name: clone mdd | |
run: git clone https://github.com/model-driven-devops/mdd.git mdd_repo | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Install PIP requirements | |
run: pip install -r ./mdd_repo/requirements.txt | |
- name: Install PIP virl2_client | |
run: pip install ./mdd_repo/files/virl2_client-2.4.0+build.2-py3-none-any.whl | |
- name: Install Collections | |
run: ansible-galaxy collection install -r ./mdd_repo/requirements.yml | |
- name: Remove nso-oc from runner to use our latest changes for testing | |
run: pip uninstall nso-oc -y | |
- name: Inventory CML | |
run: ansible-playbook cisco.cml.inventory | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
- name: Save host IPs | |
run: ansible-playbook ./test/save_cml_node_ips.yml | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
- name: Write contents of nso URL file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/nso_url.txt >> $GITHUB_ENV | |
- name: Write contents of nso IP file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/nso_host.txt >> $GITHUB_ENV | |
- name: Write contents of xe1 IP file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/xe1_host.txt >> $GITHUB_ENV | |
- name: Write contents of xeswitch1 IP file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/xeswitch1_host.txt >> $GITHUB_ENV | |
- name: Run NSO Services XE Tests | |
run: | | |
cd ./test/tests/xe | |
FILES=$(ls ./*.yml) | |
for PLAYBOOK in $FILES | |
do | |
echo $PLAYBOOK | |
ansible-playbook $PLAYBOOK --skip-tags="iosxr,nxos" | |
done | |
env: | |
NSO_URL: ${{ env.NSO_URL }} | |
NSO_HOST: ${{ env.NSO_HOST }} | |
XE1_HOST: ${{ env.XE1_HOST }} | |
XESWITCH1_HOST: ${{ env.XESWITCH1_HOST }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_dev_xe.cfg | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
remove-mdd-logic-xe: | |
runs-on: self-hosted | |
container: | |
image: ghcr.io/model-driven-devops/ansible-mdd/mdd:1.2.10 | |
if: github.event.review.state == 'approved' | |
needs: test-oc-xe | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- run: echo "The workflow is now ready to test your code on the runner." | |
- name: update ubuntu | |
run: apt-get update | |
- name: install sshpass | |
run: apt-get install sshpass -y | |
- name: install git | |
run: apt-get install git -y | |
- name: clone mdd | |
run: git clone https://github.com/model-driven-devops/mdd.git mdd_repo | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Install PIP requirements | |
run: pip install -r ./mdd_repo/requirements.txt | |
- name: Install PIP virl2_client | |
run: pip install ./mdd_repo/files/virl2_client-2.4.0+build.2-py3-none-any.whl | |
- name: Install Collections | |
run: ansible-galaxy collection install -r ./mdd_repo/requirements.yml | |
- name: Remove nso-oc from runner to use our latest changes for testing | |
run: pip uninstall nso-oc -y | |
- name: NSO MDD remove logic for NSO to OC testing | |
run: ansible-playbook ./test/remove_mdd_logic.yml | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
test-xe-oc: | |
runs-on: self-hosted | |
container: | |
image: ghcr.io/model-driven-devops/ansible-mdd/mdd:1.2.10 | |
if: github.event.review.state == 'approved' | |
needs: remove-mdd-logic-xe | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- run: echo "The workflow is now ready to test your code on the runner." | |
- name: update ubuntu | |
run: apt-get update | |
- name: install sshpass | |
run: apt-get install sshpass -y | |
- name: install git | |
run: apt-get install git -y | |
- name: clone mdd | |
run: git clone https://github.com/model-driven-devops/mdd.git mdd_repo | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Install PIP requirements | |
run: pip install -r ./mdd_repo/requirements.txt | |
- name: Install PIP virl2_client | |
run: pip install ./mdd_repo/files/virl2_client-2.4.0+build.2-py3-none-any.whl | |
- name: Install Collections | |
run: ansible-galaxy collection install -r ./mdd_repo/requirements.yml | |
- name: Remove nso-oc from runner to use our latest changes for testing | |
run: pip uninstall nso-oc -y | |
- name: Inventory CML | |
run: ansible-playbook cisco.cml.inventory | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
- name: Save host IPs | |
run: ansible-playbook ./test/save_cml_node_ips.yml | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XE | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xe.cfg | |
- name: Write contents of nso URL file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/nso_url.txt >> $GITHUB_ENV | |
- name: Write contents of nso IP file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/nso_host.txt >> $GITHUB_ENV | |
- name: Write contents of xe1 IP file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/xe1_host.txt >> $GITHUB_ENV | |
- name: Write contents of xeswitch1 IP file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/xeswitch1_host.txt >> $GITHUB_ENV | |
- name: Run NSO Device NED configuration to Openconfig configuration Tests | |
run: | | |
cd ./test/tests_nso_to_oc/xe | |
FILES=$(ls ./*.yml) | |
for PLAYBOOK in $FILES | |
do | |
echo $PLAYBOOK | |
ansible-playbook $PLAYBOOK | |
done | |
env: | |
NSO_URL: ${{ env.NSO_URL }} | |
NSO_HOST: ${{ env.NSO_HOST }} | |
XE1_HOST: ${{ env.XE1_HOST }} | |
XESWITCH1_HOST: ${{ env.XESWITCH1_HOST }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_dev_xe.cfg | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
TEST: "True" | |
build-lab-xr: | |
runs-on: self-hosted | |
container: | |
image: ghcr.io/model-driven-devops/ansible-mdd/mdd:1.2.10 | |
if: github.event.review.state == 'approved' | |
steps: | |
- name: Sleep 10 seconds to stagger downloads | |
run: sleep 10 | |
shell: bash | |
- run: echo "The name of your repository is ${{ github.repository }}." | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- run: echo "The ${{ github.repository }} repository has been cloned to the runner." | |
- run: echo "The workflow is now ready to test your code on the runner." | |
- name: Create Archive of the mdd directory | |
run: | | |
tar -czvf mdd.tgz mdd | |
- name: update ubuntu | |
run: apt-get update | |
- name: install sshpass | |
run: apt-get install sshpass -y | |
- name: install git | |
run: apt-get install git -y | |
- name: clone mdd | |
run: git clone https://github.com/model-driven-devops/mdd.git mdd_repo | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Install PIP requirements | |
run: pip install -r ./mdd_repo/requirements.txt | |
- name: Install PIP virl2_client | |
run: pip install ./mdd_repo/files/virl2_client-2.4.0+build.2-py3-none-any.whl | |
- name: Install Collections | |
run: ansible-galaxy collection install -r ./mdd_repo/requirements.yml | |
- name: Remove nso-oc from runner to use our latest changes for testing | |
run: pip uninstall nso-oc -y | |
- name: Delete CML | |
run: ansible-playbook cisco.cml.clean | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XR | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xr.cfg | |
- name: Build CML | |
run: ansible-playbook cisco.cml.build -e startup='host' -e wait='yes' -e cml_lab_file=/__w/nso-oc-services/nso-oc-services/test/arch/test_lab_xr.yaml | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XR | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xr.cfg | |
- name: Build NSO | |
run: ansible-playbook ciscops.mdd.nso_install | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XR | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xr.cfg | |
- name: Install NSO MDD package | |
run: ansible-playbook ./test/install-nso-oc-services.yml | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XR | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xr.cfg | |
- name: NSO add default auth group | |
run: ansible-playbook ciscops.mdd.nso_init | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XR | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xr.cfg | |
- name: Inventory CML | |
run: ansible-playbook cisco.cml.inventory | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XR | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xr.cfg | |
- name: Sleep while XR1 loads for 6 minutes | |
run: sleep 6m | |
shell: bash | |
- name: NSO add devices from inventory | |
run: ansible-playbook ciscops.mdd.nso_update_devices | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XR | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xr.cfg | |
- name: NSO Re-sync configuration from the devices | |
run: ansible-playbook ciscops.mdd.nso_sync_from | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XR | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xr.cfg | |
test-oc-xr: | |
runs-on: self-hosted | |
container: | |
image: ghcr.io/model-driven-devops/ansible-mdd/mdd:1.2.10 | |
if: github.event.review.state == 'approved' | |
needs: build-lab-xr | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- run: echo "The workflow is now ready to test your code on the runner." | |
- name: update ubuntu | |
run: apt-get update | |
- name: install sshpass | |
run: apt-get install sshpass -y | |
- name: install git | |
run: apt-get install git -y | |
- name: clone mdd | |
run: git clone https://github.com/model-driven-devops/mdd.git mdd_repo | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Install PIP requirements | |
run: pip install -r ./mdd_repo/requirements.txt | |
- name: Install PIP virl2_client | |
run: pip install ./mdd_repo/files/virl2_client-2.4.0+build.2-py3-none-any.whl | |
- name: Install Collections | |
run: ansible-galaxy collection install -r ./mdd_repo/requirements.yml | |
- name: Remove nso-oc from runner to use our latest changes for testing | |
run: pip uninstall nso-oc -y | |
- name: Inventory CML | |
run: ansible-playbook cisco.cml.inventory | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XR | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xr.cfg | |
- name: Save host IPs | |
run: ansible-playbook ./test/save_cml_node_ips.yml | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XR | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xr.cfg | |
- name: Write contents of nso URL file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/nso_url.txt >> $GITHUB_ENV | |
- name: Write contents of nso IP file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/nso_host.txt >> $GITHUB_ENV | |
- name: Write contents of xr1 IP file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/xr1_host.txt >> $GITHUB_ENV | |
- name: Run NSO Services XR Tests | |
run: | | |
cd ./test/tests/xr | |
FILES=$(ls ./*.yml) | |
for PLAYBOOK in $FILES | |
do | |
echo $PLAYBOOK | |
ansible-playbook $PLAYBOOK --skip-tags="ios,nxos" | |
done | |
env: | |
NSO_URL: ${{ env.NSO_URL }} | |
NSO_HOST: ${{ env.NSO_HOST }} | |
XR1_HOST: ${{ env.XR1_HOST }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_dev_xr.cfg | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
remove-mdd-logic-xr: | |
runs-on: self-hosted | |
container: | |
image: ghcr.io/model-driven-devops/ansible-mdd/mdd:1.2.10 | |
if: github.event.review.state == 'approved' | |
needs: test-oc-xr | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- run: echo "The workflow is now ready to test your code on the runner." | |
- name: update ubuntu | |
run: apt-get update | |
- name: install sshpass | |
run: apt-get install sshpass -y | |
- name: install git | |
run: apt-get install git -y | |
- name: clone mdd | |
run: git clone https://github.com/model-driven-devops/mdd.git mdd_repo | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Install PIP requirements | |
run: pip install -r ./mdd_repo/requirements.txt | |
- name: Install PIP virl2_client | |
run: pip install ./mdd_repo/files/virl2_client-2.4.0+build.2-py3-none-any.whl | |
- name: Install Collections | |
run: ansible-galaxy collection install -r ./mdd_repo/requirements.yml | |
- name: Remove nso-oc from runner to use our latest changes for testing | |
run: pip uninstall nso-oc -y | |
- name: NSO MDD remove logic for NSO to OC testing | |
run: ansible-playbook ./test/remove_mdd_logic.yml | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XR | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xr.cfg | |
test-xr-oc: | |
runs-on: self-hosted | |
container: | |
image: ghcr.io/model-driven-devops/ansible-mdd/mdd:1.2.10 | |
if: github.event.review.state == 'approved' | |
needs: remove-mdd-logic-xr | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- run: echo "The workflow is now ready to test your code on the runner." | |
- name: update ubuntu | |
run: apt-get update | |
- name: install sshpass | |
run: apt-get install sshpass -y | |
- name: install git | |
run: apt-get install git -y | |
- name: clone mdd | |
run: git clone https://github.com/model-driven-devops/mdd.git mdd_repo | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Install PIP requirements | |
run: pip install -r ./mdd_repo/requirements.txt | |
- name: Install PIP virl2_client | |
run: pip install ./mdd_repo/files/virl2_client-2.4.0+build.2-py3-none-any.whl | |
- name: Install Collections | |
run: ansible-galaxy collection install -r ./mdd_repo/requirements.yml | |
- name: Remove nso-oc from runner to use our latest changes for testing | |
run: pip uninstall nso-oc -y | |
- name: Inventory CML | |
run: ansible-playbook cisco.cml.inventory | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XR | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xr.cfg | |
- name: Save host IPs | |
run: ansible-playbook ./test/save_cml_node_ips.yml | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_XR | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_xr.cfg | |
- name: Write contents of nso URL file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/nso_url.txt >> $GITHUB_ENV | |
- name: Write contents of nso IP file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/nso_host.txt >> $GITHUB_ENV | |
- name: Write contents of xr1 IP file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/xr1_host.txt >> $GITHUB_ENV | |
- name: Run NSO Device NED configuration to Openconfig configuration Tests | |
run: | | |
cd ./test/tests_nso_to_oc/xr | |
FILES=$(ls ./*.yml) | |
for PLAYBOOK in $FILES | |
do | |
echo $PLAYBOOK | |
ansible-playbook $PLAYBOOK | |
done | |
env: | |
NSO_URL: ${{ env.NSO_URL }} | |
NSO_HOST: ${{ env.NSO_HOST }} | |
XR1_HOST: ${{ env.XR1_HOST }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_dev_xr.cfg | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
TEST: "True" | |
build-lab-nx: | |
runs-on: self-hosted | |
container: | |
image: ghcr.io/model-driven-devops/ansible-mdd/mdd:1.2.10 | |
if: github.event.review.state == 'approved' | |
steps: | |
- name: Sleep 20 seconds to stagger downloads | |
run: sleep 20 | |
shell: bash | |
- run: echo "The name of your repository is ${{ github.repository }}." | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- run: echo "The ${{ github.repository }} repository has been cloned to the runner." | |
- run: echo "The workflow is now ready to test your code on the runner." | |
- name: Create Archive of the mdd directory | |
run: | | |
tar -czvf mdd.tgz mdd | |
- name: update ubuntu | |
run: apt-get update | |
- name: install sshpass | |
run: apt-get install sshpass -y | |
- name: install git | |
run: apt-get install git -y | |
- name: clone mdd | |
run: git clone https://github.com/model-driven-devops/mdd.git mdd_repo | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Install PIP requirements | |
run: pip install -r ./mdd_repo/requirements.txt | |
- name: Install PIP virl2_client | |
run: pip install ./mdd_repo/files/virl2_client-2.4.0+build.2-py3-none-any.whl | |
- name: Install Collections | |
run: ansible-galaxy collection install -r ./mdd_repo/requirements.yml | |
- name: Remove nso-oc from runner to use our latest changes for testing | |
run: pip uninstall nso-oc -y | |
- name: Delete CML | |
run: ansible-playbook cisco.cml.clean | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_NX | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_nx.cfg | |
- name: Build CML | |
run: ansible-playbook cisco.cml.build -e startup='host' -e wait='yes' -e cml_lab_file=/__w/nso-oc-services/nso-oc-services/test/arch/test_lab_nx.yaml | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_NX | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_nx.cfg | |
- name: Build NSO | |
run: ansible-playbook ciscops.mdd.nso_install | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_NX | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_nx.cfg | |
- name: Install NSO MDD package | |
run: ansible-playbook ./test/install-nso-oc-services.yml | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_NX | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_nx.cfg | |
- name: NSO add default auth group | |
run: ansible-playbook ciscops.mdd.nso_init | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_NX | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_nx.cfg | |
- name: Inventory CML | |
run: ansible-playbook cisco.cml.inventory | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_NX | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_nx.cfg | |
- name: NSO add devices from inventory | |
run: ansible-playbook ciscops.mdd.nso_update_devices | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_NX | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_nx.cfg | |
- name: NSO Re-sync configuration from the devices | |
run: ansible-playbook ciscops.mdd.nso_sync_from | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_NX | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_nx.cfg | |
test-oc-nx: | |
runs-on: self-hosted | |
container: | |
image: ghcr.io/model-driven-devops/ansible-mdd/mdd:1.2.10 | |
if: github.event.review.state == 'approved' | |
needs: build-lab-nx | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- run: echo "The workflow is now ready to test your code on the runner." | |
- name: update ubuntu | |
run: apt-get update | |
- name: install sshpass | |
run: apt-get install sshpass -y | |
- name: install git | |
run: apt-get install git -y | |
- name: clone mdd | |
run: git clone https://github.com/model-driven-devops/mdd.git mdd_repo | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Install PIP requirements | |
run: pip install -r ./mdd_repo/requirements.txt | |
- name: Install PIP virl2_client | |
run: pip install ./mdd_repo/files/virl2_client-2.4.0+build.2-py3-none-any.whl | |
- name: Install Collections | |
run: ansible-galaxy collection install -r ./mdd_repo/requirements.yml | |
- name: Remove nso-oc from runner to use our latest changes for testing | |
run: pip uninstall nso-oc -y | |
- name: Inventory CML | |
run: ansible-playbook cisco.cml.inventory | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_NX | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_nx.cfg | |
- name: Save host IPs | |
run: ansible-playbook ./test/save_cml_node_ips.yml | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_NX | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_nx.cfg | |
- name: Write contents of nso URL file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/nso_url.txt >> $GITHUB_ENV | |
- name: Write contents of nso IP file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/nso_host.txt >> $GITHUB_ENV | |
- name: Write contents of nx1 IP file to envars | |
run: | | |
cat /__w/nso-oc-services/nso-oc-services/nx1_host.txt >> $GITHUB_ENV | |
- name: Run NSO Services NX Tests | |
run: | | |
cd ./test/tests/nx | |
FILES=$(ls ./*.yml) | |
for PLAYBOOK in $FILES | |
do | |
echo $PLAYBOOK | |
ansible-playbook $PLAYBOOK --skip-tags="ios,iosxr" | |
done | |
env: | |
NSO_URL: ${{ env.NSO_URL }} | |
NSO_HOST: ${{ env.NSO_HOST }} | |
NX1_HOST: ${{ env.NX1_HOST }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_dev_nx.cfg | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
remove-mdd-logic-nx: | |
runs-on: self-hosted | |
container: | |
image: ghcr.io/model-driven-devops/ansible-mdd/mdd:1.2.10 | |
if: github.event.review.state == 'approved' | |
needs: test-oc-nx | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- run: echo "The workflow is now ready to test your code on the runner." | |
- name: update ubuntu | |
run: apt-get update | |
- name: install sshpass | |
run: apt-get install sshpass -y | |
- name: install git | |
run: apt-get install git -y | |
- name: clone mdd | |
run: git clone https://github.com/model-driven-devops/mdd.git mdd_repo | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Install PIP requirements | |
run: pip install -r ./mdd_repo/requirements.txt | |
- name: Install PIP virl2_client | |
run: pip install ./mdd_repo/files/virl2_client-2.4.0+build.2-py3-none-any.whl | |
- name: Install Collections | |
run: ansible-galaxy collection install -r ./mdd_repo/requirements.yml | |
- name: Remove nso-oc from runner to use our latest changes for testing | |
run: pip uninstall nso-oc -y | |
- name: NSO MDD remove logic for NSO to OC testing | |
run: ansible-playbook ./test/remove_mdd_logic.yml | |
env: | |
ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
CML_HOST: ${{ secrets.CML_HOST }} | |
CML_LAB: ${{ github.ref_name }}_NX | |
CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
CML_VERIFY_CERT: "false" | |
NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_nx.cfg | |
# test-nx-oc: | |
# runs-on: self-hosted | |
# container: | |
# image: ghcr.io/model-driven-devops/ansible-mdd/mdd:1.2.10 | |
# if: github.event.review.state == 'approved' | |
# needs: remove-mdd-logic-nx | |
# steps: | |
# - name: Check out repository code | |
# uses: actions/checkout@v2 | |
# - run: echo "The workflow is now ready to test your code on the runner." | |
# - name: update ubuntu | |
# run: apt-get update | |
# - name: install sshpass | |
# run: apt-get install sshpass -y | |
# - name: install git | |
# run: apt-get install git -y | |
# - name: clone mdd | |
# run: git clone https://github.com/model-driven-devops/mdd.git mdd_repo | |
# - name: Upgrade pip | |
# run: pip install --upgrade pip | |
# - name: Install PIP requirements | |
# run: pip install -r ./mdd_repo/requirements.txt | |
# - name: Install PIP virl2_client | |
# run: pip install ./mdd_repo/files/virl2_client-2.4.0+build.2-py3-none-any.whl | |
# - name: Install Collections | |
# run: ansible-galaxy collection install -r ./mdd_repo/requirements.yml | |
# - name: Remove nso-oc from runner to use our latest changes for testing | |
# run: pip uninstall nso-oc -y | |
# - name: Inventory CML | |
# run: ansible-playbook cisco.cml.inventory | |
# env: | |
# ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
# CML_HOST: ${{ secrets.CML_HOST }} | |
# CML_LAB: ${{ github.ref_name }}_NX | |
# CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
# CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
# CML_VERIFY_CERT: "false" | |
# ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_nx.cfg | |
# - name: Save host IPs | |
# run: ansible-playbook ./test/save_cml_node_ips.yml | |
# env: | |
# ANSIBLE_PYTHON_INTERPRETER: "${VIRTUAL_ENV}/bin/python3" | |
# CML_HOST: ${{ secrets.CML_HOST }} | |
# CML_LAB: ${{ github.ref_name }}_NX | |
# CML_USERNAME: ${{ secrets.CML_USERNAME }} | |
# CML_PASSWORD: ${{ secrets.CML_PASSWORD }} | |
# CML_VERIFY_CERT: "false" | |
# ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_nx.cfg | |
# - name: Write contents of nso URL file to envars | |
# run: | | |
# cat /__w/nso-oc-services/nso-oc-services/nso_url.txt >> $GITHUB_ENV | |
# - name: Write contents of nso IP file to envars | |
# run: | | |
# cat /__w/nso-oc-services/nso-oc-services/nso_host.txt >> $GITHUB_ENV | |
# - name: Write contents of nx1 IP file to envars | |
# run: | | |
# cat /__w/nso-oc-services/nso-oc-services/nx1_host.txt >> $GITHUB_ENV | |
# - name: Run NSO Device NED configuration to Openconfig configuration Tests | |
# run: | | |
# cd ./test/tests_nso_to_oc/nx | |
# FILES=$(ls ./*.yml) | |
# for PLAYBOOK in $FILES | |
# do | |
# echo $PLAYBOOK | |
# ansible-playbook $PLAYBOOK | |
# done | |
# env: | |
# NSO_URL: ${{ env.NSO_URL }} | |
# NSO_HOST: ${{ env.NSO_HOST }} | |
# NX1_HOST: ${{ env.NX1_HOST }} | |
# ANSIBLE_CONFIG: /__w/nso-oc-services/nso-oc-services/test/ansible_dev_nx.cfg | |
# NSO_USERNAME: ${{ secrets.NSO_USERNAME }} | |
# NSO_PASSWORD: ${{ secrets.NSO_PASSWORD }} | |
# NSO_DEVICES_USERNAME: ${{ secrets.NSO_DEVICES_USERNAME }} | |
# NSO_DEVICES_PASSWORD: ${{ secrets.NSO_DEVICES_PASSWORD }} | |
# TEST: "True" |