Vladimir Khlyunev | cc648af | 2024-04-25 19:56:40 +0400 | [diff] [blame] | 1 | heat_template_version: queens |
| 2 | |
| 3 | description: Single server instance fragment |
| 4 | |
| 5 | parameters: |
| 6 | seed_net: |
| 7 | type: string |
| 8 | default: 'system-phys-2401' |
| 9 | seed_subnet_cfg01_ip: |
| 10 | type: string |
| 11 | default: "172.16.180.2" |
| 12 | seed_subnet_gateway_ip: |
| 13 | type: string |
| 14 | default: 172.16.180.1 |
| 15 | seed_subnet_cidr: |
| 16 | type: string |
| 17 | default: 172.16.180.0/23 |
Vladimir Khlyunev | e03b04f | 2024-04-26 02:57:02 +0400 | [diff] [blame] | 18 | seed_subnet_dhcp: |
Vladimir Khlyunev | cc648af | 2024-04-25 19:56:40 +0400 | [diff] [blame] | 19 | type: boolean |
| 20 | default: false |
| 21 | seed_subnet_pool_start: |
| 22 | type: string |
Vladimir Khlyunev | d485ad1 | 2024-09-10 15:15:39 +0300 | [diff] [blame^] | 23 | default: 172.16.181.252 |
Vladimir Khlyunev | cc648af | 2024-04-25 19:56:40 +0400 | [diff] [blame] | 24 | seed_subnet_pool_end: |
| 25 | type: string |
Vladimir Khlyunev | d485ad1 | 2024-09-10 15:15:39 +0300 | [diff] [blame^] | 26 | default: 172.16.181.254 |
Vladimir Khlyunev | cc648af | 2024-04-25 19:56:40 +0400 | [diff] [blame] | 27 | nameservers: |
| 28 | type: comma_delimited_list |
| 29 | default: '172.18.176.6,172.16.180.1,8.8.8.8' |
| 30 | flavor: |
| 31 | type: string |
| 32 | default: kaas.medium |
Vladimir Khlyunev | e03b04f | 2024-04-26 02:57:02 +0400 | [diff] [blame] | 33 | seed_instance_name: |
Vladimir Khlyunev | cc648af | 2024-04-25 19:56:40 +0400 | [diff] [blame] | 34 | type: string |
Vladimir Khlyunev | e03b04f | 2024-04-26 02:57:02 +0400 | [diff] [blame] | 35 | default: mcc-mosk |
Vladimir Khlyunev | cc648af | 2024-04-25 19:56:40 +0400 | [diff] [blame] | 36 | key_pair: |
| 37 | type: string |
Vladimir Khlyunev | e03b04f | 2024-04-26 02:57:02 +0400 | [diff] [blame] | 38 | # default: vkhlyunev |
Vladimir Khlyunev | cc648af | 2024-04-25 19:56:40 +0400 | [diff] [blame] | 39 | default: system-key-8133 |
| 40 | seed_instance_domain: |
| 41 | type: string |
| 42 | default: msust |
| 43 | net_public: |
| 44 | type: string |
| 45 | default: public |
| 46 | availability_zone: |
| 47 | type: string |
| 48 | default: nova |
| 49 | instance_boot_timeout: |
| 50 | type: number |
| 51 | default: 600 |
Vladimir Khlyunev | e03b04f | 2024-04-26 02:57:02 +0400 | [diff] [blame] | 52 | env_name: |
| 53 | type: string |
Vladimir Khlyunev | cc648af | 2024-04-25 19:56:40 +0400 | [diff] [blame] | 54 | |
| 55 | resources: |
| 56 | instance_wait_handle: |
| 57 | type: OS::Heat::WaitConditionHandle |
| 58 | |
| 59 | instance_wait_condition: |
| 60 | type: OS::Heat::WaitCondition |
Vladimir Khlyunev | e03b04f | 2024-04-26 02:57:02 +0400 | [diff] [blame] | 61 | depends_on: seed_instance |
Vladimir Khlyunev | cc648af | 2024-04-25 19:56:40 +0400 | [diff] [blame] | 62 | properties: |
| 63 | handle: { get_resource: instance_wait_handle } |
| 64 | timeout: { get_param: instance_boot_timeout } |
| 65 | |
| 66 | seed_subnet: |
| 67 | type: OS::Neutron::Subnet |
| 68 | properties: |
| 69 | name: { list_join: ['-', [ { get_param: seed_net }, 'subnet', { get_param: env_name } ]] } |
| 70 | network: { get_param: seed_net } |
| 71 | gateway_ip: { get_param: seed_subnet_gateway_ip } |
| 72 | cidr: { get_param: seed_subnet_cidr } |
| 73 | enable_dhcp: { get_param: seed_subnet_dhcp } |
Vladimir Khlyunev | d485ad1 | 2024-09-10 15:15:39 +0300 | [diff] [blame^] | 74 | allocation_pools: |
| 75 | - start: { get_param: seed_subnet_pool_start } |
| 76 | end: { get_param: seed_subnet_pool_end } |
Vladimir Khlyunev | cc648af | 2024-04-25 19:56:40 +0400 | [diff] [blame] | 77 | dns_nameservers: { get_param: nameservers } |
| 78 | |
| 79 | seed_port01: |
| 80 | type: OS::Neutron::Port |
| 81 | properties: |
| 82 | port_security_enabled: false |
| 83 | network_id: { get_param: seed_net } |
| 84 | fixed_ips: |
| 85 | - ip_address: { get_param: seed_subnet_cfg01_ip } |
| 86 | |
| 87 | seed_instance: |
| 88 | type: OS::Nova::Server |
| 89 | depends_on: seed_subnet |
| 90 | properties: |
| 91 | image_update_policy: REBUILD |
| 92 | flavor: { get_param: flavor } |
| 93 | image: 'focal-server-cloudimg-amd64-20220419' |
| 94 | key_name: { get_param: key_pair } |
| 95 | availability_zone: { get_param: availability_zone } |
| 96 | name: |
| 97 | list_join: |
| 98 | - '.' |
| 99 | - [ { get_param: seed_instance_name }, { get_param: seed_instance_domain } ] |
| 100 | networks: |
| 101 | - port: { get_resource: seed_port01 } |
| 102 | user_data_format: RAW |
| 103 | user_data: |
| 104 | str_replace: |
| 105 | template: { get_file: mcc_seed_2401_userdata.yaml } |
| 106 | params: |
| 107 | $wait_condition_notify: { get_attr: [ instance_wait_handle, curl_cli ] } |
| 108 | $os_az: { get_param: availability_zone } |
| 109 | $nameservers: { get_param: nameservers } |
Vladimir Khlyunev | e03b04f | 2024-04-26 02:57:02 +0400 | [diff] [blame] | 110 | |
| 111 | outputs: |
| 112 | seed_ext_ip: |
| 113 | description: IP for ssh access |
| 114 | value: { get_param: seed_subnet_cfg01_ip } |