From b8e05fa45a9d3aa8c216683f03c7a209aed66d71 Mon Sep 17 00:00:00 2001 From: Franck KIMA Date: Wed, 8 Jan 2020 17:01:26 +0000 Subject: [PATCH] adaptation des noms des variables et suppression du fichier DSA_VM_TEST02 --- DSA_VM_TEST01.yaml | 111 ++----- DSA_VM_TEST02.yaml | 691 ------------------------------------------- DSA_VM_TEST_ENV.yaml | 28 +- 3 files changed, 40 insertions(+), 790 deletions(-) delete mode 100644 DSA_VM_TEST02.yaml diff --git a/DSA_VM_TEST01.yaml b/DSA_VM_TEST01.yaml index 5575067..ba9c468 100644 --- a/DSA_VM_TEST01.yaml +++ b/DSA_VM_TEST01.yaml @@ -17,7 +17,7 @@ parameters: type: string description: - test_flavor: + vm_flavor: type: string description: @@ -25,36 +25,19 @@ parameters: type: string description: - test1_instance_name: + vm1_instance_name: type: string description: - test1_hostname: + vm1_hostname: type: string description: - test2_instance_name: - type: string - description: - - test2_hostname: - type: string - description: - - volume_type: type: string description: - test1_volume_name: - type: string - description: - - test2_volume_name: - type: string - description: - - test_volume_size: + vm1_volume_name: type: string description: @@ -154,35 +137,19 @@ parameters: type: string description: - test1_local_host_ctrl: - type: string - description: - - test1_local_host_oam: + vm1_local_host_ctrl: type: string description: - test1_local_host_metro_usr: + vm1_local_host_oam: type: string description: - test1_local_host_usr: + vm1_local_host_metro_usr: type: string description: - test2_local_host_ctrl: - type: string - description: - - test2_local_host_oam: - type: string - description: - - test2_local_host_metro_usr: - type: string - description: - - test2_local_host_usr: + vm1_local_host_usr: type: string description: @@ -218,62 +185,46 @@ parameters: type: string description: -# test_mount_dir: -# type: string -# description: -# -# nfs_mount_dir: -# type: string -# description: -# -# secret_ha: -# type: string -# description: -# -# secret_mariadb: -# type: string -# description: - resources: # Declaration des ports réseau - port_ctrl_node_test1: + port_ctrl_node_vm1: type: OS::Neutron::Port properties: network: { get_param: net_ctrl } fixed_ips: - - ip_address: { get_param: test1_local_host_ctrl } + - ip_address: { get_param: vm1_local_host_ctrl } security_groups: - { get_param: sec_group } - port_oam_node_test1: + port_oam_node_vm1: type: OS::Neutron::Port properties: network: { get_param: net_oam } fixed_ips: - - ip_address: { get_param: test1_local_host_oam } + - ip_address: { get_param: vm1_local_host_oam } security_groups: - { get_param: sec_group } - port_metro_usr_node_test1: + port_metro_usr_node_vm1: type: OS::Neutron::Port properties: network: { get_param: net_metro_usr } fixed_ips: - - ip_address: { get_param: test1_local_host_metro_usr } + - ip_address: { get_param: vm1_local_host_metro_usr } security_groups: - { get_param: sec_group } - port_usr_node_test1: + port_usr_node_vm1: type: OS::Neutron::Port properties: network: { get_param: net_usr } fixed_ips: - - ip_address: { get_param: test1_local_host_usr } + - ip_address: { get_param: vm1_local_host_usr } security_groups: - { get_param: sec_group } # Declaration de la configuration - sw_config_node_test1: + sw_config_node_vm1: type: OS::Heat::SoftwareConfig properties: group: ungrouped @@ -640,7 +591,7 @@ resources: ### Flag de fin de déploiement date > $deploymt params: - local_hostname: { get_param: test1_hostname } + local_hostname: { get_param: vm1_hostname } sw_repo_base: { get_param: sw_repo_base } sw_repo_extras: { get_param: sw_repo_extras } sw_repo_centosplus: { get_param: sw_repo_centosplus } @@ -657,13 +608,11 @@ resources: dns2_oam: { get_param: dns2_oam } ntp1_oam: { get_param: ntp1_oam } ntp2_oam: { get_param: ntp2_oam } - local_host_ctrl: { get_param: test1_local_host_ctrl } - local_host_oam: { get_param: test1_local_host_oam } - local_host_metro_usr: { get_param: test1_local_host_metro_usr } - local_host_usr: { get_param: test1_local_host_usr } + local_host_ctrl: { get_param: vm1_local_host_ctrl } + local_host_oam: { get_param: vm1_local_host_oam } + local_host_metro_usr: { get_param: vm1_local_host_metro_usr } + local_host_usr: { get_param: vm1_local_host_usr } local_gateway: { get_param: gateway } -# test_vip_metro_usr: { get_param: test_vip_metro_usr } -# test_vip_usr: { get_param: test_vip_usr } route1: { get_param: ip_route1 } route2: { get_param: ip_route2 } route3: { get_param: ip_route3 } @@ -675,17 +624,17 @@ resources: remote_host_oam: { get_param: test2_local_host_oam } # Declaration des serveurs - server_test1: + server_vm1: type: OS::Nova::Server properties: availability_zone: { get_param: availability_zone } - flavor: { get_param: test_flavor } - name: { get_param: test1_instance_name } + flavor: { get_param: vm_flavor } + name: { get_param: vm1_instance_name } image: { get_param: image } networks: - - port : { get_resource: port_ctrl_node_test1 } - - port : { get_resource: port_oam_node_test1 } - - port : { get_resource: port_metro_usr_node_test1 } - - port : { get_resource: port_usr_node_test1 } + - port : { get_resource: port_ctrl_node_vm1 } + - port : { get_resource: port_oam_node_vm1 } + - port : { get_resource: port_metro_usr_node_vm1 } + - port : { get_resource: port_usr_node_vm1 } user_data_format: RAW - user_data: { get_resource: sw_config_node_test1 } \ No newline at end of file + user_data: { get_resource: sw_config_node_vm1 } \ No newline at end of file diff --git a/DSA_VM_TEST02.yaml b/DSA_VM_TEST02.yaml deleted file mode 100644 index 376f80b..0000000 --- a/DSA_VM_TEST02.yaml +++ /dev/null @@ -1,691 +0,0 @@ -heat_template_version: '2015-04-30' - -#Description du template -description: - -#Declaration et description des paramètres -parameters: -# key_name: -# type: string -# description: - - availability_zone: - type: string - description: - - image: - type: string - description: - - test_flavor: - type: string - description: - - sec_group: - type: string - description: - - test1_instance_name: - type: string - description: - - test1_hostname: - type: string - description: - - test2_instance_name: - type: string - description: - - test2_hostname: - type: string - description: - - - volume_type: - type: string - description: - - test1_volume_name: - type: string - description: - - test2_volume_name: - type: string - description: - - test_volume_size: - type: string - description: - - sw_repo_base: - type: string - description: - - sw_repo_updates: - type: string - description: - - sw_repo_extras: - type: string - description: - - sw_repo_centosplus: - type: string - description: - - sw_repo_epel: - type: string - description: - - sw_repo_mariadb_main: - type: string - description: - - sw_repo_mariadb_maxscale: - type: string - description: - - sw_repo_mariadb_tools: - type: string - description: - - sw_repo_webtatic: - type: string - description: - - sw_repo_remi: - type: string - description: - - sw_repo_elrepo: - type: string - description: - - sw_repo_sclo: - type: string - description: - - sw_repo_ius: - type: string - description: - - sw_repo_pgsql: - type: string - description: - - sw_repo_nginx: - type: string - description: - - dns_domain: - type: string - description: - - dns1_oam: - type: string - description: - - dns2_oam: - type: string - description: - - ntp1_oam: - type: string - description: - - ntp2_oam: - type: string - description: - - net_ctrl: - type: string - description: - - net_oam: - type: string - description: - - net_metro_usr: - type: string - description: - - net_usr: - type: string - description: - - test1_local_host_ctrl: - type: string - description: - - test1_local_host_oam: - type: string - description: - - test1_local_host_metro_usr: - type: string - description: - - test1_local_host_usr: - type: string - description: - - test2_local_host_ctrl: - type: string - description: - - test2_local_host_oam: - type: string - description: - - test2_local_host_metro_usr: - type: string - description: - - test2_local_host_usr: - type: string - description: - - gateway: - type: string - description: - - ip_route1: - type: string - description: - - ip_route2: - type: string - description: - - ip_route3: - type: string - description: - - ip_route4: - type: string - description: - - ip_route5: - type: string - description: - - ip_route6: - type: string - description: - - ip_route7: - type: string - description: - -# test_mount_dir: -# type: string -# description: - -# nfs_mount_dir: -# type: string -# description: -# -# secret_ha: -# type: string -# description: -# -# secret_mariadb: -# type: string -# description: - -resources: -# Declaration des ports réseau - port_ctrl_node_test2: - type: OS::Neutron::Port - properties: - network: { get_param: net_ctrl } - fixed_ips: - - ip_address: { get_param: test2_local_host_ctrl } - security_groups: - - { get_param: sec_group } - - port_oam_node_test2: - type: OS::Neutron::Port - properties: - network: { get_param: net_oam } - fixed_ips: - - ip_address: { get_param: test2_local_host_oam } - security_groups: - - { get_param: sec_group } - - port_metro_usr_node_test2: - type: OS::Neutron::Port - properties: - network: { get_param: net_metro_usr } - fixed_ips: - - ip_address: { get_param: test2_local_host_metro_usr } - security_groups: - - { get_param: sec_group } - - port_usr_node_test2: - type: OS::Neutron::Port - properties: - network: { get_param: net_usr } - fixed_ips: - - ip_address: { get_param: test2_local_host_usr } - security_groups: - - { get_param: sec_group } - -# Declaration de la configuration - sw_config_node_test2: - type: OS::Heat::SoftwareConfig - properties: - group: ungrouped - config: - str_replace: - template: | - #!/bin/bash -ex - - # Vérification initiale - deploymt=/root/deploymt-finished - if [ -f $deploymt ]; then - echo "$deploymt file exists. Deployment has already been performed. Exit…" - exit 0 - fi - - ### Configuration du nommage - echo local_hostname.dns_domain > /etc/hostname - hostname -F /etc/hostname - - ### Configuration du nommage des noeuds du cluster - echo local_host_oam local_hostname local_hostname.dns_domain >> /etc/hosts - echo remote_host_oam remote_hostname remote_hostname.dns_domain >> /etc/hosts - - - ### Configuration du password - echo "root:Cent0s" | chpasswd - - ### Configuration du dépot local - cd /etc/yum.repos.d/ - rm -f *.repo - cat >local-repos.repo <ifcfg-eth0 <ifcfg-eth1 <ifcfg-eth2 <ifcfg-eth3 <> /etc/sysconfig/network-scripts/route-eth1 - echo route2 >> /etc/sysconfig/network-scripts/route-eth1 - echo route3 >> /etc/sysconfig/network-scripts/route-eth1 - echo route4 >> /etc/sysconfig/network-scripts/route-eth1 - echo route5 >> /etc/sysconfig/network-scripts/route-eth2 - echo route6 >> /etc/sysconfig/network-scripts/route-eth3 - echo route7 >> /etc/sysconfig/network-scripts/route-eth3 - echo "default via local_gateway" >> /etc/sysconfig/network-scripts/route-eth3 - - ### Configuration du réseau - cd /etc/dhcp - - cat >dhclient-enter-hooks <dhclient-eth0-up-hooks <dhclient-eth1-up-hooks <dhclient-eth2-up-hooks <dhclient-eth3-up-hooks <75-persistent-net-generator.rules <network </etc/logrotate.conf< /etc/resolv.conf - echo 'nameserver dns1_oam' >> /etc/resolv.conf - echo 'nameserver dns2_oam' >> /etc/resolv.conf - echo 'options timeout:1' >> /etc/resolv.conf - echo 'options attempts:1' >> /etc/resolv.conf - - ### Configuration du service NTP - cd /etc - cat >chrony.conf <sshd_config< $deploymt - params: - local_hostname: { get_param: test2_hostname } - sw_repo_base: { get_param: sw_repo_base } - sw_repo_extras: { get_param: sw_repo_extras } - sw_repo_centosplus: { get_param: sw_repo_centosplus } - sw_repo_updates: { get_param: sw_repo_updates } - sw_repo_epel: { get_param: sw_repo_epel } - sw_repo_elrepo: { get_param: sw_repo_elrepo } - sw_repo_nginx: { get_param: sw_repo_nginx } - sw_repo_mariadb_main: { get_param: sw_repo_mariadb_main } - sw_repo_mariadb_maxscale: { get_param: sw_repo_mariadb_maxscale } - sw_repo_mariadb_tools: { get_param: sw_repo_mariadb_tools } - sw_repo_webtatic: { get_param: sw_repo_webtatic } - dns_domain: { get_param: dns_domain } - dns1_oam: { get_param: dns1_oam } - dns2_oam: { get_param: dns2_oam } - ntp1_oam: { get_param: ntp1_oam } - ntp2_oam: { get_param: ntp2_oam } - local_host_ctrl: { get_param: test2_local_host_ctrl } - local_host_oam: { get_param: test2_local_host_oam } - local_host_metro_usr: { get_param: test2_local_host_metro_usr } - local_host_usr: { get_param: test2_local_host_usr } - local_gateway: { get_param: gateway } -# test_vip_metro_usr: { get_param: test_vip_metro_usr } -# test_vip_usr: { get_param: test_vip_usr } - route1: { get_param: ip_route1 } - route2: { get_param: ip_route2 } - route3: { get_param: ip_route3 } - route4: { get_param: ip_route4 } - route5: { get_param: ip_route5 } - route6: { get_param: ip_route6 } - route7: { get_param: ip_route7 } - remote_hostname: { get_param: test2_hostname } - remote_host_oam: { get_param: test2_local_host_oam } - - # Declaration des serveurs - server_test2: - type: OS::Nova::Server - properties: - availability_zone: { get_param: availability_zone } - flavor: { get_param: test_flavor } - name: { get_param: test2_instance_name } - image: { get_param: image } - networks: - - port : { get_resource: port_ctrl_node_test2 } - - port : { get_resource: port_oam_node_test2 } - - port : { get_resource: port_metro_usr_node_test2 } - - port : { get_resource: port_usr_node_test2 } - user_data_format: RAW - user_data: { get_resource: sw_config_node_test2 } \ No newline at end of file diff --git a/DSA_VM_TEST_ENV.yaml b/DSA_VM_TEST_ENV.yaml index 2305615..4d7ac7f 100644 --- a/DSA_VM_TEST_ENV.yaml +++ b/DSA_VM_TEST_ENV.yaml @@ -5,21 +5,18 @@ parameters: image: CentOS-Linux-7.6 - test_flavor: VPS-02vCPU-04vRAM-SWAP-10vHDD + vm_flavor: VPS-02vCPU-08vRAM-SWAP-100vHDD sec_group: CloudBand-SecurityGroup - test1_instance_name: SRV-DSA-VM-TEST01 - test1_hostname: srv-dsa-vm-test01 - test2_instance_name: SRV-DSA-VM-TEST02 - test2_hostname: srv-dsa-vm-test02 + vm1_instance_name: SRV-DSA-VM-vm01 + vm1_hostname: srv-dsa-vm-vm01 #---declaration du volume volume_type: Eseries - test1_volume_name: SRV-DSA-VM-TEST01 - test2_volume_name: SRV-DSA-VM-TEST02 - test_volume_size: 10 + vm1_volume_name: SRV-DSA-VM-vm01 + vm_volume_size: 10 #----declaration des services Communs #--serveur de depot @@ -55,15 +52,10 @@ parameters: net_usr: DSA-ANPTIC-USR #---definition des interfaces - test1_local_host_ctrl: 10.178.21.70 - test1_local_host_oam: 10.178.22.70 - test1_local_host_metro_usr: 10.178.24.70 - test1_local_host_usr: 10.178.23.70 - - test2_local_host_ctrl: 10.178.21.71 - test2_local_host_oam: 10.178.22.71 - test2_local_host_metro_usr: 10.178.24.71 - test2_local_host_usr: 10.178.23.71 + vm1_local_host_ctrl: 10.178.21.70 + vm1_local_host_oam: 10.178.22.70 + vm1_local_host_metro_usr: 10.178.24.70 + vm1_local_host_usr: 10.178.23.70 #---definition de la gateway gateway: 10.178.23.1 @@ -87,4 +79,4 @@ parameters: ip_route7: 10.10.31.68/32 via 10.178.23.1 #---definition des points de montage -# test_mount_dir: /var/lib/mysql \ No newline at end of file +# vm_mount_dir: /var/lib/mysql \ No newline at end of file -- 2.24.1