add tsg-env roles.

This commit is contained in:
lijia
2019-09-18 11:00:57 +08:00
parent 732bc3e002
commit 7510d26241
13 changed files with 233 additions and 3 deletions

View File

@@ -5,21 +5,25 @@
- hosts: blade-00
roles:
- tsg-env-mcn0
- mrzcpd
- kni
- certstore
- hosts: blade-01
roles:
- tsg-env-mcn1
- mrzcpd
- tfe
- hosts: blade-02
roles:
- tsg-env-mcn2
- mrzcpd
- tfe
- hosts: blade-03
roles:
- tsg-env-mcn3
- mrzcpd
- tfe

View File

@@ -0,0 +1,28 @@
#!/bin/bash
ifconfig ens1 up
modprobe 8021q
vconfig add ens1 100
vconfig set_flag ens1.100 1 1
ifconfig ens1.100 192.168.100.1 netmask 255.255.255.0 up
echo 0 > /sys/class/net/ens1/device/sriov_numvfs
sleep 1
echo 8 > /sys/class/net/ens1/device/sriov_numvfs
sleep 1
ifconfig ens1f3 up
ip link set ens1 vf 2 vlan 200
ifconfig ens1f3 192.168.200.1 netmask 255.255.255.0
ifconfig enp7s0 up
ifconfig enp8s0 up
ifconfig ens1f1 up
ifconfig ens1f2 up
ifconfig ens1f3 up
ifconfig ens1f4 up
ifconfig ens1f5 up
ifconfig ens1f6 up
ifconfig ens1f7 up
ifconfig enp1s1 up

View File

@@ -0,0 +1,14 @@
[Unit]
Description=tsg env init
Requires=network.target
After=network.target
Before=mrenv.service
[Service]
ExecStart=/opt/tsg/env/setup
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
RequiredBy=mrenv.service

View File

@@ -0,0 +1,19 @@
---
- name: "copy setup.sh"
copy:
src: "{{ role_path }}/files/setup"
dest: "/opt/tsg/env/"
mode: 0755
- name: "copy tsg-env.service"
copy:
src: "{{ role_path }}/files/tsg-env.service"
dest: "/usr/lib/systemd/system/"
mode: 0644
- name: "enable tsg-env"
systemd:
name: tsg-env
enabled: yes
daemon_reload: yes

View File

@@ -0,0 +1,25 @@
#!/bin/bash
ifconfig ens1 up
modprobe 8021q
vconfig add ens1 100
vconfig set_flag ens1.100 1 1
ifconfig ens1.100 192.168.100.2 netmask 255.255.255.0 up
echo 0 > /sys/class/net/ens1/device/sriov_numvfs
sleep 1
echo 3 > /sys/class/net/ens1/device/sriov_numvfs
sleep 1
ifconfig ens1f3 up
ip link set ens1 vf 2 vlan 200
ifconfig ens1f3 192.168.200.2 netmask 255.255.255.0
ifconfig enp7s0 up
ifconfig enp8s0 up
ifconfig ens1f1 up
ifconfig ens1f2 up
ifconfig ens1f3 up

View File

@@ -0,0 +1,14 @@
[Unit]
Description=tsg env init
Requires=network.target
After=network.target
Before=tfe-env.service
[Service]
ExecStart=/opt/tsg/env/setup
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
RequiredBy=tfe-env.service

View File

@@ -0,0 +1,18 @@
---
- name: "copy setup.sh"
copy:
src: "{{ role_path }}/files/setup"
dest: "/opt/tsg/env/"
mode: 0755
- name: "copy tsg-env.service"
copy:
src: "{{ role_path }}/files/tsg-env.service"
dest: "/usr/lib/systemd/system/"
mode: 0644
- name: "enable tsg-env"
systemd:
name: tsg-env
enabled: yes
daemon_reload: yes

View File

@@ -0,0 +1,23 @@
#!/bin/bash
ifconfig ens8 up
modprobe 8021q
vconfig add ens8 100
vconfig set_flag ens8.100 1 1
ifconfig ens8.100 192.168.100.3 netmask 255.255.255.0 up
echo 0 > /sys/class/net/ens8/device/sriov_numvfs
sleep 1
echo 3 > /sys/class/net/ens8/device/sriov_numvfs
sleep 1
ifconfig ens8f3 up
ip link set ens8 vf 2 vlan 200
ifconfig ens8f3 192.168.200.3 netmask 255.255.255.0
ifconfig enp7s0 up
ifconfig enp8s0 up
ifconfig ens8f1 up
ifconfig ens8f2 up
ifconfig ens8f3 up
ifconfig ens8f4 up

View File

@@ -0,0 +1,14 @@
[Unit]
Description=tsg env init
Requires=network.target
After=network.target
Before=tfe-env.service
[Service]
ExecStart=/opt/tsg/env/setup
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
RequiredBy=tfe-env.service

View File

@@ -0,0 +1,18 @@
---
- name: "copy setup.sh"
copy:
src: "{{ role_path }}/files/setup"
dest: "/opt/tsg/env/"
mode: 0755
- name: "copy tsg-env.service"
copy:
src: "{{ role_path }}/files/tsg-env.service"
dest: "/usr/lib/systemd/system/"
mode: 0644
- name: "enable tsg-env"
systemd:
name: tsg-env
enabled: yes
daemon_reload: yes

View File

@@ -0,0 +1,21 @@
#!/bin/bash
ifconfig ens8 up
modprobe 8021q
vconfig add ens8 100
vconfig set_flag ens8.100 1 1
ifconfig ens8.100 192.168.100.4 netmask 255.255.255.0 up
echo 0 > /sys/class/net/ens8/device/sriov_numvfs
sleep 1
echo 3 > /sys/class/net/ens8/device/sriov_numvfs
sleep 1
ifconfig ens8f3 up
ip link set ens8 vf 2 vlan 200
ifconfig ens8f3 192.168.200.4 netmask 255.255.255.0
ifconfig enp7s0 up
ifconfig enp8s0 up
ifconfig ens8f1 up
ifconfig ens8f2 up
ifconfig ens8f3 up

View File

@@ -0,0 +1,14 @@
[Unit]
Description=tsg env init
Requires=network.target
After=network.target
Before=tfe-env.service
[Service]
ExecStart=/opt/tsg/env/setup
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
RequiredBy=tfe-env.service

View File

@@ -0,0 +1,18 @@
---
- name: "copy setup.sh"
copy:
src: "{{ role_path }}/files/setup"
dest: "/opt/tsg/env/"
mode: 0755
- name: "copy tsg-env.service"
copy:
src: "{{ role_path }}/files/tsg-env.service"
dest: "/usr/lib/systemd/system/"
mode: 0644
- name: "enable tsg-env"
systemd:
name: tsg-env
enabled: yes
daemon_reload: yes