main.yml 15 KB

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