Skip to content

Commit 91bfa17

Browse files
authored
Improvements and bug fixes (#126)
1 parent 697ed5b commit 91bfa17

File tree

93 files changed

+4009
-4435
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+4009
-4435
lines changed

.ansible-lint

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
exclude_paths:
2+
- terraform-sdwan/
3+
- .github/
4+
- files/
5+
- extras/
6+
- docs/
7+
- licenses/
8+
- myCA/
9+

.github/workflows/ci.yml

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,30 @@ env:
2121
ANSIBLE_VAULT_PASSWORD: '${{ secrets.ANSIBLE_VAULT_PASSWORD }}'
2222

2323
jobs:
24+
lint:
25+
runs-on: self-hosted
26+
steps:
27+
- name: Checkout Inventory
28+
uses: actions/checkout@v2
29+
with:
30+
submodules: recursive
31+
- name: Run ansible-lint
32+
run: ansible-lint
2433
test_19_2_1:
2534
runs-on: self-hosted
2635
concurrency: hq2
36+
needs: lint
2737
env:
2838
VIRL_LAB: 'sdwan-devops-hq2'
2939
VIPTELA_VERSION: '19.2.1'
3040
CLOUDINIT_TYPE: 'v1'
3141
IOSXE_SDWAN_IMAGE: 'iosxe-sdwan-16.12.2r'
32-
CSR1000V_IMAGE: 'csr1000v-170101'
33-
42+
CSR1000V_IMAGE: 'csr1000v-170101'
3443
steps:
3544
- name: Checkout Inventory
3645
uses: actions/checkout@v2
3746
with:
3847
submodules: recursive
39-
- name: Install PIP requirements
40-
run: pip install -r requirements.txt
4148
- name: Clean Existing Deployment
4249
run: ansible-playbook -i inventory/hq2 clean-virl.yml --tags delete
4350
- name: Install Licenses
@@ -50,18 +57,19 @@ jobs:
5057
- name: Build VMware
5158
run: ansible-playbook -i inventory/hq2 build-virl.yml
5259
- name: Configure Control Plane
53-
run: ansible-playbook -i inventory/hq2 config-virl.yml
60+
run: ansible-playbook -i inventory/hq2 config-sdwan.yml
5461
- name: Deploy Edges
5562
run: ansible-playbook -i inventory/hq2 deploy-virl.yml
5663
- name: Wait for Edges to Sync
5764
run: ansible-playbook -i inventory/hq2 waitfor-sync.yml
5865
- name: Check SD-WAN
5966
run: ansible-playbook -i inventory/hq2 check-sdwan.yml
6067
- name: Cleanup
61-
run: ansible-playbook -i inventory/hq2 clean-virl.yml --tags delete
68+
run: ansible-playbook -i inventory/hq2 clean-virl.yml
6269
test_20_3_2:
6370
runs-on: self-hosted
6471
concurrency: hq2
72+
needs: lint
6573
env:
6674
VIRL_LAB: 'sdwan-devops-hq2'
6775
VIPTELA_VERSION: '20.3.2'
@@ -73,8 +81,6 @@ jobs:
7381
uses: actions/checkout@v2
7482
with:
7583
submodules: recursive
76-
- name: Install PIP requirements
77-
run: pip install -r requirements.txt
7884
- name: Clean Existing Deployment
7985
run: ansible-playbook -i inventory/hq2 clean-virl.yml --tags delete
8086
- name: Install Licenses
@@ -87,12 +93,48 @@ jobs:
8793
- name: Build VMware
8894
run: ansible-playbook -i inventory/hq2 build-virl.yml
8995
- name: Configure Control Plane
90-
run: ansible-playbook -i inventory/hq2 config-virl.yml
96+
run: ansible-playbook -i inventory/hq2 config-sdwan.yml
9197
- name: Deploy Edges
9298
run: ansible-playbook -i inventory/hq2 deploy-virl.yml
9399
- name: Wait for Edges to Sync
94100
run: ansible-playbook -i inventory/hq2 waitfor-sync.yml
95101
- name: Check SD-WAN
96102
run: ansible-playbook -i inventory/hq2 check-sdwan.yml
97103
- name: Cleanup
98-
run: ansible-playbook -i inventory/hq2 clean-virl.yml --tags delete
104+
run: ansible-playbook -i inventory/hq2 clean-virl.yml
105+
test_20_7_1:
106+
runs-on: self-hosted
107+
concurrency: hq2
108+
needs: lint
109+
env:
110+
VIRL_LAB: 'sdwan-devops-hq2'
111+
VIPTELA_VERSION: '20.7.1'
112+
CLOUDINIT_TYPE: 'v2'
113+
IOSXE_SDWAN_IMAGE: 'iosxe-sdwan-16.12.2r'
114+
CSR1000V_IMAGE: 'csr1000v-170101'
115+
steps:
116+
- name: Checkout Inventory
117+
uses: actions/checkout@v2
118+
with:
119+
submodules: recursive
120+
- name: Clean Existing Deployment
121+
run: ansible-playbook -i inventory/hq2 clean-virl.yml
122+
- name: Install Licenses
123+
run: |
124+
mkdir licenses
125+
echo $ANSIBLE_VAULT_PASSWORD > vault-password-file
126+
ansible-vault decrypt --vault-password-file vault-password-file files/serialFile.viptela --output licenses/serialFile.viptela
127+
- name: Build CA
128+
run: ansible-playbook -i inventory/hq2 build-ca.yml
129+
- name: Build VMware
130+
run: ansible-playbook -i inventory/hq2 build-virl.yml
131+
- name: Configure Control Plane
132+
run: ansible-playbook -i inventory/hq2 config-sdwan.yml
133+
- name: Deploy Edges
134+
run: ansible-playbook -i inventory/hq2 deploy-virl.yml
135+
- name: Wait for Edges to Sync
136+
run: ansible-playbook -i inventory/hq2 waitfor-sync.yml
137+
- name: Check SD-WAN
138+
run: ansible-playbook -i inventory/hq2 check-sdwan.yml
139+
- name: Cleanup
140+
run: ansible-playbook -i inventory/hq2 clean-virl.yml

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ build-control:
4747
config-control:
4848
stage: config-control
4949
script:
50-
- ansible-playbook config-virl.yml
50+
- ansible-playbook config-sdwan.yml
5151
only:
5252
changes:
5353
- files/hq1.yaml

Dockerfile

Lines changed: 27 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,40 @@
11
FROM alpine:3.11
22

33
ARG build_date=unspecified
4-
ARG terraform_version=0.12.24
5-
# ARG virl2_client_pkg=virl2_client-2.1.0b9-py3-none-any.whl
64

75
LABEL org.opencontainers.image.title="Cisco-SDWAN" \
86
org.opencontainers.image.description="Cisco SDWAN DevOps" \
97
org.opencontainers.image.vendor="Cisco Systems" \
108
org.opencontainers.image.created="${build_date}" \
119
org.opencontainers.image.url="https://github.com/CiscoDevNet/sdwan-devops"
1210

11+
RUN apk add --no-cache gcc musl-dev make
12+
13+
RUN apk add --no-cache python3
14+
RUN if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi
15+
16+
RUN python3 -m ensurepip
17+
# RUN rm -r /usr/lib/python*/ensurepip
18+
RUN pip3 install --no-cache --upgrade pip setuptools wheel
19+
# RUN if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi
20+
21+
RUN apk --update add git sshpass libffi-dev libxml2-dev libxslt-dev python3-dev openssl-dev openssh-keygen
22+
1323
COPY requirements.txt /tmp/requirements.txt
14-
# COPY files/${virl2_client_pkg} /tmp/${virl2_client_pkg}
15-
16-
RUN echo "===> Installing GCC <===" && \
17-
apk add --no-cache gcc musl-dev make && \
18-
\
19-
\
20-
echo "===> Installing Python <===" && \
21-
apk add --no-cache python3 && \
22-
if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi && \
23-
\
24-
\
25-
echo "===> Installing pip <===" && \
26-
python3 -m ensurepip && \
27-
rm -r /usr/lib/python*/ensurepip && \
28-
pip3 install --no-cache --upgrade pip setuptools wheel && \
29-
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
30-
\
31-
\
32-
echo "===> Installing dependancies <===" && \
33-
apk --update add sshpass libffi-dev libxml2-dev libxslt-dev python3-dev openssl-dev openssh-keygen && \
34-
\
35-
\
36-
echo "===> Installing PIP Requirements <===" && \
37-
pip install -r /tmp/requirements.txt && \
38-
\
39-
\
40-
# echo "===> Installing local virl2 client <===" && \
41-
# pip install /tmp/${virl2_client_pkg} && \
42-
# \
43-
# \
44-
echo "===> Installing Terraform <===" && \
45-
apk --update add wget unzip cdrkit curl && \
46-
\
47-
\
48-
wget --quiet https://releases.hashicorp.com/terraform/${terraform_version}/terraform_${terraform_version}_linux_amd64.zip && \
49-
unzip terraform_${terraform_version}_linux_amd64.zip && \
50-
mv terraform /usr/bin && \
51-
rm terraform_${terraform_version}_linux_amd64.zip
52-
53-
ENV ANSIBLE_HOST_KEY_CHECKING=false \
54-
ANSIBLE_RETRY_FILES_ENABLED=false \
55-
ANSIBLE_SSH_PIPELINING=true
24+
RUN pip install -r /tmp/requirements.txt
25+
26+
ARG terraform_version=0.13.7
27+
28+
RUN apk --update add wget unzip cdrkit curl
29+
RUN wget --quiet https://releases.hashicorp.com/terraform/${terraform_version}/terraform_${terraform_version}_linux_amd64.zip
30+
RUN unzip terraform_${terraform_version}_linux_amd64.zip
31+
RUN mv terraform /usr/bin
32+
RUN rm terraform_${terraform_version}_linux_amd64.zip
33+
34+
ENV ANSIBLE_HOST_KEY_CHECKING=false
35+
ENV ANSIBLE_RETRY_FILES_ENABLED=false
36+
ENV ANSIBLE_SSH_PIPELINING=true
37+
ENV ANSIBLE_LOCAL_TMP=/tmp
38+
ENV ANSIBLE_REMOTE_TMP=/tmp
5639

5740
WORKDIR /ansible

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ If you want to skip all the info and documentation below and just run the automa
2626
- [Build the hq1 topology in CML](docs/virl-hq1.md)
2727
- [Build the hq2 topology in CML](docs/virl-hq2.md)
2828
- [Build the hq2 topology in VMware](docs/vmware-hq2.md)
29+
- [GitLab CI pipeline](docs/gitlab.md)
2930

3031
## Software Dependancies
3132

@@ -69,9 +70,8 @@ Simulation can be used for developing new deployments as well as testing changes
6970
* `build-virl.yml` or `build-vmware.yml`
7071
* Creates Day0 config for VNFs based on the data in the `sdwan.yml` file
7172
* Provision and start VNFs on virtual infrastructure
72-
* `config-virl.yml` or `config-vmware.yml`
73-
* Configure setting on vmanage
74-
* Install Enterprise CA when required
73+
* `config-sdwan.yml`
74+
* Configure settings on vmanage
7575
* Add vbonds and vsmarts to vmanage
7676
* Create CSRs for vbonds and vsmarts
7777
* Install certificates into vmanage

ansible.cfg.docker

Lines changed: 0 additions & 17 deletions
This file was deleted.

bootstrap-cedge.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

build-ca.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,24 @@
1515
- name: Generate an OpenSSL private key.
1616
openssl_privatekey:
1717
cipher: des3
18-
passphrase: "{{ sdwan_CA_passphrase }}"
18+
passphrase: "{{ sdwan_ca_passphrase }}"
1919
path: "{{ sdwan_cert_dir }}/myCA.key"
2020

2121
- name: Generate an OpenSSL CSR.
2222
openssl_csr:
2323
path: "{{ sdwan_cert_dir }}/myCA.csr"
2424
privatekey_path: "{{ sdwan_cert_dir }}/myCA.key"
25-
privatekey_passphrase: "{{ sdwan_CA_passphrase }}"
25+
privatekey_passphrase: "{{ sdwan_ca_passphrase }}"
26+
basic_constraints_critical: true
27+
basic_constraints:
28+
- CA:TRUE
2629
common_name: viptelaCA.local
2730

2831
- name: Generate a Self Signed OpenSSL certificate.
2932
openssl_certificate:
3033
path: "{{ sdwan_cert_dir }}/myCA.pem"
3134
privatekey_path: "{{ sdwan_cert_dir }}/myCA.key"
32-
privatekey_passphrase: "{{ sdwan_CA_passphrase }}"
35+
privatekey_passphrase: "{{ sdwan_ca_passphrase }}"
3336
csr_path: "{{ sdwan_cert_dir }}/myCA.csr"
3437
# select_crypto_backend: pyopenssl
3538
provider: selfsigned

build-vmware.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
- name: Generate day0 configs for control hosts
2+
hosts: sdwan_control
3+
connection: local
4+
gather_facts: no
5+
tasks:
6+
- name: Generating day0 config
7+
set_fact:
8+
day0_config: "{{ lookup('template', virl_config_template) }}"
9+
when: virl_config_template is defined
10+
111
- import_playbook: terraform-apply.yml
212
vars:
3-
sdwan_type: control
13+
sdwan_type: control

check-sdwan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
connection: local
44
gather_facts: no
55
roles:
6-
- sdwan-tests
6+
- sdwan_tests
77
vars:
88
vmanage_host: "{{ groups.vmanage_hosts | first }}"
99
vmanage_mgmt_interface: "{{ hostvars[vmanage_host].mgmt_interface | default('ansible_host') }}"
1010
vmanage_ip: "{{ hostvars[vmanage_host][vmanage_mgmt_interface] | ipaddr('address') }}"
1111
state: present
1212
tasks:
1313
- include_role:
14-
name: sdwan-tests
14+
name: sdwan_tests
1515
tasks_from: ping-test
1616
vars:
1717
ping_dst_ip: "{{ item.dst_ip }}"

0 commit comments

Comments
 (0)