From eb540701bdb150e2ca16abe80fa9173407510cd8 Mon Sep 17 00:00:00 2001 From: luwenpeng Date: Thu, 3 Jun 2021 19:09:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E7=BB=93=E6=9E=84=20=091.TSG-OS=20=E5=85=AC=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E7=B3=BB=E7=BB=9F=E9=85=8D=E7=BD=AE=E6=94=BE=E5=88=B0?= =?UTF-8?q?=20system-init;=20=092.TSG-7400=20=E7=8B=AC=E8=87=AA=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E7=B3=BB=E7=BB=9F=E9=85=8D=E7=BD=AE=E6=94=BE?= =?UTF-8?q?=E5=88=B0=20system-init-7400;=20=093.TSG-9140=20=E7=8B=AC?= =?UTF-8?q?=E8=87=AA=E4=BD=BF=E7=94=A8=E7=9A=84=E7=B3=BB=E7=BB=9F=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=94=BE=E5=88=B0=20system-init-9140;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ansible/roles/system-init-9140/tasks/main.yml | 125 ++++++++++++++++++ .../templates/90-9000NPBP01R01.rules.j2 | 0 .../templates/if-pre-up.toml.j2 | 0 .../templates/ifcfg-enp130s0.toml.j2 | 0 .../templates/ifcfg-enp130s2.toml.j2 | 0 .../templates/ifcfg-enp130s2f1.toml.j2 | 0 .../templates/ifcfg-enp130s2f2.toml.j2 | 0 .../templates/ifcfg-enp130s2f3.toml.j2 | 0 .../templates/ifcfg-enp131s0f0.toml.j2 | 0 .../templates/ifcfg-enp131s0f1.toml.j2 | 0 .../templates/ifcfg-enp131s0f2.toml.j2 | 0 .../templates/ifcfg-enp131s0f3.toml.j2 | 0 .../templates/ifcfg-enp1s0.toml.j2 | 0 .../templates/ifcfg-enp1s2.toml.j2 | 0 .../templates/ifcfg-enp1s2f1.toml.j2 | 0 .../templates/ifcfg-enp1s2f2.toml.j2 | 0 .../templates/ifcfg-enp5s0f0.toml.j2 | 0 .../templates/ifcfg-enp5s0f1.toml.j2 | 0 .../templates/set-enp1s2-macaddr.sh.toml.j2 | 0 .../templates/setup.enp130s2f1.ips.toml.j2 | 0 .../templates/setup.enp131s0f0.ips.toml.j2 | 0 ansible/roles/system-init/tasks/main.yml | 125 ------------------ ansible/tsg_7400_deploy.yml | 2 + ansible/tsg_9140_deploy.yml | 3 +- 24 files changed, 129 insertions(+), 126 deletions(-) create mode 100644 ansible/roles/system-init-9140/tasks/main.yml rename ansible/roles/{system-init => system-init-9140}/templates/90-9000NPBP01R01.rules.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/if-pre-up.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/ifcfg-enp130s0.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/ifcfg-enp130s2.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/ifcfg-enp130s2f1.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/ifcfg-enp130s2f2.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/ifcfg-enp130s2f3.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/ifcfg-enp131s0f0.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/ifcfg-enp131s0f1.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/ifcfg-enp131s0f2.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/ifcfg-enp131s0f3.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/ifcfg-enp1s0.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/ifcfg-enp1s2.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/ifcfg-enp1s2f1.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/ifcfg-enp1s2f2.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/ifcfg-enp5s0f0.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/ifcfg-enp5s0f1.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/set-enp1s2-macaddr.sh.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/setup.enp130s2f1.ips.toml.j2 (100%) rename ansible/roles/{system-init => system-init-9140}/templates/setup.enp131s0f0.ips.toml.j2 (100%) diff --git a/ansible/roles/system-init-9140/tasks/main.yml b/ansible/roles/system-init-9140/tasks/main.yml new file mode 100644 index 00000000..1677be1b --- /dev/null +++ b/ansible/roles/system-init-9140/tasks/main.yml @@ -0,0 +1,125 @@ +--- +- name: "set 90-9000NPBP01R01.rules" + template: + src: "{{ role_path }}/templates/90-9000NPBP01R01.rules.j2" + dest: /usr/lib/udev/rules.d/90-9000NPBP01R01.rules + mode: 0644 + tags: template + +- name: "set enp1s0 up " + template: + src: "{{ role_path }}/templates/ifcfg-enp1s0.toml.j2" + dest: /etc/sysconfig/network-scripts/ifcfg-enp1s0 + tags: template + +- name: "set enp5s0f0 up " + template: + src: "{{ role_path }}/templates/ifcfg-enp5s0f0.toml.j2" + dest: /etc/sysconfig/network-scripts/ifcfg-enp5s0f0 + tags: template + +- name: "set enp5s0f1 up " + template: + src: "{{ role_path }}/templates/ifcfg-enp5s0f1.toml.j2" + dest: /etc/sysconfig/network-scripts/ifcfg-enp5s0f1 + tags: template + +- name: "set enp130s0 up " + template: + src: "{{ role_path }}/templates/ifcfg-enp130s0.toml.j2" + dest: /etc/sysconfig/network-scripts/ifcfg-enp130s0 + tags: template + +- name: "set enp131s0f0 up " + template: + src: "{{ role_path }}/templates/ifcfg-enp131s0f0.toml.j2" + dest: /etc/sysconfig/network-scripts/ifcfg-enp131s0f0 + tags: template + +- name: "set enp131s0f1 up " + template: + src: "{{ role_path }}/templates/ifcfg-enp131s0f1.toml.j2" + dest: /etc/sysconfig/network-scripts/ifcfg-enp131s0f1 + tags: template + +- name: "set enp131s0f2 up " + template: + src: "{{ role_path }}/templates/ifcfg-enp131s0f2.toml.j2" + dest: /etc/sysconfig/network-scripts/ifcfg-enp131s0f2 + tags: template + +- name: "set enp131s0f3 up " + template: + src: "{{ role_path }}/templates/ifcfg-enp131s0f3.toml.j2" + dest: /etc/sysconfig/network-scripts/ifcfg-enp131s0f3 + tags: template + +- name: "set enp1s2" + template: + src: "{{ role_path }}/templates/ifcfg-enp1s2.toml.j2" + dest: /etc/sysconfig/network-scripts/ifcfg-enp1s2 + tags: template + +- name: "set enp1s2f1" + template: + src: "{{ role_path }}/templates/ifcfg-enp1s2f1.toml.j2" + dest: /etc/sysconfig/network-scripts/ifcfg-enp1s2f1 + tags: template + +- name: "set enp1s2f2" + template: + src: "{{ role_path }}/templates/ifcfg-enp1s2f2.toml.j2" + dest: /etc/sysconfig/network-scripts/ifcfg-enp1s2f2 + tags: template + +- name: "set enp130s2" + template: + src: "{{ role_path }}/templates/ifcfg-enp130s2.toml.j2" + dest: /etc/sysconfig/network-scripts/ifcfg-enp130s2 + tags: template + +- name: "set enp130s2f1" + template: + src: "{{ role_path }}/templates/ifcfg-enp130s2f1.toml.j2" + dest: /etc/sysconfig/network-scripts/ifcfg-enp130s2f1 + tags: template + +- name: "set enp130s2f2" + template: + src: "{{ role_path }}/templates/ifcfg-enp130s2f2.toml.j2" + dest: /etc/sysconfig/network-scripts/ifcfg-enp130s2f2 + tags: template + +- name: "set enp130s2f3" + template: + src: "{{ role_path }}/templates/ifcfg-enp130s2f3.toml.j2" + dest: /etc/sysconfig/network-scripts/ifcfg-enp130s2f3 + tags: template + +- name: "set if-pre-up " + template: + src: "{{ role_path }}/templates/if-pre-up.toml.j2" + dest: /etc/NetworkManager/dispatcher.d/pre-up.d/if-pre-up + mode: 0755 + tags: template + +- name: "set setup.enp131s0f0.ips" + template: + src: "{{ role_path }}/templates/setup.enp131s0f0.ips.toml.j2" + dest: /sbin/setup.enp131s0f0.ips + mode: 0777 + tags: template + +- name: "set setup.enp130s2f1.ips" + template: + src: "{{ role_path }}/templates/setup.enp130s2f1.ips.toml.j2" + dest: /sbin/setup.enp130s2f1.ips + mode: 0777 + tags: template + +- name: "set set-enp1s2-macaddr.sh" + template: + src: "{{ role_path }}/templates/set-enp1s2-macaddr.sh.toml.j2" + dest: /usr/bin/set-enp1s2-macaddr.sh + mode: 0777 + tags: template diff --git a/ansible/roles/system-init/templates/90-9000NPBP01R01.rules.j2 b/ansible/roles/system-init-9140/templates/90-9000NPBP01R01.rules.j2 similarity index 100% rename from ansible/roles/system-init/templates/90-9000NPBP01R01.rules.j2 rename to ansible/roles/system-init-9140/templates/90-9000NPBP01R01.rules.j2 diff --git a/ansible/roles/system-init/templates/if-pre-up.toml.j2 b/ansible/roles/system-init-9140/templates/if-pre-up.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/if-pre-up.toml.j2 rename to ansible/roles/system-init-9140/templates/if-pre-up.toml.j2 diff --git a/ansible/roles/system-init/templates/ifcfg-enp130s0.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-enp130s0.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/ifcfg-enp130s0.toml.j2 rename to ansible/roles/system-init-9140/templates/ifcfg-enp130s0.toml.j2 diff --git a/ansible/roles/system-init/templates/ifcfg-enp130s2.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-enp130s2.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/ifcfg-enp130s2.toml.j2 rename to ansible/roles/system-init-9140/templates/ifcfg-enp130s2.toml.j2 diff --git a/ansible/roles/system-init/templates/ifcfg-enp130s2f1.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-enp130s2f1.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/ifcfg-enp130s2f1.toml.j2 rename to ansible/roles/system-init-9140/templates/ifcfg-enp130s2f1.toml.j2 diff --git a/ansible/roles/system-init/templates/ifcfg-enp130s2f2.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-enp130s2f2.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/ifcfg-enp130s2f2.toml.j2 rename to ansible/roles/system-init-9140/templates/ifcfg-enp130s2f2.toml.j2 diff --git a/ansible/roles/system-init/templates/ifcfg-enp130s2f3.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-enp130s2f3.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/ifcfg-enp130s2f3.toml.j2 rename to ansible/roles/system-init-9140/templates/ifcfg-enp130s2f3.toml.j2 diff --git a/ansible/roles/system-init/templates/ifcfg-enp131s0f0.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-enp131s0f0.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/ifcfg-enp131s0f0.toml.j2 rename to ansible/roles/system-init-9140/templates/ifcfg-enp131s0f0.toml.j2 diff --git a/ansible/roles/system-init/templates/ifcfg-enp131s0f1.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-enp131s0f1.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/ifcfg-enp131s0f1.toml.j2 rename to ansible/roles/system-init-9140/templates/ifcfg-enp131s0f1.toml.j2 diff --git a/ansible/roles/system-init/templates/ifcfg-enp131s0f2.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-enp131s0f2.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/ifcfg-enp131s0f2.toml.j2 rename to ansible/roles/system-init-9140/templates/ifcfg-enp131s0f2.toml.j2 diff --git a/ansible/roles/system-init/templates/ifcfg-enp131s0f3.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-enp131s0f3.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/ifcfg-enp131s0f3.toml.j2 rename to ansible/roles/system-init-9140/templates/ifcfg-enp131s0f3.toml.j2 diff --git a/ansible/roles/system-init/templates/ifcfg-enp1s0.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-enp1s0.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/ifcfg-enp1s0.toml.j2 rename to ansible/roles/system-init-9140/templates/ifcfg-enp1s0.toml.j2 diff --git a/ansible/roles/system-init/templates/ifcfg-enp1s2.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-enp1s2.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/ifcfg-enp1s2.toml.j2 rename to ansible/roles/system-init-9140/templates/ifcfg-enp1s2.toml.j2 diff --git a/ansible/roles/system-init/templates/ifcfg-enp1s2f1.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-enp1s2f1.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/ifcfg-enp1s2f1.toml.j2 rename to ansible/roles/system-init-9140/templates/ifcfg-enp1s2f1.toml.j2 diff --git a/ansible/roles/system-init/templates/ifcfg-enp1s2f2.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-enp1s2f2.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/ifcfg-enp1s2f2.toml.j2 rename to ansible/roles/system-init-9140/templates/ifcfg-enp1s2f2.toml.j2 diff --git a/ansible/roles/system-init/templates/ifcfg-enp5s0f0.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-enp5s0f0.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/ifcfg-enp5s0f0.toml.j2 rename to ansible/roles/system-init-9140/templates/ifcfg-enp5s0f0.toml.j2 diff --git a/ansible/roles/system-init/templates/ifcfg-enp5s0f1.toml.j2 b/ansible/roles/system-init-9140/templates/ifcfg-enp5s0f1.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/ifcfg-enp5s0f1.toml.j2 rename to ansible/roles/system-init-9140/templates/ifcfg-enp5s0f1.toml.j2 diff --git a/ansible/roles/system-init/templates/set-enp1s2-macaddr.sh.toml.j2 b/ansible/roles/system-init-9140/templates/set-enp1s2-macaddr.sh.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/set-enp1s2-macaddr.sh.toml.j2 rename to ansible/roles/system-init-9140/templates/set-enp1s2-macaddr.sh.toml.j2 diff --git a/ansible/roles/system-init/templates/setup.enp130s2f1.ips.toml.j2 b/ansible/roles/system-init-9140/templates/setup.enp130s2f1.ips.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/setup.enp130s2f1.ips.toml.j2 rename to ansible/roles/system-init-9140/templates/setup.enp130s2f1.ips.toml.j2 diff --git a/ansible/roles/system-init/templates/setup.enp131s0f0.ips.toml.j2 b/ansible/roles/system-init-9140/templates/setup.enp131s0f0.ips.toml.j2 similarity index 100% rename from ansible/roles/system-init/templates/setup.enp131s0f0.ips.toml.j2 rename to ansible/roles/system-init-9140/templates/setup.enp131s0f0.ips.toml.j2 diff --git a/ansible/roles/system-init/tasks/main.yml b/ansible/roles/system-init/tasks/main.yml index df32a1c3..81ad2423 100644 --- a/ansible/roles/system-init/tasks/main.yml +++ b/ansible/roles/system-init/tasks/main.yml @@ -1,129 +1,4 @@ --- -- name: "set 90-9000NPBP01R01.rules" - template: - src: "{{ role_path }}/templates/90-9000NPBP01R01.rules.j2" - dest: /usr/lib/udev/rules.d/90-9000NPBP01R01.rules - mode: 0644 - tags: template - -- name: "set enp1s0 up " - template: - src: "{{ role_path }}/templates/ifcfg-enp1s0.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-enp1s0 - tags: template - -- name: "set enp5s0f0 up " - template: - src: "{{ role_path }}/templates/ifcfg-enp5s0f0.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-enp5s0f0 - tags: template - -- name: "set enp5s0f1 up " - template: - src: "{{ role_path }}/templates/ifcfg-enp5s0f1.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-enp5s0f1 - tags: template - -- name: "set enp130s0 up " - template: - src: "{{ role_path }}/templates/ifcfg-enp130s0.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-enp130s0 - tags: template - -- name: "set enp131s0f0 up " - template: - src: "{{ role_path }}/templates/ifcfg-enp131s0f0.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-enp131s0f0 - tags: template - -- name: "set enp131s0f1 up " - template: - src: "{{ role_path }}/templates/ifcfg-enp131s0f1.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-enp131s0f1 - tags: template - -- name: "set enp131s0f2 up " - template: - src: "{{ role_path }}/templates/ifcfg-enp131s0f2.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-enp131s0f2 - tags: template - -- name: "set enp131s0f3 up " - template: - src: "{{ role_path }}/templates/ifcfg-enp131s0f3.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-enp131s0f3 - tags: template - -- name: "set enp1s2" - template: - src: "{{ role_path }}/templates/ifcfg-enp1s2.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-enp1s2 - tags: template - -- name: "set enp1s2f1" - template: - src: "{{ role_path }}/templates/ifcfg-enp1s2f1.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-enp1s2f1 - tags: template - -- name: "set enp1s2f2" - template: - src: "{{ role_path }}/templates/ifcfg-enp1s2f2.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-enp1s2f2 - tags: template - -- name: "set enp130s2" - template: - src: "{{ role_path }}/templates/ifcfg-enp130s2.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-enp130s2 - tags: template - -- name: "set enp130s2f1" - template: - src: "{{ role_path }}/templates/ifcfg-enp130s2f1.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-enp130s2f1 - tags: template - -- name: "set enp130s2f2" - template: - src: "{{ role_path }}/templates/ifcfg-enp130s2f2.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-enp130s2f2 - tags: template - -- name: "set enp130s2f3" - template: - src: "{{ role_path }}/templates/ifcfg-enp130s2f3.toml.j2" - dest: /etc/sysconfig/network-scripts/ifcfg-enp130s2f3 - tags: template - -- name: "set if-pre-up " - template: - src: "{{ role_path }}/templates/if-pre-up.toml.j2" - dest: /etc/NetworkManager/dispatcher.d/pre-up.d/if-pre-up - mode: 0755 - tags: template - -- name: "set setup.enp131s0f0.ips" - template: - src: "{{ role_path }}/templates/setup.enp131s0f0.ips.toml.j2" - dest: /sbin/setup.enp131s0f0.ips - mode: 0777 - tags: template - -- name: "set setup.enp130s2f1.ips" - template: - src: "{{ role_path }}/templates/setup.enp130s2f1.ips.toml.j2" - dest: /sbin/setup.enp130s2f1.ips - mode: 0777 - tags: template - -- name: "set set-enp1s2-macaddr.sh" - template: - src: "{{ role_path }}/templates/set-enp1s2-macaddr.sh.toml.j2" - dest: /usr/bin/set-enp1s2-macaddr.sh - mode: 0777 - tags: template - - name: "enable sshd" systemd: name: sshd diff --git a/ansible/tsg_7400_deploy.yml b/ansible/tsg_7400_deploy.yml index 9478ca04..464be33e 100644 --- a/ansible/tsg_7400_deploy.yml +++ b/ansible/tsg_7400_deploy.yml @@ -5,6 +5,7 @@ - install_config/group_vars/rpm_version.yml roles: - {role: tsg-os-provision, tags: tsg-os-provision} + - {role: system-init, tags: system-init} - {role: system-init-7400-mcn0, tags: system-init-7400-mcn0} - hosts: 7400-MCN123-P01R01 @@ -14,4 +15,5 @@ - install_config/group_vars/rpm_version.yml roles: - {role: tsg-os-provision, tags: tsg-os-provision} + - {role: system-init, tags: system-init} - {role: system-init-7400-mcn123, tags: system-init-7400-mcn123} \ No newline at end of file diff --git a/ansible/tsg_9140_deploy.yml b/ansible/tsg_9140_deploy.yml index 6dde2cca..db464d81 100644 --- a/ansible/tsg_9140_deploy.yml +++ b/ansible/tsg_9140_deploy.yml @@ -29,4 +29,5 @@ - {role: exporter, tags: exporter} - {role: docker, tags: docker} - {role: tsg-diagnose, tags: tsg-diagnose} - - {role: system-init, tags: system-init} \ No newline at end of file + - {role: system-init, tags: system-init} + - {role: system-init-9140, tags: system-init-9140} \ No newline at end of file