main.yml 15 KB

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