From bd2b48747d35ea487362f78e4d43fec9a8bd178d Mon Sep 17 00:00:00 2001 From: fumingwei Date: Fri, 18 Jun 2021 16:17:11 +0800 Subject: [PATCH] =?UTF-8?q?7400=20adapt:=E5=90=88=E5=B9=B6tsg=5F9140=5Fdep?= =?UTF-8?q?loy.yml=E5=92=8Ctsg=5F7400=5Fdeploy.yml=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=88=B0stage=5Fone=5Fdeploy.yml=EF=BC=8C=E5=90=88=E5=B9=B6ans?= =?UTF-8?q?ible-stage-one-7400=E5=92=8Cansible-stage-one-9140=E5=88=B0ansi?= =?UTF-8?q?ble-stage-one?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...g_7400_deploy.yml => stage_one_deploy.yml} | 29 +++++++++++++++- ansible/tsg_9140_deploy.yml | 33 ------------------- make/Makefile.7400MCN0P01R01 | 2 +- make/Makefile.7400MCN123P01R01 | 2 +- make/Makefile.9000NPBP01R01 | 2 +- tools/ansible-stage-one | 14 ++++++++ tools/ansible-stage-one-7400 | 14 -------- tools/ansible-stage-one-9000 | 14 -------- 8 files changed, 45 insertions(+), 65 deletions(-) rename ansible/{tsg_7400_deploy.yml => stage_one_deploy.yml} (60%) delete mode 100644 ansible/tsg_9140_deploy.yml create mode 100644 tools/ansible-stage-one delete mode 100755 tools/ansible-stage-one-7400 delete mode 100755 tools/ansible-stage-one-9000 diff --git a/ansible/tsg_7400_deploy.yml b/ansible/stage_one_deploy.yml similarity index 60% rename from ansible/tsg_7400_deploy.yml rename to ansible/stage_one_deploy.yml index b856eafb..c05eb0f0 100644 --- a/ansible/tsg_7400_deploy.yml +++ b/ansible/stage_one_deploy.yml @@ -39,4 +39,31 @@ - {role: mrzcpd, tags: mrzcpd} - {role: exporter, tags: exporter} - {role: tsg_sn, tags: tsg_sn} - - {role: tfe, tags: tfe} \ No newline at end of file + - {role: tfe, tags: tfe} + +- hosts: 9000-NPB-P01R01 + remote_user: root + vars_files: + - install_config/group_vars/stage_one_9000NPBP01R01.yml + - install_config/group_vars/rpm_version.yml + roles: + - {role: tsg-os-provision, tags: tsg-os-provision} + - {role: tsg_device_tag, tags: tsg_device_tag} + - {role: tsg_sn, tags: tsg_sn} + - {role: framework, tags: framework} + - {role: mrzcpd, tags: mrzcpd} + - {role: sapp, tags: sapp} + - {role: tsg_master, tags: tsg_master} + - {role: kni, tags: kni} + - {role: firewall, tags: firewall} + - {role: tsg_app, tags: tsg_app} + - {role: i40e-drive, tags: i40e-drive} + - {role: redis, tags: redis} + - {role: certstore, tags: certstore} + - {role: tfe, tags: tfe} + - {role: telegraf_statistic, tags: telegraf_statistic} + - {role: exporter, tags: exporter} + - {role: docker, tags: docker} + - {role: tsg-diagnose, tags: tsg-diagnose} + - {role: system-init, tags: system-init} + - {role: system-init-9140, tags: system-init-9140} \ No newline at end of file diff --git a/ansible/tsg_9140_deploy.yml b/ansible/tsg_9140_deploy.yml deleted file mode 100644 index 50c6a7b9..00000000 --- a/ansible/tsg_9140_deploy.yml +++ /dev/null @@ -1,33 +0,0 @@ -- hosts: tsg_9140_chroot - remote_user: root - vars_files: - - install_config/group_vars/stage_one_9000NPBP01R01.yml - - install_config/group_vars/rpm_version.yml - roles: - #- {role: init-env, tags: init-env} - - {role: tsg-os-provision, tags: tsg-os-provision} - - {role: tsg_device_tag, tags: tsg_device_tag} - - {role: tsg_sn, tags: tsg_sn} - - {role: framework, tags: framework} - #- {role: kernel-ml, tags: kernel-ml} - - {role: mrzcpd, tags: mrzcpd} - #- {role: tsg-9140-env, tags: tsg-9140-env} - - {role: sapp, tags: sapp} - - {role: tsg_master, tags: tsg_master} - - {role: kni, tags: kni} - - {role: firewall, tags: firewall} - - {role: tsg_app, tags: tsg_app} - #- {role: http_healthcheck,tags: http_healthcheck} - - {role: i40e-drive, tags: i40e-drive} - - {role: redis, tags: redis} - - {role: certstore, tags: certstore} - #- {role: redis, tags: redis} - #- {role: cert-redis, tags: cert-redis} - #83上没有- {role: maat-redis, tags: maat-redis, when: deploy_mode == "cluster"} - - {role: tfe, tags: tfe} - - {role: telegraf_statistic, tags: telegraf_statistic} - - {role: exporter, tags: exporter} - - {role: docker, tags: docker} - - {role: tsg-diagnose, tags: tsg-diagnose} - - {role: system-init, tags: system-init} - - {role: system-init-9140, tags: system-init-9140} \ No newline at end of file diff --git a/make/Makefile.7400MCN0P01R01 b/make/Makefile.7400MCN0P01R01 index e1ed3dec..27edf67e 100644 --- a/make/Makefile.7400MCN0P01R01 +++ b/make/Makefile.7400MCN0P01R01 @@ -50,7 +50,7 @@ sysroot-ansible: sysroot-verfile sysroot-base cp $(CONFDIR)/resolv.conf $(TARGET_SYSROOT_DIR)/etc/ -r cp $(TARGET_SYSROOT_DIR)/etc/hosts $(TARGET_SYSROOT_DIR)/tmp/ -r cp /etc/hosts $(TARGET_SYSROOT_DIR)/etc/ -r - $(TOOLSDIR)/ansible-stage-one-7400 $(PROFILE_ID) $(PROJECTDIR) $(TARGET_SYSROOT_DIR) /tmp/yum.conf + $(TOOLSDIR)/ansible-stage-one $(PROFILE_ID) $(PROJECTDIR) $(TARGET_SYSROOT_DIR) /tmp/yum.conf cp $(TARGET_SYSROOT_DIR)/tmp/hosts $(TARGET_SYSROOT_DIR)/etc/ -r sysroot-cleanup: diff --git a/make/Makefile.7400MCN123P01R01 b/make/Makefile.7400MCN123P01R01 index 3d31470d..7613ad27 100644 --- a/make/Makefile.7400MCN123P01R01 +++ b/make/Makefile.7400MCN123P01R01 @@ -50,7 +50,7 @@ sysroot-ansible: sysroot-verfile sysroot-base cp $(CONFDIR)/resolv.conf $(TARGET_SYSROOT_DIR)/etc/ -r cp $(TARGET_SYSROOT_DIR)/etc/hosts $(TARGET_SYSROOT_DIR)/tmp/ -r cp /etc/hosts $(TARGET_SYSROOT_DIR)/etc/ -r - $(TOOLSDIR)/ansible-stage-one-7400 $(PROFILE_ID) $(PROJECTDIR) $(TARGET_SYSROOT_DIR) /tmp/yum.conf + $(TOOLSDIR)/ansible-stage-one $(PROFILE_ID) $(PROJECTDIR) $(TARGET_SYSROOT_DIR) /tmp/yum.conf cp $(TARGET_SYSROOT_DIR)/tmp/hosts $(TARGET_SYSROOT_DIR)/etc/ -r sysroot-cleanup: diff --git a/make/Makefile.9000NPBP01R01 b/make/Makefile.9000NPBP01R01 index f116cffb..a8d3950a 100644 --- a/make/Makefile.9000NPBP01R01 +++ b/make/Makefile.9000NPBP01R01 @@ -50,7 +50,7 @@ sysroot-ansible: sysroot-verfile sysroot-base cp $(CONFDIR)/resolv.conf $(TARGET_SYSROOT_DIR)/etc/ -r cp $(TARGET_SYSROOT_DIR)/etc/hosts $(TARGET_SYSROOT_DIR)/tmp/ -r cp /etc/hosts $(TARGET_SYSROOT_DIR)/etc/ -r - $(TOOLSDIR)/ansible-stage-one-9000 $(PROFILE_ID) $(PROJECTDIR) $(TARGET_SYSROOT_DIR) /tmp/yum.conf + $(TOOLSDIR)/ansible-stage-one $(PROFILE_ID) $(PROJECTDIR) $(TARGET_SYSROOT_DIR) /tmp/yum.conf cp $(TARGET_SYSROOT_DIR)/tmp/hosts $(TARGET_SYSROOT_DIR)/etc/ -r sysroot-cleanup: diff --git a/tools/ansible-stage-one b/tools/ansible-stage-one new file mode 100644 index 00000000..40e67a75 --- /dev/null +++ b/tools/ansible-stage-one @@ -0,0 +1,14 @@ +#!/bin/sh + +PROFILE_ID=$1 +PROJECTDIR=$2 +TARGET_SYSROOT_DIR=$3 +YUM_CONF_PATH=$4 + +echo "----------------------------- Ansible Stage 1 ----------------------------" +echo "$PROFILE_ID" + +echo "[$PROFILE_ID]" > $PROJECTDIR/ansible/install_config/hosts +echo "$TARGET_SYSROOT_DIR ansible_connection=chroot" >> $PROJECTDIR/ansible/install_config/hosts + +ansible-playbook -i $PROJECTDIR/ansible/install_config/hosts $PROJECTDIR/ansible/stage_one_deploy.yml -e "rpm_repo_config_path=$YUM_CONF_PATH PROFILE_ID=$PROFILE_ID" diff --git a/tools/ansible-stage-one-7400 b/tools/ansible-stage-one-7400 deleted file mode 100755 index 91a2bc1e..00000000 --- a/tools/ansible-stage-one-7400 +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -PROFILE_ID=$1 -PROJECTDIR=$2 -TARGET_SYSROOT_DIR=$3 -YUM_CONF_PATH=$4 - -echo "----------------------------- Ansible Stage 1 ----------------------------" -echo "$PROFILE_ID" - -echo "[$PROFILE_ID]" > $PROJECTDIR/ansible/install_config/tsg_7400_host -echo "$TARGET_SYSROOT_DIR ansible_connection=chroot" >> $PROJECTDIR/ansible/install_config/tsg_7400_host - -ansible-playbook -i $PROJECTDIR/ansible/install_config/tsg_7400_host $PROJECTDIR/ansible/tsg_7400_deploy.yml -e "rpm_repo_config_path=$YUM_CONF_PATH PROFILE_ID=$PROFILE_ID" diff --git a/tools/ansible-stage-one-9000 b/tools/ansible-stage-one-9000 deleted file mode 100755 index be32f50f..00000000 --- a/tools/ansible-stage-one-9000 +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -PROFILE_ID=$1 -PROJECTDIR=$2 -TARGET_SYSROOT_DIR=$3 -YUM_CONF_PATH=$4 - -echo "----------------------------- Ansible Stage 1 ----------------------------" -echo "$PROFILE_ID" - -echo "[tsg_9140_chroot]" > $PROJECTDIR/ansible/install_config/tsg_9140_host -echo "$TARGET_SYSROOT_DIR ansible_connection=chroot" >> $PROJECTDIR/ansible/install_config/tsg_9140_host - -ansible-playbook -i $PROJECTDIR/ansible/install_config/tsg_9140_host $PROJECTDIR/ansible/tsg_9140_deploy.yml -e "rpm_repo_config_path=$YUM_CONF_PATH PROFILE_ID=$PROFILE_ID"