main.yml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. ---
  2. openshift_aws_create_s3: True
  3. openshift_aws_create_iam_cert: True
  4. openshift_aws_delete_iam_cert: "{{ openshift_aws_create_iam_cert }}"
  5. openshift_aws_create_iam_role: False
  6. openshift_aws_create_security_groups: True
  7. openshift_aws_create_launch_config: True
  8. openshift_aws_create_scale_group: True
  9. openshift_aws_node_group_upgrade: False
  10. openshift_aws_wait_for_ssh: True
  11. openshift_aws_clusterid: default
  12. openshift_aws_region: us-east-1
  13. openshift_aws_vpc_name: "{{ openshift_aws_clusterid }}"
  14. openshift_aws_build_ami_group: "{{ openshift_aws_clusterid }}"
  15. openshift_aws_iam_cert_name: "{{ openshift_aws_clusterid }}-master-external"
  16. openshift_aws_iam_cert_path: ''
  17. openshift_aws_iam_cert_key_path: ''
  18. openshift_aws_iam_role_name: "openshift_node_describe_instances_{{ openshift_aws_clusterid }}"
  19. openshift_aws_iam_role_policy_json: "{{ lookup('file', 'describeinstances.json') }}"
  20. openshift_aws_iam_role_policy_name: "describe_instances_{{ openshift_aws_clusterid }}"
  21. openshift_aws_iam_kms_alias: "alias/{{ openshift_aws_clusterid }}_kms"
  22. openshift_aws_ami: ''
  23. openshift_aws_ami_copy_wait: False
  24. openshift_aws_ami_encrypt: False
  25. openshift_aws_ami_copy_src_region: "{{ openshift_aws_region }}"
  26. openshift_aws_ami_name: openshift-gi
  27. openshift_aws_base_ami_name: ami_base
  28. openshift_aws_instance_type: m4.xlarge
  29. openshift_aws_launch_config_bootstrap_token: ''
  30. openshift_aws_users: []
  31. openshift_aws_copy_base_ami_tags: False
  32. openshift_aws_ami_tags:
  33. bootstrap: "true"
  34. openshift-created: "true"
  35. parent: "{{ openshift_aws_base_ami | default('unknown') }}"
  36. openshift_aws_s3_mode: create
  37. openshift_aws_s3_bucket_name: "{{ openshift_aws_clusterid }}-docker-registry"
  38. openshift_aws_vpc_tags:
  39. Name: "{{ openshift_aws_vpc_name }}"
  40. openshift_aws_vpc:
  41. name: "{{ openshift_aws_vpc_name }}"
  42. cidr: 172.31.0.0/16
  43. subnets:
  44. us-east-1:
  45. - cidr: 172.31.48.0/20
  46. az: "us-east-1c"
  47. # - cidr: 172.31.32.0/20
  48. # az: "us-east-1e"
  49. # - cidr: 172.31.16.0/20
  50. # az: "us-east-1a"
  51. openshift_aws_create_dns: False
  52. openshift_aws_dns_provider: "route53"
  53. # openshift_aws_dns_zone: ""
  54. # ie. openshift_aws_dns_zone: "{{ openshift_aws_clusterid }}.example.com"
  55. # elb names we want to query to support dns record creation.
  56. # you don't need to adjust this unless you have modified openshift_aws_elb_dict
  57. openshift_aws_elb_names:
  58. - "{{ openshift_aws_elb_master_internal_name }}"
  59. - "{{ openshift_aws_elb_master_external_name }}"
  60. - "{{ openshift_aws_elb_infra_name }}"
  61. # l_openshift_aws_elb_facts is created by querying ec2 for all elb names in
  62. # l_openshift_aws_elb_names via tasks/build_elb_dict.yml
  63. openshift_aws_dns_records:
  64. # Pertains to inventory file key: openshift_master_cluster_public_hostname
  65. 'api':
  66. type: 'CNAME'
  67. # A public or private vpc attached Route53 zone will be created based on
  68. # private_zone boolean. Split-tier dns is supported.
  69. private_zone: False
  70. value: "{{ l_openshift_aws_elb_facts[openshift_aws_elb_master_external_name].dns_name }}"
  71. # Pertains to inventory file key: openshift_master_cluster_hostname
  72. 'internal.api':
  73. type: 'CNAME'
  74. private_zone: False
  75. value: "{{ l_openshift_aws_elb_facts[openshift_aws_elb_master_internal_name].dns_name }}"
  76. # Pertains to inventory file key: openshift_master_default_subdomain
  77. '*.apps':
  78. type: "CNAME"
  79. private_zone: False
  80. value: "{{ l_openshift_aws_elb_facts[openshift_aws_elb_infra_name].dns_name }}"
  81. 'logs':
  82. type: "CNAME"
  83. private_zone: False
  84. value: "{{ l_openshift_aws_elb_facts[openshift_aws_elb_infra_name].dns_name }}"
  85. 'metrics':
  86. type: "CNAME"
  87. private_zone: False
  88. value: "{{ l_openshift_aws_elb_facts[openshift_aws_elb_infra_name].dns_name }}"
  89. 'registry':
  90. type: "CNAME"
  91. private_zone: False
  92. value: "{{ l_openshift_aws_elb_facts[openshift_aws_elb_infra_name].dns_name }}"
  93. # Allows users to add and recursively override
  94. # https://docs.ansible.com/ansible/2.5/user_guide/playbooks_filters.html#combining-hashes-dictionaries
  95. openshift_aws_dns_records_override: {}
  96. l_openshift_aws_dns_records: "{{ openshift_aws_dns_records | combine(openshift_aws_dns_records_override, recursive=True) }}"
  97. openshift_aws_elb_basename: "{{ openshift_aws_clusterid }}"
  98. openshift_aws_elb_master_external_name: "{{ openshift_aws_elb_basename }}-master-external"
  99. openshift_aws_elb_master_internal_name: "{{ openshift_aws_elb_basename }}-master-internal"
  100. openshift_aws_elb_infra_name: "{{ openshift_aws_elb_basename }}-infra"
  101. openshift_aws_elb_cert_arn: ''
  102. openshift_aws_elb_dict:
  103. master:
  104. external:
  105. cross_az_load_balancing: False
  106. health_check:
  107. ping_protocol: tcp
  108. ping_port: "{{ openshift_master_api_port }}"
  109. response_timeout: 5
  110. interval: 30
  111. unhealthy_threshold: 2
  112. healthy_threshold: 2
  113. idle_timeout: 400
  114. listeners:
  115. - protocol: tcp
  116. load_balancer_port: 80
  117. instance_protocol: ssl
  118. instance_port: "{{ openshift_master_api_port }}"
  119. - protocol: ssl
  120. load_balancer_port: "{{ openshift_master_api_port }}"
  121. instance_protocol: ssl
  122. instance_port: "{{ openshift_master_api_port }}"
  123. ssl_certificate_id: "{{ openshift_aws_elb_cert_arn }}"
  124. name: "{{ openshift_aws_elb_master_external_name }}"
  125. tags: "{{ openshift_aws_kube_tags }}"
  126. internal:
  127. cross_az_load_balancing: False
  128. health_check:
  129. ping_protocol: tcp
  130. ping_port: "{{ openshift_master_api_port }}"
  131. response_timeout: 5
  132. interval: 30
  133. unhealthy_threshold: 2
  134. healthy_threshold: 2
  135. idle_timeout: 400
  136. listeners:
  137. - protocol: tcp
  138. load_balancer_port: 80
  139. instance_protocol: tcp
  140. instance_port: 80
  141. - protocol: tcp
  142. load_balancer_port: "{{ openshift_master_api_port }}"
  143. instance_protocol: tcp
  144. instance_port: "{{ openshift_master_api_port }}"
  145. name: "{{ openshift_aws_elb_master_internal_name }}"
  146. tags: "{{ openshift_aws_kube_tags }}"
  147. infra:
  148. external:
  149. cross_az_load_balancing: False
  150. health_check:
  151. ping_protocol: tcp
  152. ping_port: 443
  153. response_timeout: 5
  154. interval: 30
  155. unhealthy_threshold: 2
  156. healthy_threshold: 2
  157. idle_timeout: 400
  158. listeners:
  159. - protocol: tcp
  160. load_balancer_port: 80
  161. instance_protocol: tcp
  162. instance_port: 80
  163. proxy_protocol: True
  164. - protocol: tcp
  165. load_balancer_port: 443
  166. instance_protocol: tcp
  167. instance_port: 443
  168. proxy_protocol: True
  169. name: "{{ openshift_aws_elb_infra_name }}"
  170. tags: "{{ openshift_aws_kube_tags }}"
  171. openshift_aws_node_group_config_master_volumes:
  172. - device_name: /dev/sda1
  173. volume_size: 100
  174. volume_type: gp2
  175. delete_on_termination: False
  176. - device_name: /dev/sdb
  177. volume_size: 100
  178. volume_type: gp2
  179. delete_on_termination: False
  180. openshift_aws_node_group_config_node_volumes:
  181. - device_name: /dev/sda1
  182. volume_size: 100
  183. volume_type: gp2
  184. delete_on_termination: True
  185. - device_name: /dev/sdb
  186. volume_size: 100
  187. volume_type: gp2
  188. delete_on_termination: True
  189. # build_instance_tags is a custom filter in role lib_utils
  190. openshift_aws_node_group_config_tags: "{{ openshift_aws_clusterid | build_instance_tags }}"
  191. openshift_aws_node_group_termination_policy: Default
  192. openshift_aws_node_group_replace_instances: []
  193. openshift_aws_node_group_replace_all_instances: False
  194. openshift_aws_ami_map:
  195. master: "{{ openshift_aws_ami }}"
  196. infra: "{{ openshift_aws_ami }}"
  197. compute: "{{ openshift_aws_ami }}"
  198. openshift_aws_master_group:
  199. - name: "{{ openshift_aws_clusterid }} master group"
  200. group: master
  201. node_group_config: node-config-master
  202. tags:
  203. host-type: master
  204. sub-host-type: default
  205. runtime: docker
  206. openshift_aws_node_groups:
  207. - name: "{{ openshift_aws_clusterid }} compute group"
  208. group: compute
  209. node_group_config: node-config-compute
  210. tags:
  211. host-type: node
  212. sub-host-type: compute
  213. runtime: docker
  214. - name: "{{ openshift_aws_clusterid }} infra group"
  215. group: infra
  216. node_group_config: node-config-infra
  217. tags:
  218. host-type: node
  219. sub-host-type: infra
  220. runtime: docker
  221. openshift_aws_created_asgs: []
  222. openshift_aws_current_asgs: []
  223. openshift_aws_scale_group_health_check:
  224. period: 60
  225. type: EC2
  226. # these will be used during upgrade
  227. openshift_aws_master_group_config:
  228. # The 'master' key is always required here.
  229. master:
  230. instance_type: "{{ openshift_aws_master_group_instance_type | default(openshift_aws_instance_type) }}"
  231. volumes: "{{ openshift_aws_node_group_config_master_volumes }}"
  232. health_check: "{{ openshift_aws_scale_group_health_check }}"
  233. min_size: "{{ openshift_aws_master_group_min_size | default(3) }}"
  234. max_size: "{{ openshift_aws_master_group_max_size | default(3) }}"
  235. desired_size: "{{ openshift_aws_master_group_desired_size | default(3) }}"
  236. wait_for_instances: True
  237. termination_policy: "{{ openshift_aws_node_group_termination_policy }}"
  238. replace_all_instances: "{{ openshift_aws_node_group_replace_all_instances }}"
  239. iam_role: "{{ openshift_aws_iam_master_role_name | default(openshift_aws_iam_role_name) }}"
  240. policy_name: "{{ openshift_aws_iam_master_role_policy_name | default(openshift_aws_iam_role_policy_name) }}"
  241. policy_json: "{{ openshift_aws_iam_master_role_policy_json | default(openshift_aws_iam_role_policy_json) }}"
  242. elbs: "{{ openshift_aws_elb_dict | json_query('master.[*][0][*].name') }}"
  243. openshift_aws_node_group_config:
  244. # The 'compute' key is always required here.
  245. compute:
  246. instance_type: "{{ openshift_aws_compute_group_instance_type | default(openshift_aws_instance_type) }}"
  247. volumes: "{{ openshift_aws_node_group_config_node_volumes }}"
  248. health_check: "{{ openshift_aws_scale_group_health_check }}"
  249. min_size: "{{ openshift_aws_compute_group_min_size | default(3) }}"
  250. max_size: "{{ openshift_aws_compute_group_max_size | default(100) }}"
  251. desired_size: "{{ openshift_aws_compute_group_desired_size | default(3) }}"
  252. termination_policy: "{{ openshift_aws_node_group_termination_policy }}"
  253. replace_all_instances: "{{ openshift_aws_node_group_replace_all_instances }}"
  254. iam_role: "{{ openshift_aws_iam_node_role_name | default(openshift_aws_iam_role_name) }}"
  255. policy_name: "{{ openshift_aws_iam_node_role_policy_name | default(openshift_aws_iam_role_policy_name) }}"
  256. policy_json: "{{ openshift_aws_iam_node_role_policy_json | default(openshift_aws_iam_role_policy_json) }}"
  257. # The 'infra' key is always required here.
  258. infra:
  259. instance_type: "{{ openshift_aws_infra_group_instance_type | default(openshift_aws_instance_type) }}"
  260. volumes: "{{ openshift_aws_node_group_config_node_volumes }}"
  261. health_check: "{{ openshift_aws_scale_group_health_check }}"
  262. min_size: "{{ openshift_aws_infra_group_min_size | default(2) }}"
  263. max_size: "{{ openshift_aws_infra_group_max_size | default(20) }}"
  264. desired_size: "{{ openshift_aws_infra_group_desired_size | default(2) }}"
  265. termination_policy: "{{ openshift_aws_node_group_termination_policy }}"
  266. replace_all_instances: "{{ openshift_aws_node_group_replace_all_instances }}"
  267. iam_role: "{{ openshift_aws_iam_node_role_name | default(openshift_aws_iam_role_name) }}"
  268. policy_name: "{{ openshift_aws_iam_node_role_policy_name | default(openshift_aws_iam_role_policy_name) }}"
  269. policy_json: "{{ openshift_aws_iam_node_role_policy_json | default(openshift_aws_iam_role_policy_json) }}"
  270. elbs: "{{ openshift_aws_elb_dict | json_query('infra.[*][0][*].name') }}"
  271. # build_instance_tags is a custom filter in role lib_utils
  272. openshift_aws_kube_tags: "{{ openshift_aws_clusterid | build_instance_tags }}"
  273. openshift_aws_elb_security_groups: "{{ openshift_aws_launch_config_security_groups }}"
  274. openshift_aws_launch_config_security_groups:
  275. compute:
  276. - "{{ openshift_aws_clusterid }}" # default sg
  277. - "{{ openshift_aws_clusterid }}_compute" # node type sg
  278. - "{{ openshift_aws_clusterid }}_compute_k8s" # node type sg k8s
  279. infra:
  280. - "{{ openshift_aws_clusterid }}" # default sg
  281. - "{{ openshift_aws_clusterid }}_infra" # node type sg
  282. - "{{ openshift_aws_clusterid }}_infra_k8s" # node type sg k8s
  283. master:
  284. - "{{ openshift_aws_clusterid }}" # default sg
  285. - "{{ openshift_aws_clusterid }}_master" # node type sg
  286. - "{{ openshift_aws_clusterid }}_master_k8s" # node type sg k8s
  287. openshift_aws_security_groups_tags: "{{ openshift_aws_kube_tags }}"
  288. openshift_aws_node_security_groups:
  289. default:
  290. name: "{{ openshift_aws_clusterid }}"
  291. desc: "{{ openshift_aws_clusterid }} default"
  292. rules:
  293. - proto: tcp
  294. from_port: 22
  295. to_port: 22
  296. cidr_ip: 0.0.0.0/0
  297. - proto: all
  298. from_port: 1
  299. to_port: 65535
  300. group_name: "{{ openshift_aws_clusterid }}"
  301. master:
  302. name: "{{ openshift_aws_clusterid }}_master"
  303. desc: "{{ openshift_aws_clusterid }} master instances"
  304. rules:
  305. - proto: tcp
  306. from_port: 80
  307. to_port: 80
  308. cidr_ip: 0.0.0.0/0
  309. - proto: tcp
  310. from_port: "{{ openshift_master_api_port }}"
  311. to_port: "{{ openshift_master_api_port }}"
  312. cidr_ip: 0.0.0.0/0
  313. compute:
  314. name: "{{ openshift_aws_clusterid }}_compute"
  315. desc: "{{ openshift_aws_clusterid }} compute node instances"
  316. infra:
  317. name: "{{ openshift_aws_clusterid }}_infra"
  318. desc: "{{ openshift_aws_clusterid }} infra node instances"
  319. rules:
  320. - proto: tcp
  321. from_port: 80
  322. to_port: 80
  323. cidr_ip: 0.0.0.0/0
  324. - proto: tcp
  325. from_port: "{{ openshift_master_api_port }}"
  326. to_port: "{{ openshift_master_api_port }}"
  327. cidr_ip: 0.0.0.0/0
  328. - proto: tcp
  329. from_port: 30000
  330. to_port: 32000
  331. cidr_ip: 0.0.0.0/0
  332. etcd:
  333. name: "{{ openshift_aws_clusterid }}_etcd"
  334. desc: "{{ openshift_aws_clusterid }} etcd instances"
  335. openshift_aws_node_run_bootstrap_startup: True
  336. openshift_aws_node_user_data: ''
  337. openshift_aws_node_config_namespace: openshift-node
  338. openshift_aws_masters_groups: masters,etcd,nodes
  339. # By default, don't delete things like the shared IAM instance
  340. # profile and uploaded ssh keys
  341. openshift_aws_enable_uninstall_shared_objects: False
  342. # S3 bucket names are global by default and can take minutes/hours for the
  343. # name to become available for re-use (assuming someone doesn't take the
  344. # name in the meantime). Default to just emptying the contents of the S3
  345. # bucket if we've been asked to create the bucket during provisioning.
  346. openshift_aws_really_delete_s3_bucket: False