main.yml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  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. # Set scheme [internal|internet-facing]
  126. scheme: internet-facing
  127. tags: "{{ openshift_aws_kube_tags }}"
  128. internal:
  129. cross_az_load_balancing: False
  130. health_check:
  131. ping_protocol: tcp
  132. ping_port: "{{ openshift_master_api_port }}"
  133. response_timeout: 5
  134. interval: 30
  135. unhealthy_threshold: 2
  136. healthy_threshold: 2
  137. idle_timeout: 400
  138. listeners:
  139. - protocol: tcp
  140. load_balancer_port: 80
  141. instance_protocol: tcp
  142. instance_port: 80
  143. - protocol: tcp
  144. load_balancer_port: "{{ openshift_master_api_port }}"
  145. instance_protocol: tcp
  146. instance_port: "{{ openshift_master_api_port }}"
  147. name: "{{ openshift_aws_elb_master_internal_name }}"
  148. # Set scheme [internal|internet-facing]
  149. scheme: internal
  150. tags: "{{ openshift_aws_kube_tags }}"
  151. infra:
  152. external:
  153. cross_az_load_balancing: False
  154. health_check:
  155. ping_protocol: tcp
  156. ping_port: 443
  157. response_timeout: 5
  158. interval: 30
  159. unhealthy_threshold: 2
  160. healthy_threshold: 2
  161. idle_timeout: 400
  162. listeners:
  163. - protocol: tcp
  164. load_balancer_port: 80
  165. instance_protocol: tcp
  166. instance_port: 80
  167. proxy_protocol: True
  168. - protocol: tcp
  169. load_balancer_port: 443
  170. instance_protocol: tcp
  171. instance_port: 443
  172. proxy_protocol: True
  173. name: "{{ openshift_aws_elb_infra_name }}"
  174. # Set scheme [internal|internet-facing]
  175. scheme: internet-facing
  176. tags: "{{ openshift_aws_kube_tags }}"
  177. openshift_aws_node_group_config_master_volumes:
  178. - device_name: /dev/sda1
  179. volume_size: 100
  180. volume_type: gp2
  181. delete_on_termination: False
  182. - device_name: /dev/sdb
  183. volume_size: 100
  184. volume_type: gp2
  185. delete_on_termination: False
  186. openshift_aws_node_group_config_node_volumes:
  187. - device_name: /dev/sda1
  188. volume_size: 100
  189. volume_type: gp2
  190. delete_on_termination: True
  191. - device_name: /dev/sdb
  192. volume_size: 100
  193. volume_type: gp2
  194. delete_on_termination: True
  195. # build_instance_tags is a custom filter in role lib_utils
  196. openshift_aws_node_group_config_tags: "{{ openshift_aws_clusterid | build_instance_tags }}"
  197. openshift_aws_node_group_termination_policy: Default
  198. openshift_aws_node_group_replace_instances: []
  199. openshift_aws_node_group_replace_all_instances: False
  200. openshift_aws_ami_map:
  201. master: "{{ openshift_aws_ami }}"
  202. infra: "{{ openshift_aws_ami }}"
  203. compute: "{{ openshift_aws_ami }}"
  204. openshift_aws_master_group:
  205. - name: "{{ openshift_aws_clusterid }} master group"
  206. group: master
  207. node_group_config: node-config-master
  208. tags:
  209. host-type: master
  210. sub-host-type: default
  211. runtime: docker
  212. openshift_aws_node_groups:
  213. - name: "{{ openshift_aws_clusterid }} compute group"
  214. group: compute
  215. node_group_config: node-config-compute
  216. tags:
  217. host-type: node
  218. sub-host-type: compute
  219. runtime: docker
  220. - name: "{{ openshift_aws_clusterid }} infra group"
  221. group: infra
  222. node_group_config: node-config-infra
  223. tags:
  224. host-type: node
  225. sub-host-type: infra
  226. runtime: docker
  227. openshift_aws_created_asgs: []
  228. openshift_aws_current_asgs: []
  229. openshift_aws_scale_group_health_check:
  230. period: 60
  231. type: EC2
  232. # these will be used during upgrade
  233. openshift_aws_master_group_config:
  234. # The 'master' key is always required here.
  235. master:
  236. instance_type: "{{ openshift_aws_master_group_instance_type | default(openshift_aws_instance_type) }}"
  237. volumes: "{{ openshift_aws_node_group_config_master_volumes }}"
  238. health_check: "{{ openshift_aws_scale_group_health_check }}"
  239. min_size: "{{ openshift_aws_master_group_min_size | default(3) }}"
  240. max_size: "{{ openshift_aws_master_group_max_size | default(3) }}"
  241. desired_size: "{{ openshift_aws_master_group_desired_size | default(3) }}"
  242. wait_for_instances: True
  243. termination_policy: "{{ openshift_aws_node_group_termination_policy }}"
  244. replace_all_instances: "{{ openshift_aws_node_group_replace_all_instances }}"
  245. iam_role: "{{ openshift_aws_iam_master_role_name | default(openshift_aws_iam_role_name) }}"
  246. policy_name: "{{ openshift_aws_iam_master_role_policy_name | default(openshift_aws_iam_role_policy_name) }}"
  247. policy_json: "{{ openshift_aws_iam_master_role_policy_json | default(openshift_aws_iam_role_policy_json) }}"
  248. elbs: "{{ openshift_aws_elb_dict | json_query('master.[*][0][*].name') }}"
  249. openshift_aws_node_group_config:
  250. # The 'compute' key is always required here.
  251. compute:
  252. instance_type: "{{ openshift_aws_compute_group_instance_type | default(openshift_aws_instance_type) }}"
  253. volumes: "{{ openshift_aws_node_group_config_node_volumes }}"
  254. health_check: "{{ openshift_aws_scale_group_health_check }}"
  255. min_size: "{{ openshift_aws_compute_group_min_size | default(3) }}"
  256. max_size: "{{ openshift_aws_compute_group_max_size | default(100) }}"
  257. desired_size: "{{ openshift_aws_compute_group_desired_size | default(3) }}"
  258. termination_policy: "{{ openshift_aws_node_group_termination_policy }}"
  259. replace_all_instances: "{{ openshift_aws_node_group_replace_all_instances }}"
  260. iam_role: "{{ openshift_aws_iam_node_role_name | default(openshift_aws_iam_role_name) }}"
  261. policy_name: "{{ openshift_aws_iam_node_role_policy_name | default(openshift_aws_iam_role_policy_name) }}"
  262. policy_json: "{{ openshift_aws_iam_node_role_policy_json | default(openshift_aws_iam_role_policy_json) }}"
  263. # The 'infra' key is always required here.
  264. infra:
  265. instance_type: "{{ openshift_aws_infra_group_instance_type | default(openshift_aws_instance_type) }}"
  266. volumes: "{{ openshift_aws_node_group_config_node_volumes }}"
  267. health_check: "{{ openshift_aws_scale_group_health_check }}"
  268. min_size: "{{ openshift_aws_infra_group_min_size | default(2) }}"
  269. max_size: "{{ openshift_aws_infra_group_max_size | default(20) }}"
  270. desired_size: "{{ openshift_aws_infra_group_desired_size | default(2) }}"
  271. termination_policy: "{{ openshift_aws_node_group_termination_policy }}"
  272. replace_all_instances: "{{ openshift_aws_node_group_replace_all_instances }}"
  273. iam_role: "{{ openshift_aws_iam_node_role_name | default(openshift_aws_iam_role_name) }}"
  274. policy_name: "{{ openshift_aws_iam_node_role_policy_name | default(openshift_aws_iam_role_policy_name) }}"
  275. policy_json: "{{ openshift_aws_iam_node_role_policy_json | default(openshift_aws_iam_role_policy_json) }}"
  276. elbs: "{{ openshift_aws_elb_dict | json_query('infra.[*][0][*].name') }}"
  277. # build_instance_tags is a custom filter in role lib_utils
  278. openshift_aws_kube_tags: "{{ openshift_aws_clusterid | build_instance_tags }}"
  279. openshift_aws_elb_security_groups: "{{ openshift_aws_launch_config_security_groups }}"
  280. openshift_aws_launch_config_security_groups:
  281. compute:
  282. - "{{ openshift_aws_clusterid }}" # default sg
  283. - "{{ openshift_aws_clusterid }}_compute" # node type sg
  284. - "{{ openshift_aws_clusterid }}_compute_k8s" # node type sg k8s
  285. infra:
  286. - "{{ openshift_aws_clusterid }}" # default sg
  287. - "{{ openshift_aws_clusterid }}_infra" # node type sg
  288. - "{{ openshift_aws_clusterid }}_infra_k8s" # node type sg k8s
  289. master:
  290. - "{{ openshift_aws_clusterid }}" # default sg
  291. - "{{ openshift_aws_clusterid }}_master" # node type sg
  292. - "{{ openshift_aws_clusterid }}_master_k8s" # node type sg k8s
  293. openshift_aws_security_groups_tags: "{{ openshift_aws_kube_tags }}"
  294. openshift_aws_node_security_groups:
  295. default:
  296. name: "{{ openshift_aws_clusterid }}"
  297. desc: "{{ openshift_aws_clusterid }} default"
  298. rules:
  299. - proto: tcp
  300. from_port: 22
  301. to_port: 22
  302. cidr_ip: 0.0.0.0/0
  303. - proto: all
  304. from_port: 1
  305. to_port: 65535
  306. group_name: "{{ openshift_aws_clusterid }}"
  307. master:
  308. name: "{{ openshift_aws_clusterid }}_master"
  309. desc: "{{ openshift_aws_clusterid }} master instances"
  310. rules:
  311. - proto: tcp
  312. from_port: 80
  313. to_port: 80
  314. cidr_ip: 0.0.0.0/0
  315. - proto: tcp
  316. from_port: "{{ openshift_master_api_port }}"
  317. to_port: "{{ openshift_master_api_port }}"
  318. cidr_ip: 0.0.0.0/0
  319. compute:
  320. name: "{{ openshift_aws_clusterid }}_compute"
  321. desc: "{{ openshift_aws_clusterid }} compute node instances"
  322. infra:
  323. name: "{{ openshift_aws_clusterid }}_infra"
  324. desc: "{{ openshift_aws_clusterid }} infra node instances"
  325. rules:
  326. - proto: tcp
  327. from_port: 80
  328. to_port: 80
  329. cidr_ip: 0.0.0.0/0
  330. - proto: tcp
  331. from_port: "{{ openshift_master_api_port }}"
  332. to_port: "{{ openshift_master_api_port }}"
  333. cidr_ip: 0.0.0.0/0
  334. - proto: tcp
  335. from_port: 30000
  336. to_port: 32000
  337. cidr_ip: 0.0.0.0/0
  338. etcd:
  339. name: "{{ openshift_aws_clusterid }}_etcd"
  340. desc: "{{ openshift_aws_clusterid }} etcd instances"
  341. openshift_aws_node_run_bootstrap_startup: True
  342. openshift_aws_node_user_data: ''
  343. openshift_aws_node_config_namespace: openshift-node
  344. openshift_aws_masters_groups: masters,etcd,nodes
  345. # By default, don't delete things like the shared IAM instance
  346. # profile and uploaded ssh keys
  347. openshift_aws_enable_uninstall_shared_objects: False
  348. # S3 bucket names are global by default and can take minutes/hours for the
  349. # name to become available for re-use (assuming someone doesn't take the
  350. # name in the meantime). Default to just emptying the contents of the S3
  351. # bucket if we've been asked to create the bucket during provisioning.
  352. openshift_aws_really_delete_s3_bucket: False