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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions config/instances.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,41 @@
provider_config:
bms:
ssh_pwd: password
ssh_user: root
ntpserver: 0.debian.pool.ntp.org
domainsuffix: local
instances:
bms1:
mgmt:
provider: bms
ip: 192.168.1.100
ip: 10.0.34.239
roles:
config_database:
config:
control:
analytics_database:
analytics:
webui:
kvm1:
provider: bms
ip: 10.0.35.177
roles:
vrouter:
kvm2:
provider: bms
ip: 10.0.35.195
roles:
vrouter:
kvm3:
provider: bms
ip: 10.0.35.196
roles:
vrouter:
global_configuration:
CONTAINER_REGISTRY: michaelhenkel
CONTAINER_REGISTRY: tungstenfabric
contrail_configuration:
CONTRAIL_VERSION: queens-5.0-20180219195722
CONTRAIL_VERSION: latest
CONFIG_NODEMGR__DEFAULTS__minimum_diskGB: 2
DATABASE_NODEMGR__DEFAULTS__minimum_diskGB: 2
CONFIG_DATABASE_NODEMGR__DEFAULTS__minimum_diskGB: 2
UPGRADE_KERNEL: true
ansible_os_family: "RedHat"
41 changes: 41 additions & 0 deletions config/instances.yaml.centos7.opencontrail
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
provider_config:
bms:
ssh_pwd: password
ssh_user: root
ntpserver: 0.debian.pool.ntp.org
domainsuffix: local
instances:
controller:
provider: bms
ip: 10.0.34.228
roles:
config_database:
config:
control:
analytics_database:
analytics:
webui:
gateway:
provider: bms
ip: 172.20.0.180
roles:
vrouter:
kvm1:
provider: bms
ip: 172.20.0.181
roles:
vrouter:
kvm2:
provider: bms
ip: 172.20.0.182
roles:
vrouter:
global_configuration:
contrail_configuration:
CONTRAIL_VERSION: latest
CONFIG_NODEMGR__DEFAULTS__minimum_diskGB: 2
DATABASE_NODEMGR__DEFAULTS__minimum_diskGB: 2
CONFIG_DATABASE_NODEMGR__DEFAULTS__minimum_diskGB: 2
UPGRADE_KERNEL: true
VROUTER_GATEWAY: 172.20.0.1
ansible_os_family: "RedHat"
10 changes: 10 additions & 0 deletions config/instances.yaml.orig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
provider_config:
bms:
instances:
bms1:
provider: bms
ip: 192.168.1.100
global_configuration:
CONTAINER_REGISTRY: michaelhenkel
contrail_configuration:
CONTRAIL_VERSION: queens-5.0-20180219195722
47 changes: 47 additions & 0 deletions config/instances.yaml.rocky8.private
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
provider_config:
bms:
ssh_pwd: password
ssh_user: root
ntpserver: 0.debian.pool.ntp.org
domainsuffix: local
instances:
controller:
provider: bms
ip: 10.0.34.228
roles:
config_database:
config:
control:
analytics_database:
analytics:
webui:
gateway:
provider: bms
ip: 172.20.0.180
roles:
vrouter:
kvm1:
provider: bms
ip: 172.20.0.181
roles:
vrouter:
kvm2:
provider: bms
ip: 172.20.0.182
roles:
vrouter:
global_configuration:
CONTAINER_REGISTRY: 10.0.34.8:5000/tungstenfabric
REGISTRY_PRIVATE_INSECURE: true
CONTAINER_REGISTRY_USERNAME: username
CONTAINER_REGISTRY_PASSWORD: password
contrail_configuration:
CONTRAIL_VERSION: "2023-03-10"
CONFIG_NODEMGR__DEFAULTS__minimum_diskGB: 2
DATABASE_NODEMGR__DEFAULTS__minimum_diskGB: 2
CONFIG_DATABASE_NODEMGR__DEFAULTS__minimum_diskGB: 2
UPGRADE_KERNEL: false
VROUTER_GATEWAY: 172.20.0.1
#CONTROL_NODES:
ansible_os_family: "RedHat"
ansible_python_interpreter: /usr/bin/python3
44 changes: 44 additions & 0 deletions config/instances.yaml.rocky8.tungstenfabric
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
provider_config:
bms:
ssh_pwd: password
ssh_user: root
ntpserver: 0.debian.pool.ntp.org
domainsuffix: local
instances:
controller:
provider: bms
ip: 10.0.34.228
roles:
config_database:
config:
control:
analytics_database:
analytics:
webui:
gateway:
provider: bms
ip: 172.20.0.180
roles:
vrouter:
kvm1:
provider: bms
ip: 172.20.0.181
roles:
vrouter:
kvm2:
provider: bms
ip: 172.20.0.182
roles:
vrouter:
global_configuration:
CONTAINER_REGISTRY: tungstenfabric
contrail_configuration:
CONTRAIL_VERSION: "2023-03-10"
CONFIG_NODEMGR__DEFAULTS__minimum_diskGB: 2
DATABASE_NODEMGR__DEFAULTS__minimum_diskGB: 2
CONFIG_DATABASE_NODEMGR__DEFAULTS__minimum_diskGB: 2
UPGRADE_KERNEL: false
VROUTER_GATEWAY: 172.20.0.1
#CONTROL_NODES:
ansible_os_family: "RedHat"
ansible_python_interpreter: /usr/bin/python3
47 changes: 47 additions & 0 deletions config/instances.yaml.ubuntu22.private
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
provider_config:
bms:
ssh_pwd: password
ssh_user: root
ntpserver: 0.debian.pool.ntp.org
domainsuffix: local
instances:
controller:
provider: bms
ip: 10.0.34.228
roles:
config_database:
config:
control:
analytics_database:
analytics:
webui:
gateway:
provider: bms
ip: 172.20.0.180
roles:
vrouter:
kvm1:
provider: bms
ip: 172.20.0.181
roles:
vrouter:
kvm2:
provider: bms
ip: 172.20.0.182
roles:
vrouter:
global_configuration:
CONTAINER_REGISTRY: 10.0.34.8:5000/tungstenfabric
REGISTRY_PRIVATE_INSECURE: true
CONTAINER_REGISTRY_USERNAME: username
CONTAINER_REGISTRY_PASSWORD: password
contrail_configuration:
CONTRAIL_VERSION: "2023-03-10"
CONFIG_NODEMGR__DEFAULTS__minimum_diskGB: 2
DATABASE_NODEMGR__DEFAULTS__minimum_diskGB: 2
CONFIG_DATABASE_NODEMGR__DEFAULTS__minimum_diskGB: 2
UPGRADE_KERNEL: false
VROUTER_GATEWAY: 172.20.0.1
#CONTROL_NODES:
ansible_os_family: "Debian"
ansible_python_interpreter: /usr/bin/python3
69 changes: 69 additions & 0 deletions deploy_tungsten_centos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

# 1. Get OS version

if [ -f /etc/redhat-release ] ; then
DIST=`cat /etc/redhat-release | awk '{print $1}'`
CODENAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/redhat-release | awk '{print $3,$4}' | grep -o "[0-9.]*"`
elif [ -f /etc/lsb-release ] ; then
DIST=`cat /etc/lsb-release | grep DISTRIB_ID | tr "\n" ' '| sed s/.*=//`
REV=`cat /etc/lsb-release | grep DISTRIB_RELEASE | tr "\n" ' '| sed s/.*=//`
CODENAME=`cat /etc/lsb-release | grep DISTRIB_CODENAME | tr "\n" ' '| sed s/.*=//`
elif [ -f /etc/os-release ] ; then
DIST=`grep -e "^NAME=" /etc/os-release | awk -F\" '{print $2}'`
REV=`grep -e "^VERSION_ID=" /etc/os-release | awk -F\" '{print $2}'`
CODENAME=`grep -e "^PRETTY_NAME=" /etc/os-release | awk -F\" '{print $2}'`
fi

if [[ ! $REV =~ ^8.* ]] && [[ ! $REV =~ ^7.* ]];then
echo "This script can ONLY be executed on CentOS/Rocky 7/8"
exit 1
fi

# 2. Install packages

if [[ $REV =~ ^7.* ]];then
yum install -y epel-release sshpass
rpm -qa |grep python2-pip || yum install -y python2-pip

pip install pip==20.3.4
pip install requests
pip install --ignore-installed PyYAML
pip install ansible==2.7.18
elif [[ $REV =~ ^8.* ]];then
pip3 -V || yum install -y python3-pip
pip3 install --upgrade pip
pip3 install requests
pip3 install --upgrade PyYAML
ls /usr/bin/python || ln -s /usr/bin/python3 /usr/bin/python

ansible-playbook -v || yum install -y epel-release && yum install -y ansible
pip3 install --upgrade ansible
fi

# 3. Configure instances

ansible-playbook -i inventory/ -e orchestrator=none playbooks/configure_instances.yml && \

# 4. Install contrail

ansible-playbook -i inventory/ -e orchestrator=none playbooks/install_contrail.yml && \

# 5. DONE

ui_ip=$(python -c "
import yaml
configs=yaml.safe_load(open('config/instances.yaml'))
ui_ip=None
for server in configs['instances']:
if 'webui' in configs['instances'][server]['roles'].keys():
ui_ip=configs['instances'][server]['ip']
break
print(ui_ip)
") && \

echo "Tungsten has been installed successfully." && \
echo "Please access the web UI using admin/contrail123" && \
echo "- https://${ui_ip}:8143" && \
echo "- http://${ui_ip}:8180"
2 changes: 1 addition & 1 deletion playbooks/roles/contrail_analytics/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
dest: /etc/contrail/analytics/docker-compose.yaml

- name: start contrail analytics
docker_service:
docker_compose:
project_src: /etc/contrail/analytics
environment:
DOCKER_CLIENT_TIMEOUT: '120'
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/contrail_analytics/tasks/stop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: stop contrail analytics
docker_service:
docker_compose:
project_src: /etc/contrail/analytics
state: absent
environment:
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/contrail_analytics_alarm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
dest: /etc/contrail/analytics_alarm/docker-compose.yaml

- name: start contrail analytics_alarm
docker_service:
docker_compose:
project_src: /etc/contrail/analytics_alarm
environment:
DOCKER_CLIENT_TIMEOUT: '120'
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/contrail_analytics_alarm/tasks/stop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: stop contrail analytics_alarm
docker_service:
docker_compose:
project_src: /etc/contrail/analytics_alarm
state: absent
environment:
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/contrail_analytics_database/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
dest: /etc/contrail/analytics_database/docker-compose.yaml

- name: start contrail analyticsdb
docker_service:
docker_compose:
project_src: /etc/contrail/analytics_database
environment:
DOCKER_CLIENT_TIMEOUT: '120'
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/contrail_analytics_database/tasks/stop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: stop contrail analyticsdb
docker_service:
docker_compose:
project_src: /etc/contrail/analytics_database
state: absent
environment:
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/contrail_analytics_snmp/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
dest: /etc/contrail/analytics_snmp/docker-compose.yaml

- name: start contrail analytics_snmp
docker_service:
docker_compose:
project_src: /etc/contrail/analytics_snmp
environment:
DOCKER_CLIENT_TIMEOUT: '120'
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/contrail_analytics_snmp/tasks/stop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: stop contrail analytics_snmp
docker_service:
docker_compose:
project_src: /etc/contrail/analytics_snmp
state: absent
environment:
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/contrail_compute_legacy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
dest: "/etc/contrail/compute-legacy/docker-compose.yaml"

- name: "start contrail compute-legacy"
docker_service:
docker_compose:
project_src: /etc/contrail/compute-legacy
environment:
DOCKER_CLIENT_TIMEOUT: '120'
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/contrail_config/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
dest: /etc/contrail/config/docker-compose.yaml

- name: start contrail config
docker_service:
docker_compose:
project_src: /etc/contrail/config
environment:
DOCKER_CLIENT_TIMEOUT: '120'
Expand Down
Loading