Heat templates for deploying OpenStack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1618 lines
72KB

  1. # certain initialization steps (run in a container) will occur
  2. # on the role marked as primary controller or the first role listed
  3. {%- if enabled_roles is not defined or enabled_roles == [] -%}
  4. # On upgrade certain roles can be disabled for operator driven upgrades
  5. # See major_upgrade_steps.j2.yaml and post-upgrade.j2.yaml
  6. {%- set enabled_roles = roles -%}
  7. {%- endif -%}
  8. {%- set primary_role = [enabled_roles[0]] -%}
  9. {%- for role in enabled_roles -%}
  10. {%- if 'primary' in role.tags and 'controller' in role.tags -%}
  11. {%- set _ = primary_role.pop() -%}
  12. {%- set _ = primary_role.append(role) -%}
  13. {%- endif -%}
  14. {%- endfor -%}
  15. {%- set primary_role_name = primary_role[0].name -%}
  16. # primary role is: {{primary_role_name}}
  17. {% set deploy_steps_max = 6 -%}
  18. {% set update_steps_max = 6 -%}
  19. {% set external_update_steps_max = 2 -%}
  20. {% set pre_upgrade_rolling_steps_max = 1 -%}
  21. {% set upgrade_steps_max = 6 -%}
  22. {% set external_upgrade_steps_max = 3 -%}
  23. {% set post_upgrade_steps_max = 4 -%}
  24. {% set fast_forward_upgrade_steps_max = 9 -%}
  25. {% set fast_forward_upgrade_prep_steps_max = 3 -%}
  26. {% set post_update_steps_max = 4 -%}
  27. {% set scale_steps_max = 1 -%}
  28. heat_template_version: rocky
  29. description: >
  30. Post-deploy configuration steps via puppet for all roles,
  31. as defined in ../roles_data.yaml
  32. parameters:
  33. servers:
  34. type: json
  35. description: Mapping of Role name e.g Controller to a list of servers
  36. role_data:
  37. type: json
  38. description: Mapping of Role name e.g Controller to the per-role data
  39. DeployIdentifier:
  40. default: ''
  41. type: string
  42. description: >
  43. Setting this to a unique value will re-run any deployment tasks which
  44. perform configuration on a Heat stack-update.
  45. deployment_source_hosts:
  46. default: 'Undercloud'
  47. type: string
  48. description: Host or hostgroup that runs the deployment
  49. deployment_target_hosts:
  50. default: 'overcloud'
  51. type: string
  52. description: Host or hostgroup that consists of the target systems for the deployment
  53. EndpointMap:
  54. default: {}
  55. description: Mapping of service endpoint -> protocol. Typically set
  56. via parameter_defaults in the resource registry.
  57. type: json
  58. ConfigDebug:
  59. default: false
  60. description: Whether to run config management (e.g. Puppet) in debug mode.
  61. type: boolean
  62. EnablePuppet:
  63. default: true
  64. description: Whether to run the puppet (baremetal) deployment tasks.
  65. type: boolean
  66. EnablePaunch:
  67. default: true
  68. description: Whether to run paunch during container deployment tasks.
  69. type: boolean
  70. DockerPuppetDebug:
  71. type: boolean
  72. default: false
  73. description: Set to True to enable debug logging with container-puppet.py
  74. DockerPuppetProcessCount:
  75. type: number
  76. default: 6
  77. description: Number of concurrent processes to use when running container-puppet to generate config files.
  78. ContainerCli:
  79. type: string
  80. default: 'podman'
  81. description: CLI tool used to manage containers.
  82. constraints:
  83. - allowed_values: ['docker', 'podman']
  84. DockerPuppetMountHostPuppet:
  85. type: boolean
  86. default: true
  87. description: Whether containerized puppet executions use modules from the baremetal host. Defaults to true. Can be set to false to consume puppet modules from containers directly.
  88. FastForwardUpgradeReleases:
  89. type: comma_delimited_list
  90. default: ['ocata', 'pike', 'queens']
  91. description: List of releases to fast forward through during upgrade. Last release in list is used for post steps.
  92. ContainerLogStdoutPath:
  93. type: string
  94. description: Absolute path for container stdout output (Podman only)
  95. default: /var/log/containers/stdouts
  96. ContainerHealthcheckDisabled:
  97. type: boolean
  98. description: Whether or not we disable the container healthcheck.
  99. default: false
  100. SELinuxMode:
  101. default: 'enforcing'
  102. description: Configures SELinux mode
  103. type: string
  104. constraints:
  105. - allowed_values: [ 'enforcing', 'permissive', 'disabled' ]
  106. {% for role in enabled_roles %}
  107. {{role.name}}Count:
  108. description: Number of {{role.name}} nodes to deploy
  109. type: number
  110. default: {{role.CountDefault|default(0)}}
  111. {% endfor %}
  112. ServiceNetMapLower:
  113. description: Mapping of service name to network name
  114. type: json
  115. default: {}
  116. ValidateControllersIcmp:
  117. default: true
  118. description: Validation to ensure that all controllers can be reached with ICMP
  119. type: boolean
  120. ValidateGatewaysIcmp:
  121. default: true
  122. description: Validation to ensure that all gateways can be reached with ICMP
  123. type: boolean
  124. ValidateFqdn:
  125. default: false
  126. description: Optional validation to ensure FQDN as set by Nova matches the name set in /etc/hosts.
  127. type: boolean
  128. ValidateNtp:
  129. default: true
  130. description: Validation to ensure at least one time source is accessible.
  131. type: boolean
  132. PingTestIpsMap:
  133. default: ''
  134. description: A map of role name to a space separated list of IP addresses used to ping test each available network interface.
  135. type: json
  136. StackAction:
  137. type: string
  138. description: >
  139. Heat action on performed top-level stack. Note StackUpdateType is
  140. set to UPGRADE when a major-version upgrade is in progress.
  141. constraints:
  142. - allowed_values: ['CREATE', 'UPDATE']
  143. DeployArtifactURLs:
  144. default: []
  145. description: A list of HTTP URLs containing deployment artifacts.
  146. Currently supports tarballs and RPM packages.
  147. type: comma_delimited_list
  148. HostsEntry:
  149. default: ''
  150. type: string
  151. description: A string of entries to be added to /etc/hosts on each node.
  152. AnsibleHostVarsMap:
  153. type: json
  154. default: {}
  155. StackUpdateType:
  156. type: string
  157. description: >
  158. Type of update, to differentiate between UPGRADE and UPDATE cases
  159. when StackAction is UPDATE (both are the same stack action).
  160. constraints:
  161. - allowed_values: ['', 'UPGRADE', 'FASTFORWARDUPGRADE']
  162. default: ''
  163. ContainerCli:
  164. type: string
  165. default: 'podman'
  166. description: CLI tool used to manage containers.
  167. constraints:
  168. - allowed_values: ['docker', 'podman']
  169. EnabledServices:
  170. default: []
  171. type: comma_delimited_list
  172. ControlVirtualIP:
  173. type: string
  174. EnabledNetworks:
  175. type: comma_delimited_list
  176. NetVipMap:
  177. type: json
  178. {%- for network in networks if network.enabled|default(true) %}
  179. {{network.name}}NetName:
  180. default: {{network.name_lower}}
  181. description: The name of the {{network.name_lower}} network.
  182. type: string
  183. {%- endfor %}
  184. CloudNames:
  185. type: json
  186. EnableInternalTLS:
  187. type: boolean
  188. default: false
  189. CloudDomain:
  190. default: 'localdomain'
  191. type: string
  192. description: >
  193. The DNS domain used for the hosts. This must match the
  194. overcloud_domain_name configured on the undercloud.
  195. NovaAdditionalCell:
  196. default: false
  197. description: Whether this is an cell additional to the default cell.
  198. type: boolean
  199. AllNodesExtraMapData:
  200. default: {}
  201. type: json
  202. description: Map of extra data (hieradata) to set on each node.
  203. conditions:
  204. {% for role in enabled_roles %}
  205. {{role.name}}NonZero:
  206. not:
  207. equals:
  208. - {get_param: {{role.name}}Count}
  209. - 0
  210. {% endfor %}
  211. resources:
  212. ExternalDeployTasks:
  213. type: OS::Heat::Value
  214. properties:
  215. type: comma_delimited_list
  216. value:
  217. yaql:
  218. # processing from per-role unique tasks into globally unique tasks
  219. expression: coalesce($.data, []).flatten().distinct()
  220. data:
  221. {%- for role in enabled_roles %}
  222. - get_param: [role_data, {{role.name}}, external_deploy_tasks]
  223. {%- endfor %}
  224. ExternalPostDeployTasks:
  225. type: OS::Heat::Value
  226. properties:
  227. type: comma_delimited_list
  228. value:
  229. yaql:
  230. # processing from per-role unique tasks into globally unique tasks
  231. expression: coalesce($.data, []).flatten().distinct()
  232. data:
  233. {%- for role in enabled_roles %}
  234. - get_param: [role_data, {{role.name}}, external_post_deploy_tasks]
  235. {%- endfor %}
  236. ScaleTasks:
  237. type: OS::Heat::Value
  238. properties:
  239. type: comma_delimited_list
  240. value:
  241. yaql:
  242. # processing from per-role unique tasks into globally unique tasks
  243. expression: coalesce($.data, []).flatten().distinct()
  244. data:
  245. {%- for role in enabled_roles %}
  246. - get_param: [role_data, {{role.name}}, scale_tasks]
  247. {%- endfor %}
  248. ExternalUpdateTasks:
  249. type: OS::Heat::Value
  250. properties:
  251. type: comma_delimited_list
  252. value:
  253. yaql:
  254. # processing from per-role unique tasks into globally unique tasks
  255. expression: coalesce($.data, []).flatten().distinct()
  256. data:
  257. {%- for role in enabled_roles %}
  258. - get_param: [role_data, {{role.name}}, external_update_tasks]
  259. {%- endfor %}
  260. ExternalUpgradeTasks:
  261. type: OS::Heat::Value
  262. properties:
  263. type: comma_delimited_list
  264. value:
  265. yaql:
  266. # processing from per-role unique tasks into globally unique tasks
  267. expression: coalesce($.data, []).flatten().distinct()
  268. data:
  269. {%- for role in enabled_roles %}
  270. - get_param: [role_data, {{role.name}}, external_upgrade_tasks]
  271. {%- endfor %}
  272. BootstrapServerId:
  273. type: OS::Heat::Value
  274. properties:
  275. value:
  276. yaql:
  277. # Use a constant string of "bootstrap_server_id" when there are no
  278. # servers in the primary role, such as in the case when all
  279. # Controllers are blacklisted. No server id's will match the string
  280. # which is what we want when all are blacklisted.
  281. expression: switch($.data = {} => "no_bootstrap_server", $.data != {} => $.data.items().orderBy($[0]).first()[1])
  282. data: {get_param: [servers, {{primary_role_name}}]}
  283. # BEGIN CONFIG STEPS, only on enabled_roles
  284. {%- for role in enabled_roles %}
  285. # Note, this should be the last step to execute configuration changes.
  286. # Ensure that all {{role.name}}ExtraConfigPost steps are executed
  287. # after all the previous deployment steps.
  288. {{role.name}}ExtraConfigPost:
  289. condition: {{role.name}}NonZero
  290. type: OS::TripleO::NodeExtraConfigPost
  291. properties:
  292. servers: {get_param: [servers, {{role.name}}]}
  293. EndpointMap: {get_param: EndpointMap}
  294. # The {{role.name}}PostConfig steps are in charge of
  295. # quiescing all services, i.e. in the Controller case,
  296. # we should run a full service reload.
  297. {{role.name}}PostConfig:
  298. condition: {{role.name}}NonZero
  299. type: OS::TripleO::Tasks::{{role.name}}PostConfig
  300. depends_on:
  301. {%- for dep in enabled_roles %}
  302. - {{dep.name}}ExtraConfigPost
  303. {%- endfor %}
  304. properties:
  305. servers: {get_param: servers}
  306. input_values:
  307. deploy_identifier: {get_param: DeployIdentifier}
  308. {% endfor %}
  309. outputs:
  310. RoleConfig:
  311. description: Mapping of config data for all roles
  312. value:
  313. global_vars:
  314. deploy_steps_max: {{deploy_steps_max}}
  315. service_net_map: {get_param: ServiceNetMapLower}
  316. validate_controllers_icmp: {get_param: ValidateControllersIcmp}
  317. validate_gateways_icmp: {get_param: ValidateGatewaysIcmp}
  318. validate_fqdn: {get_param: ValidateFqdn}
  319. validate_ntp: {get_param: ValidateNtp}
  320. ping_test_ips: {get_param: PingTestIpsMap}
  321. stack_action: {get_param: StackAction}
  322. deploy_artifact_urls: {list_join: [' ', {get_param: DeployArtifactURLs}]}
  323. hosts_entry: {get_param: HostsEntry}
  324. primary_role_name: {{ primary_role_name }}
  325. deploy_identifier: {get_param: DeployIdentifier}
  326. stack_update_type: {get_param: StackUpdateType}
  327. container_cli: {get_param: ContainerCli}
  328. enable_paunch: {get_param: EnablePaunch}
  329. enabled_services: {get_param: EnabledServices}
  330. control_virtual_ip: {get_param: ControlVirtualIP}
  331. enabled_networks: {get_param: EnabledNetworks}
  332. net_vip_map: {get_param: NetVipMap}
  333. nova_additional_cell: {get_param: NovaAdditionalCell}
  334. {%- for network in networks if network.enabled|default(true) %}
  335. {{network.name_lower}}_net_name: {get_param: {{network.name}}NetName}
  336. {%- endfor %}
  337. networks:
  338. {%- for network in networks if network.enabled|default(true) %}
  339. {{network.name}}:
  340. name: {get_param: {{network.name}}NetName}
  341. name_lower: {{ network.name_lower }}
  342. {%- endfor %}
  343. network_virtual_ips:
  344. ctlplane:
  345. ip_address: {get_param: [NetVipMap, ctlplane]}
  346. index: 1
  347. {%- for network in networks if network.vip|default(false) and network.enabled|default(true) %}
  348. # External virtual ip is currently being handled separately as public_virtual_ip.
  349. # Likewise, optional StorageNFS virtual ip is handled separately as ganesha_vip.
  350. {%- if network.name != 'External' and network.name != 'StorageNFS' %}
  351. {{network.name_lower}}:
  352. ip_address: {get_param: [NetVipMap, {get_param: {{network.name}}NetName}]}
  353. index: {{loop.index + 1}}
  354. {%- endif %}
  355. {%- endfor %}
  356. cloud_names: {get_param: CloudNames}
  357. enable_internal_tls: {get_param: EnableInternalTLS}
  358. cloud_domain: {get_param: CloudDomain}
  359. all_nodes_extra_map_data: {get_param: AllNodesExtraMapData}
  360. common_deploy_steps_tasks: {get_file: deploy-steps-tasks.yaml}
  361. deploy_steps_tasks_step_0: {get_file: deploy-steps-tasks-step-0.yaml}
  362. common_deploy_steps_tasks_step_1: {get_file: deploy-steps-tasks-step-1.yaml}
  363. container_startup_configs_tasks: {get_file: container_startup_configs_tasks.yaml}
  364. docker_puppet_script: {get_file: ./container-puppet.py}
  365. container_puppet_script: {get_file: ./container-puppet.sh}
  366. all_nodes_validation_script.sh : {get_file: ../validation-scripts/all-nodes.sh}
  367. deploy-artifacts.sh : {get_file: ../puppet/deploy-artifacts.sh}
  368. hosts-config.sh: {get_file: ../scripts/hosts-config.sh}
  369. deploy_steps_playbook:
  370. str_replace:
  371. params:
  372. BOOTSTRAP_SERVER_ID: {get_attr: [BootstrapServerId, value]}
  373. DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts}
  374. DEPLOY_TARGET_HOST: {get_param: deployment_target_hosts}
  375. DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
  376. ENABLE_DEBUG: {get_param: ConfigDebug}
  377. ENABLE_PUPPET: {get_param: EnablePuppet}
  378. ENABLE_PAUNCH: {get_param: EnablePaunch}
  379. CONTAINER_CLI: {get_param: ContainerCli}
  380. CONTAINER_LOG_STDOUT_PATH: {get_param: ContainerLogStdoutPath}
  381. CONTAINER_HEALTHCHECK_DISABLED: {get_param: ContainerHealthcheckDisabled}
  382. DOCKER_PUPPET_DEBUG: {get_param: DockerPuppetDebug}
  383. DOCKER_PUPPET_PROCESS_COUNT: {get_param: DockerPuppetProcessCount}
  384. DOCKER_PUPPET_MOUNT_HOST_PUPPET: {get_param: DockerPuppetMountHostPuppet}
  385. SELINUX_MODE: {get_param: SELinuxMode}
  386. template: |
  387. - hosts: DEPLOY_SOURCE_HOST
  388. name: Gather facts from undercloud
  389. gather_facts: yes
  390. become: false
  391. tags:
  392. - facts
  393. - hosts: DEPLOY_TARGET_HOST
  394. name: Gather facts from overcloud
  395. gather_facts: yes
  396. tags:
  397. - facts
  398. - hosts: all
  399. name: Load global variables
  400. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  401. tasks:
  402. - include_vars: global_vars.yaml
  403. no_log: true
  404. tags:
  405. - always
  406. - hosts: DEPLOY_TARGET_HOST
  407. name: Render all_nodes data as group_vars for overcloud
  408. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  409. tasks:
  410. - name: Render all_nodes data as group_vars for overcloud
  411. delegate_to: localhost
  412. become: false
  413. run_once: true
  414. when: not ansible_check_mode|bool
  415. block:
  416. - name: Get current user
  417. command: whoami
  418. register: whoami
  419. - name: render all_nodes data as group_vars for overcloud
  420. template:
  421. src: "{{ '{{' }} lookup('first_found', lookup('config', 'DEFAULT_ROLES_PATH') | map('regex_replace', '$', '/tripleo-hieradata') | list) ~ '/templates/all_nodes.j2' {{ '}}'}}"
  422. dest: "{{ '{{' }} playbook_dir {{ '}}' }}/group_vars/overcloud.json"
  423. owner: "{{ '{{' }} whoami.stdout {{ '}}' }}"
  424. group: "{{ '{{' }} whoami.stdout {{ '}}' }}"
  425. tags:
  426. - facts
  427. - hosts: DEPLOY_TARGET_HOST
  428. name: Set all_nodes data as group_vars for overcloud
  429. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  430. tasks:
  431. - name: Set all_nodes data as group_vars for overcloud
  432. include_vars: "{{ '{{ ' }} playbook_dir {{ ' }}' }}/group_vars/overcloud.json"
  433. no_log: true
  434. tags:
  435. - facts
  436. - hosts: all
  437. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  438. name: Manage SELinux
  439. tasks:
  440. - name: Set selinux state
  441. selinux:
  442. policy: targeted
  443. state: SELINUX_MODE
  444. - hosts: DEPLOY_TARGET_HOST
  445. name: Common roles for TripleO servers
  446. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  447. any_errors_fatal: yes
  448. # pre_tasks run before any roles in a play, so we use it for the
  449. # named debug task for --start-at-task.
  450. pre_tasks:
  451. - name: Common roles for TripleO servers
  452. debug:
  453. msg: Use --start-at-task 'Common roles for TripleO servers' to resume from this task
  454. roles:
  455. - tripleo-bootstrap
  456. - tripleo-ssh-known-hosts
  457. tags:
  458. - common_roles
  459. - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
  460. name: Deploy step tasks for step 0
  461. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  462. any_errors_fatal: yes
  463. vars:
  464. bootstrap_server_id: BOOTSTRAP_SERVER_ID
  465. step: 0
  466. deploy_identifier: DEPLOY_IDENTIFIER
  467. enable_debug: ENABLE_DEBUG
  468. enable_puppet: ENABLE_PUPPET
  469. container_cli: CONTAINER_CLI
  470. container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
  471. container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
  472. docker_puppet_debug: DOCKER_PUPPET_DEBUG
  473. docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
  474. docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
  475. tasks:
  476. - import_tasks: deploy_steps_tasks_step_0.yaml
  477. tags:
  478. - overcloud
  479. - deploy_steps
  480. - step0
  481. - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
  482. name: Server pre deployment steps
  483. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  484. any_errors_fatal: yes
  485. tasks:
  486. - name: Hiera config
  487. include_role:
  488. name: tripleo-hieradata
  489. - name: Hiera symlink
  490. file:
  491. src: /etc/puppet/hiera.yaml
  492. dest: /etc/hiera.yaml
  493. state: link
  494. force: true
  495. tags:
  496. - overcloud
  497. - pre_deploy_steps
  498. - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
  499. name: Server hieradata from vars
  500. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  501. tasks:
  502. - name: Hieradata from vars
  503. include_role:
  504. name: tripleo-hieradata
  505. tasks_from: hieradata_vars.yaml
  506. vars:
  507. hieradata_templates_list:
  508. - bootstrap_node
  509. - all_nodes
  510. - vip_data
  511. - net_ip_map
  512. - cloud_domain
  513. - fqdn
  514. - service_configs
  515. - extraconfig
  516. - role_extraconfig
  517. tags:
  518. - overcloud
  519. - pre_deploy_steps
  520. - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
  521. name: Server deployments
  522. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  523. any_errors_fatal: yes
  524. tasks:
  525. - name: Server deployments
  526. debug:
  527. msg: Use --start-at-task 'Server deployments' to resume from this task
  528. - include_tasks: deployments.yaml
  529. vars:
  530. force: false
  531. with_items: "{{ '{{' }} hostvars[inventory_hostname]['pre_deployments_' ~ tripleo_role_name]|default([]) {{ '}}' }}"
  532. - name: Check for previous run of NetworkConfig
  533. stat:
  534. path: /var/lib/tripleo-config/os-net-config.returncode
  535. register: os_net_config_returncode_stat
  536. - name: Check result of previous run of NetworkConfig
  537. slurp:
  538. path: /var/lib/tripleo-config/os-net-config.returncode
  539. when: os_net_config_returncode_stat.stat.exists
  540. register: os_net_config_returncode_slurp
  541. - name: Check NetworkConfig script existence
  542. local_action:
  543. module: stat
  544. path: {{ '"{{' }} lookup('first_found', NetworkConfig_paths, errors='ignore') {{ '}}"' }}
  545. become: no
  546. register: NetworkConfig_stat
  547. vars:
  548. NetworkConfig_paths:
  549. - {{ '"{{' }} tripleo_role_name ~ '/' ~ inventory_hostname ~ '/NetworkConfig' {{ '}}"' }}
  550. - {{ '"{{' }} tripleo_role_name ~ '/NetworkConfig' {{ '}}"' }}
  551. - name: NetworkConfig
  552. block:
  553. # os-net-config currently relies on the legacy network
  554. # so we need to ensure it's enabled on boot. This should
  555. # be removed when we switch to NetworkManager or replaced
  556. # with something that ensures NetworkManager is enabled.
  557. - name: Ensure network service is enabled
  558. systemd:
  559. name: network
  560. enabled: yes
  561. state: started
  562. - name: Create /var/lib/tripleo-config/scripts directory
  563. file:
  564. path: /var/lib/tripleo-config/scripts
  565. state: directory
  566. setype: svirt_sandbox_file_t
  567. selevel: s0
  568. recurse: true
  569. - name: Render NetworkConfig script
  570. template:
  571. dest: /var/lib/tripleo-config/scripts/run_os_net_config.sh
  572. src: {{ '"{{' }} NetworkConfig_stat.stat.path {{ '}}"' }}
  573. mode: 0755
  574. - name: Run NetworkConfig script
  575. command: /var/lib/tripleo-config/scripts/run_os_net_config.sh
  576. async: {{ '"{{' }} async_timeout | default(300) {{ '}}"' }}
  577. poll: {{ '"{{' }} async_poll | default(3) {{ '}}"' }}
  578. environment:
  579. bridge_name: {{ '"{{' }} neutron_physical_bridge_name {{ '}}"' }}
  580. interface_name: {{ '"{{' }} neutron_public_interface_name {{ '}}"' }}
  581. register: NetworkConfig_result
  582. failed_when: false
  583. - name: Write rc of NetworkConfig script
  584. copy:
  585. content: {{ '"{{' }} NetworkConfig_result.rc {{ '}}"' }}
  586. dest: /var/lib/tripleo-config/os-net-config.returncode
  587. - name: NetworkConfig stdout
  588. debug:
  589. var: NetworkConfig_result.stderr_lines
  590. failed_when: NetworkConfig_result.rc != 0
  591. # The conditions here are when we want to apply the
  592. # NetworkConfig. They are:
  593. # - If the stack_action is CREATE
  594. # - Or UPDATE is in the network_deployment_actions
  595. # - Or the previous run of NetworkConfig failed.
  596. # - Or it has never run
  597. # This will match the prior behavior of when a Heat
  598. # SoftwareDeployment was used.
  599. # It also ensures the script does exist as a sine qua non
  600. # condition
  601. when: NetworkConfig_stat.stat.exists and
  602. ((stack_action == "CREATE") or ("UPDATE" in network_deployment_actions) or
  603. (os_net_config_returncode_stat.stat.exists and
  604. ((os_net_config_returncode_slurp.content | b64decode) != 0)) or
  605. (not os_net_config_returncode_stat.stat.exists))
  606. - name: AllNodesValidationConfig
  607. script: all_nodes_validation_script.sh
  608. environment:
  609. validate_controllers_icmp: {{ '"{{' }} validate_controllers_icmp {{ '}}"' }}
  610. validate_gateways_icmp: {{ '"{{' }} validate_gateways_icmp {{ '}}"' }}
  611. validate_fqdn: {{ '"{{' }} validate_fqdn {{ '}}"' }}
  612. validate_ntp: {{ '"{{' }} validate_ntp {{ '}}"' }}
  613. ping_test_ips: {{ '"{{' }} ping_test_ips | to_json {{ '}}"' }}
  614. tripleo_role_name: {{ '"{{' }} tripleo_role_name {{ '}}"' }}
  615. - name: ArtifactsConfig
  616. script: deploy-artifacts.sh
  617. environment:
  618. artifact_urls: {{ '"{{' }} deploy_artifact_urls {{ '}}"' }}
  619. - name: HostsConfig
  620. script: hosts-config.sh
  621. environment:
  622. HOSTS_ENTRY: {{ '"{{' }} hosts_entry {{ '}}"' }}
  623. tags:
  624. - overcloud
  625. - pre_deploy_steps
  626. {%- for role in roles %}
  627. - hosts: {{role.name}}
  628. name: {{role.name}} Host prep steps
  629. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  630. any_errors_fatal: yes
  631. vars:
  632. bootstrap_server_id: BOOTSTRAP_SERVER_ID
  633. deploy_identifier: DEPLOY_IDENTIFIER
  634. enable_debug: ENABLE_DEBUG
  635. enable_puppet: ENABLE_PUPPET
  636. container_cli: CONTAINER_CLI
  637. container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
  638. container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
  639. docker_puppet_debug: DOCKER_PUPPET_DEBUG
  640. docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
  641. docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
  642. tasks:
  643. - name: {{role.name}} Host prep steps
  644. debug:
  645. msg: Use --start-at-task '{{role.name}} Host prep steps' to resume from this task
  646. - import_tasks: {{role.name}}/host_prep_tasks.yaml
  647. tags:
  648. - overcloud
  649. - host_prep_steps
  650. {%- endfor %}
  651. {%- for step in range(1,deploy_steps_max) %}
  652. - hosts: DEPLOY_SOURCE_HOST
  653. name: External deployment step {{step}}
  654. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  655. any_errors_fatal: yes
  656. become: false
  657. vars:
  658. bootstrap_server_id: BOOTSTRAP_SERVER_ID
  659. step: '{{step}}'
  660. deploy_identifier: DEPLOY_IDENTIFIER
  661. enable_debug: ENABLE_DEBUG
  662. enable_puppet: ENABLE_PUPPET
  663. container_cli: CONTAINER_CLI
  664. container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
  665. container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
  666. docker_puppet_debug: DOCKER_PUPPET_DEBUG
  667. docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
  668. docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
  669. tasks:
  670. - name: External deployment step {{step}}
  671. debug:
  672. msg: Use --start-at-task 'External deployment step {{step}}' to resume from this task
  673. - import_tasks: external_deploy_steps_tasks.yaml
  674. tags:
  675. - external
  676. - external_deploy_steps
  677. - step{{step}}
  678. - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
  679. name: Deploy step tasks for {{step}}
  680. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  681. any_errors_fatal: yes
  682. # FIXME(shardy) - it would be nice to use strategy: free to
  683. # allow the tasks per-step to run in parallel on each role,
  684. # but that doesn't work with any_errors_fatal: yes
  685. vars:
  686. bootstrap_server_id: BOOTSTRAP_SERVER_ID
  687. step: '{{step}}'
  688. deploy_identifier: DEPLOY_IDENTIFIER
  689. enable_debug: ENABLE_DEBUG
  690. enable_puppet: ENABLE_PUPPET
  691. container_cli: CONTAINER_CLI
  692. container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
  693. container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
  694. docker_puppet_debug: DOCKER_PUPPET_DEBUG
  695. docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
  696. docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
  697. tasks:
  698. - name: Write the config_step hieradata for the deploy step {{step}} tasks
  699. copy:
  700. content: "{{ '{{' }} dict(step=step|int) | to_json {{ '}}' }}"
  701. dest: /etc/puppet/hieradata/config_step.json
  702. force: true
  703. mode: '0600'
  704. - name: Deploy step tasks for {{step}}
  705. debug:
  706. msg: Use --start-at-task 'Deploy step tasks for {{step}}' to resume from this task
  707. {%- for role in roles %}
  708. - import_tasks: {{role.name}}/deploy_steps_tasks.yaml
  709. when: tripleo_role_name == '{{role.name}}'
  710. {%- endfor %}
  711. tags:
  712. - overcloud
  713. - deploy_steps
  714. - step{{step}}
  715. {% if step == 1 %}
  716. - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
  717. name: Overcloud common deploy step 1 tasks
  718. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  719. any_errors_fatal: yes
  720. vars:
  721. bootstrap_server_id: BOOTSTRAP_SERVER_ID
  722. step: '{{step}}'
  723. deploy_identifier: DEPLOY_IDENTIFIER
  724. enable_debug: ENABLE_DEBUG
  725. enable_puppet: ENABLE_PUPPET
  726. container_cli: CONTAINER_CLI
  727. container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
  728. container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
  729. docker_puppet_debug: DOCKER_PUPPET_DEBUG
  730. docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
  731. docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
  732. tasks:
  733. - name: Check if /var/lib/tripleo-config/container-startup-config-1.json already exists
  734. stat:
  735. path: /var/lib/tripleo-config/container-startup-config-1.json
  736. register: container_startup_configs_json_stat
  737. - include_tasks: common_deploy_steps_tasks_step_1.yaml
  738. when:
  739. - ((deploy_identifier is defined and deploy_identifier != "" and deploy_identifier is not none) or not container_startup_configs_json_stat.stat.exists)
  740. tags:
  741. - overcloud
  742. - deploy_steps
  743. - step{{step}}
  744. {% endif %}
  745. - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
  746. name: Overcloud common deploy step tasks {{step}}
  747. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  748. any_errors_fatal: yes
  749. vars:
  750. bootstrap_server_id: BOOTSTRAP_SERVER_ID
  751. step: '{{step}}'
  752. deploy_identifier: DEPLOY_IDENTIFIER
  753. enable_debug: ENABLE_DEBUG
  754. enable_puppet: ENABLE_PUPPET
  755. container_cli: CONTAINER_CLI
  756. container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
  757. container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
  758. docker_puppet_debug: DOCKER_PUPPET_DEBUG
  759. docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
  760. docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
  761. tasks:
  762. - name: Overcloud common deploy step tasks {{step}}
  763. debug:
  764. msg: Use --start-at-task 'Overcloud common deploy step tasks {{step}}' to resume from this task
  765. - name: Check if /var/lib/tripleo-config/container-startup-config-1.json already exists
  766. stat:
  767. path: /var/lib/tripleo-config/container-startup-config-1.json
  768. register: container_startup_configs_json_stat
  769. - import_tasks: common_deploy_steps_tasks.yaml
  770. when: (deploy_identifier is defined and deploy_identifier != "" and deploy_identifier is not none) or
  771. (container_startup_configs_json_stat is defined and not container_startup_configs_json_stat.stat.exists)
  772. tags:
  773. - overcloud
  774. - deploy_steps
  775. - step{{step}}
  776. {%- endfor %}
  777. - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST
  778. name: Server Post Deployments
  779. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  780. any_errors_fatal: yes
  781. tasks:
  782. - name: Server Post Deployments
  783. debug:
  784. msg: Use --start-at-task 'Server Post Deployments' to resume from this task
  785. - include_tasks: deployments.yaml
  786. vars:
  787. force: false
  788. with_items: "{{ '{{' }} hostvars[inventory_hostname]['post_deployments_' ~ tripleo_role_name]|default([]) {{ '}}' }}"
  789. tags:
  790. - overcloud
  791. - post_deploy_steps
  792. - hosts: DEPLOY_SOURCE_HOST
  793. name: External deployment Post Deploy tasks
  794. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  795. any_errors_fatal: yes
  796. become: false
  797. vars:
  798. bootstrap_server_id: BOOTSTRAP_SERVER_ID
  799. deploy_identifier: DEPLOY_IDENTIFIER
  800. enable_debug: ENABLE_DEBUG
  801. enable_puppet: ENABLE_PUPPET
  802. container_cli: CONTAINER_CLI
  803. container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
  804. container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
  805. docker_puppet_debug: DOCKER_PUPPET_DEBUG
  806. docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
  807. docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
  808. tasks:
  809. - name: External deployment Post Deploy tasks
  810. debug:
  811. msg: Use --start-at-task 'External deployment Post Deploy tasks' to resume from this task
  812. - import_tasks: external_post_deploy_steps_tasks.yaml
  813. tags:
  814. - external
  815. - external_deploy_steps
  816. - external_post_deploy_steps
  817. external_deploy_steps_tasks: {get_attr: [ExternalDeployTasks, value]}
  818. external_post_deploy_steps_tasks: {get_attr: [ExternalPostDeployTasks, value]}
  819. update_steps_tasks: |
  820. {%- for role in roles %}
  821. - import_tasks: {{role.name}}/update_tasks.yaml
  822. when: tripleo_role_name == '{{role.name}}'
  823. {%- endfor %}
  824. update_steps_playbook:
  825. str_replace:
  826. params:
  827. DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts}
  828. DEPLOY_TARGET_HOST: {get_param: deployment_target_hosts}
  829. CONTAINER_CLI: {get_param: ContainerCli}
  830. CONTAINER_LOG_STDOUT_PATH: {get_param: ContainerLogStdoutPath}
  831. CONTAINER_HEALTHCHECK_DISABLED: {get_param: ContainerHealthcheckDisabled}
  832. DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
  833. BOOTSTRAP_SERVER_ID: {get_attr: [BootstrapServerId, value]}
  834. ENABLE_DEBUG: {get_param: ConfigDebug}
  835. ENABLE_PUPPET: {get_param: EnablePuppet}
  836. ENABLE_PAUNCH: {get_param: EnablePaunch}
  837. DOCKER_PUPPET_DEBUG: {get_param: DockerPuppetDebug}
  838. DOCKER_PUPPET_PROCESS_COUNT: {get_param: DockerPuppetProcessCount}
  839. DOCKER_PUPPET_MOUNT_HOST_PUPPET: {get_param: DockerPuppetMountHostPuppet}
  840. template: |
  841. - hosts: DEPLOY_SOURCE_HOST
  842. name: Gather facts from undercloud
  843. gather_facts: yes
  844. become: false
  845. - hosts: DEPLOY_TARGET_HOST
  846. name: Gather facts from overcloud
  847. gather_facts: yes
  848. - hosts: all
  849. name: Load global variables
  850. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  851. tasks:
  852. - include_vars: global_vars.yaml
  853. no_log: true
  854. - hosts: DEPLOY_TARGET_HOST
  855. name: Render all_nodes data as group_vars for overcloud
  856. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  857. tasks:
  858. - name: Render all_nodes data as group_vars for overcloud
  859. delegate_to: localhost
  860. become: false
  861. run_once: true
  862. when: not ansible_check_mode|bool
  863. block:
  864. - name: Get current user
  865. command: whoami
  866. register: whoami
  867. - name: render all_nodes data as group_vars for overcloud
  868. template:
  869. src: "{{ '{{' }} lookup('first_found', lookup('config', 'DEFAULT_ROLES_PATH') | map('regex_replace', '$', '/tripleo-hieradata') | list) ~ '/templates/all_nodes.j2' {{ '}}'}}"
  870. dest: "{{ '{{' }} playbook_dir {{ '}}' }}/group_vars/overcloud.json"
  871. owner: "{{ '{{' }} whoami.stdout {{ '}}' }}"
  872. group: "{{ '{{' }} whoami.stdout {{ '}}' }}"
  873. tags:
  874. - facts
  875. - hosts: DEPLOY_TARGET_HOST
  876. name: Set all_nodes data as group_vars for overcloud
  877. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  878. tasks:
  879. - name: Set all_nodes data as group_vars for overcloud
  880. include_vars: "{{ '{{ ' }} playbook_dir {{ ' }}' }}/group_vars/overcloud.json"
  881. no_log: true
  882. tags:
  883. - facts
  884. {%- for role in roles %}
  885. - hosts: {{role.name}}
  886. name: Run update
  887. serial: {{ '"{{' }} update_serial | default({{role.update_serial | default(1)}}) {{ '}}"' }}
  888. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  889. any_errors_fatal: yes
  890. vars:
  891. bootstrap_server_id: BOOTSTRAP_SERVER_ID
  892. deploy_identifier: DEPLOY_IDENTIFIER
  893. enable_debug: ENABLE_DEBUG
  894. enable_puppet: ENABLE_PUPPET
  895. container_cli: CONTAINER_CLI
  896. container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
  897. container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
  898. docker_puppet_debug: DOCKER_PUPPET_DEBUG
  899. docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
  900. docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
  901. tripleo_minor_update: true
  902. tasks:
  903. - include_tasks: update_steps_tasks.yaml
  904. with_sequence: start=0 end={{update_steps_max-1}}
  905. loop_control:
  906. loop_var: step
  907. - import_tasks: {{role.name}}/host_prep_tasks.yaml
  908. when: tripleo_role_name == '{{role.name}}'
  909. - import_tasks: deploy_steps_tasks_step_0.yaml
  910. vars:
  911. step: 0
  912. - import_tasks: common_deploy_steps_tasks_step_1.yaml
  913. - include_tasks: common_deploy_steps_tasks.yaml
  914. with_sequence: start=1 end={{deploy_steps_max-1}}
  915. loop_control:
  916. loop_var: step
  917. - include_tasks: post_update_steps_tasks.yaml
  918. with_sequence: start=0 end={{post_update_steps_max-1}}
  919. loop_control:
  920. loop_var: step
  921. {%- endfor %}
  922. external_update_steps_tasks: {get_attr: [ExternalUpdateTasks, value]}
  923. external_update_steps_playbook:
  924. str_replace:
  925. params:
  926. DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts}
  927. DEPLOY_TARGET_HOST: {get_param: deployment_target_hosts}
  928. DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
  929. BOOTSTRAP_SERVER_ID: {get_attr: [BootstrapServerId, value]}
  930. ENABLE_DEBUG: {get_param: ConfigDebug}
  931. ENABLE_PUPPET: {get_param: EnablePuppet}
  932. ENABLE_PAUNCH: {get_param: EnablePaunch}
  933. DOCKER_PUPPET_DEBUG: {get_param: DockerPuppetDebug}
  934. DOCKER_PUPPET_PROCESS_COUNT: {get_param: DockerPuppetProcessCount}
  935. DOCKER_PUPPET_MOUNT_HOST_PUPPET: {get_param: DockerPuppetMountHostPuppet}
  936. CONTAINER_CLI: {get_param: ContainerCli}
  937. CONTAINER_LOG_STDOUT_PATH: {get_param: ContainerLogStdoutPath}
  938. CONTAINER_HEALTHCHECK_DISABLED: {get_param: ContainerHealthcheckDisabled}
  939. template: |
  940. - hosts: DEPLOY_SOURCE_HOST
  941. name: Gather facts from undercloud
  942. gather_facts: yes
  943. become: false
  944. tags:
  945. - always
  946. - facts
  947. # facts from overcloud may be needed for external installer inventory
  948. - hosts: DEPLOY_TARGET_HOST
  949. name: Gather facts from overcloud
  950. gather_facts: yes
  951. tags:
  952. - always
  953. - facts
  954. - hosts: all
  955. name: Load global variables
  956. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  957. tasks:
  958. - include_vars: global_vars.yaml
  959. no_log: true
  960. tags:
  961. - always
  962. - hosts: DEPLOY_TARGET_HOST
  963. name: Render all_nodes data as group_vars for overcloud
  964. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  965. tasks:
  966. - name: Render all_nodes data as group_vars for overcloud
  967. delegate_to: localhost
  968. become: false
  969. run_once: true
  970. when: not ansible_check_mode|bool
  971. block:
  972. - name: Get current user
  973. command: whoami
  974. register: whoami
  975. - name: render all_nodes data as group_vars for overcloud
  976. template:
  977. src: "{{ '{{' }} lookup('first_found', lookup('config', 'DEFAULT_ROLES_PATH') | map('regex_replace', '$', '/tripleo-hieradata') | list) ~ '/templates/all_nodes.j2' {{ '}}'}}"
  978. dest: "{{ '{{' }} playbook_dir {{ '}}' }}/group_vars/overcloud.json"
  979. owner: "{{ '{{' }} whoami.stdout {{ '}}' }}"
  980. group: "{{ '{{' }} whoami.stdout {{ '}}' }}"
  981. tags:
  982. - facts
  983. - hosts: DEPLOY_TARGET_HOST
  984. name: Set all_nodes data as group_vars for overcloud
  985. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  986. tasks:
  987. - name: Set all_nodes data as group_vars for overcloud
  988. include_vars: "{{ '{{ ' }} playbook_dir {{ ' }}' }}/group_vars/overcloud.json"
  989. no_log: true
  990. tags:
  991. - facts
  992. {%- for step in range(external_update_steps_max) %}
  993. - hosts: DEPLOY_SOURCE_HOST
  994. name: External update step {{step}}
  995. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  996. any_errors_fatal: yes
  997. become: false
  998. vars:
  999. bootstrap_server_id: BOOTSTRAP_SERVER_ID
  1000. step: '{{step}}'
  1001. deploy_identifier: DEPLOY_IDENTIFIER
  1002. enable_debug: ENABLE_DEBUG
  1003. enable_puppet: ENABLE_PUPPET
  1004. container_cli: CONTAINER_CLI
  1005. container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
  1006. container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
  1007. docker_puppet_debug: DOCKER_PUPPET_DEBUG
  1008. docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
  1009. docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
  1010. tasks:
  1011. - import_tasks: external_update_steps_tasks.yaml
  1012. tags:
  1013. - step{{step}}
  1014. - external
  1015. - external_update_steps
  1016. {%- endfor %}
  1017. {%- for step in range(1,deploy_steps_max) %}
  1018. # putting both update and deploy tasks in the same
  1019. # playbook allows influencing the deploy tasks by
  1020. # variables "exported" from update tasks
  1021. - hosts: DEPLOY_SOURCE_HOST
  1022. name: External deploy step {{step}}
  1023. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1024. any_errors_fatal: yes
  1025. become: false
  1026. vars:
  1027. bootstrap_server_id: BOOTSTRAP_SERVER_ID
  1028. step: '{{step}}'
  1029. deploy_identifier: DEPLOY_IDENTIFIER
  1030. enable_debug: ENABLE_DEBUG
  1031. enable_puppet: ENABLE_PUPPET
  1032. container_cli: CONTAINER_CLI
  1033. container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
  1034. container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
  1035. docker_puppet_debug: DOCKER_PUPPET_DEBUG
  1036. docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
  1037. docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
  1038. tasks:
  1039. - import_tasks: external_deploy_steps_tasks.yaml
  1040. tags:
  1041. - external
  1042. - external_deploy_steps
  1043. - step{{step}}
  1044. {%- endfor %}
  1045. pre_upgrade_rolling_steps_tasks: |
  1046. {%- for role in roles %}
  1047. - import_tasks: {{role.name}}/pre_upgrade_rolling_tasks.yaml
  1048. when: tripleo_role_name == '{{role.name}}'
  1049. {%- endfor %}
  1050. pre_upgrade_rolling_steps_playbook:
  1051. str_replace:
  1052. params:
  1053. DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts}
  1054. DEPLOY_TARGET_HOST: {get_param: deployment_target_hosts}
  1055. template: |
  1056. {%- for role in roles %}
  1057. - hosts: {{role.name}}
  1058. name: Gather facts from undercloud
  1059. gather_facts: yes
  1060. become: false
  1061. - hosts: {{role.name}}
  1062. name: Gather facts from overcloud
  1063. gather_facts: yes
  1064. - hosts: all
  1065. name: Load global variables
  1066. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1067. tasks:
  1068. - include_vars: global_vars.yaml
  1069. no_log: true
  1070. - hosts: DEPLOY_TARGET_HOST
  1071. name: Render all_nodes data as group_vars for overcloud
  1072. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1073. tasks:
  1074. - name: Render all_nodes data as group_vars for overcloud
  1075. delegate_to: localhost
  1076. become: false
  1077. run_once: true
  1078. when: not ansible_check_mode|bool
  1079. block:
  1080. - name: Get current user
  1081. command: whoami
  1082. register: whoami
  1083. - name: render all_nodes data as group_vars for overcloud
  1084. template:
  1085. src: "{{ '{{' }} lookup('first_found', lookup('config', 'DEFAULT_ROLES_PATH') | map('regex_replace', '$', '/tripleo-hieradata') | list) ~ '/templates/all_nodes.j2' {{ '}}'}}"
  1086. dest: "{{ '{{' }} playbook_dir {{ '}}' }}/group_vars/overcloud.json"
  1087. owner: "{{ '{{' }} whoami.stdout {{ '}}' }}"
  1088. group: "{{ '{{' }} whoami.stdout {{ '}}' }}"
  1089. tags:
  1090. - facts
  1091. - hosts: DEPLOY_TARGET_HOST
  1092. name: Set all_nodes data as group_vars for overcloud
  1093. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1094. tasks:
  1095. - name: Set all_nodes data as group_vars for overcloud
  1096. include_vars: "{{ '{{ ' }} playbook_dir {{ ' }}' }}/group_vars/overcloud.json"
  1097. no_log: true
  1098. tags:
  1099. - facts
  1100. - hosts: {{role.name}}
  1101. name: Run pre-upgrade rolling tasks
  1102. serial: {{ role.deploy_serial | default(1) }}
  1103. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1104. any_errors_fatal: yes
  1105. tasks:
  1106. - include_tasks: pre_upgrade_rolling_steps_tasks.yaml
  1107. with_sequence: start=0 end={{pre_upgrade_rolling_steps_max-1}}
  1108. loop_control:
  1109. loop_var: step
  1110. {%- endfor %}
  1111. upgrade_steps_playbook:
  1112. str_replace:
  1113. params:
  1114. DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts}
  1115. DEPLOY_TARGET_HOST: {get_param: deployment_target_hosts}
  1116. CONTAINER_CLI: {get_param: ContainerCli}
  1117. ENABLE_PAUNCH: {get_param: EnablePaunch}
  1118. CONTAINER_LOG_STDOUT_PATH: {get_param: ContainerLogStdoutPath}
  1119. CONTAINER_HEALTHCHECK_DISABLED: {get_param: ContainerHealthcheckDisabled}
  1120. DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
  1121. BOOTSTRAP_SERVER_ID: {get_attr: [BootstrapServerId, value]}
  1122. ENABLE_DEBUG: {get_param: ConfigDebug}
  1123. template: |
  1124. - hosts: DEPLOY_SOURCE_HOST
  1125. name: Gather facts from undercloud
  1126. gather_facts: yes
  1127. become: false
  1128. tags: always
  1129. - hosts: DEPLOY_TARGET_HOST
  1130. name: Gather facts from overcloud
  1131. gather_facts: yes
  1132. tags: always
  1133. - hosts: all
  1134. name: Load global variables
  1135. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1136. tasks:
  1137. - include_vars: global_vars.yaml
  1138. no_log: true
  1139. - name: ensure we get the right selinux context
  1140. command: chcon -R -t svirt_sandbox_file_t /var/lib/config-data
  1141. args:
  1142. warn: no
  1143. tags:
  1144. - always
  1145. - hosts: DEPLOY_TARGET_HOST
  1146. name: Render all_nodes data as group_vars for overcloud
  1147. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1148. tasks:
  1149. - name: Render all_nodes data as group_vars for overcloud
  1150. delegate_to: localhost
  1151. become: false
  1152. run_once: true
  1153. when: not ansible_check_mode|bool
  1154. block:
  1155. - name: Get current user
  1156. command: whoami
  1157. register: whoami
  1158. - name: render all_nodes data as group_vars for overcloud
  1159. template:
  1160. src: "{{ '{{' }} lookup('first_found', lookup('config', 'DEFAULT_ROLES_PATH') | map('regex_replace', '$', '/tripleo-hieradata') | list) ~ '/templates/all_nodes.j2' {{ '}}'}}"
  1161. dest: "{{ '{{' }} playbook_dir {{ '}}' }}/group_vars/overcloud.json"
  1162. owner: "{{ '{{' }} whoami.stdout {{ '}}' }}"
  1163. group: "{{ '{{' }} whoami.stdout {{ '}}' }}"
  1164. tags:
  1165. - facts
  1166. - hosts: DEPLOY_TARGET_HOST
  1167. name: Set all_nodes data as group_vars for overcloud
  1168. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1169. tasks:
  1170. - name: Set all_nodes data as group_vars for overcloud
  1171. include_vars: "{{ '{{ ' }} playbook_dir {{ ' }}' }}/group_vars/overcloud.json"
  1172. no_log: true
  1173. tags:
  1174. - facts
  1175. {%- for step in range(0,upgrade_steps_max) %}
  1176. - hosts: DEPLOY_TARGET_HOST
  1177. name: Upgrade tasks for step {{step}}
  1178. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1179. any_errors_fatal: yes
  1180. vars:
  1181. bootstrap_server_id: BOOTSTRAP_SERVER_ID
  1182. step: '{{step}}'
  1183. deploy_identifier: DEPLOY_IDENTIFIER
  1184. enable_debug: ENABLE_DEBUG
  1185. container_cli: CONTAINER_CLI
  1186. container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
  1187. container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
  1188. tasks:
  1189. {%- for role in roles %}
  1190. - import_tasks: {{role.name}}/upgrade_tasks_step{{step}}.yaml
  1191. when: tripleo_role_name == '{{role.name}}'
  1192. {%- endfor %}
  1193. tags:
  1194. - upgrade_steps
  1195. - upgrade_step{{step}}
  1196. {%- endfor %}
  1197. post_upgrade_steps_tasks: |
  1198. {%- for role in roles %}
  1199. - import_tasks: {{role.name}}/post_upgrade_tasks.yaml
  1200. when: tripleo_role_name == '{{role.name}}'
  1201. {%- endfor %}
  1202. post_upgrade_steps_playbook:
  1203. str_replace:
  1204. params:
  1205. DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts}
  1206. DEPLOY_TARGET_HOST: {get_param: deployment_target_hosts}
  1207. CONTAINER_CLI: {get_param: ContainerCli}
  1208. CONTAINER_LOG_STDOUT_PATH: {get_param: ContainerLogStdoutPath}
  1209. CONTAINER_HEALTHCHECK_DISABLED: {get_param: ContainerHealthcheckDisabled}
  1210. DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
  1211. BOOTSTRAP_SERVER_ID: {get_attr: [BootstrapServerId, value]}
  1212. ENABLE_DEBUG: {get_param: ConfigDebug}
  1213. ENABLE_PUPPET: {get_param: EnablePuppet}
  1214. ENABLE_PAUNCH: {get_param: EnablePaunch}
  1215. DOCKER_PUPPET_DEBUG: {get_param: DockerPuppetDebug}
  1216. DOCKER_PUPPET_PROCESS_COUNT: {get_param: DockerPuppetProcessCount}
  1217. DOCKER_PUPPET_MOUNT_HOST_PUPPET: {get_param: DockerPuppetMountHostPuppet}
  1218. template: |
  1219. - hosts: DEPLOY_TARGET_HOST
  1220. any_errors_fatal: yes
  1221. tasks:
  1222. - include_tasks: post_upgrade_steps_tasks.yaml
  1223. with_sequence: start=0 end={{post_upgrade_steps_max-1}}
  1224. vars:
  1225. bootstrap_server_id: BOOTSTRAP_SERVER_ID
  1226. deploy_identifier: DEPLOY_IDENTIFIER
  1227. enable_debug: ENABLE_DEBUG
  1228. enable_puppet: ENABLE_PUPPET
  1229. container_cli: CONTAINER_CLI
  1230. container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
  1231. container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
  1232. docker_puppet_debug: DOCKER_PUPPET_DEBUG
  1233. docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
  1234. docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
  1235. loop_control:
  1236. loop_var: step
  1237. external_upgrade_steps_tasks: {get_attr: [ExternalUpgradeTasks, value]}
  1238. external_upgrade_steps_playbook:
  1239. str_replace:
  1240. params:
  1241. DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts}
  1242. DEPLOY_TARGET_HOST: {get_param: deployment_target_hosts}
  1243. DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
  1244. BOOTSTRAP_SERVER_ID: {get_attr: [BootstrapServerId, value]}
  1245. ENABLE_DEBUG: {get_param: ConfigDebug}
  1246. ENABLE_PUPPET: {get_param: EnablePuppet}
  1247. ENABLE_PAUNCH: {get_param: EnablePaunch}
  1248. DOCKER_PUPPET_DEBUG: {get_param: DockerPuppetDebug}
  1249. DOCKER_PUPPET_PROCESS_COUNT: {get_param: DockerPuppetProcessCount}
  1250. DOCKER_PUPPET_MOUNT_HOST_PUPPET: {get_param: DockerPuppetMountHostPuppet}
  1251. CONTAINER_CLI: {get_param: ContainerCli}
  1252. CONTAINER_LOG_STDOUT_PATH: {get_param: ContainerLogStdoutPath}
  1253. CONTAINER_HEALTHCHECK_DISABLED: {get_param: ContainerHealthcheckDisabled}
  1254. template: |
  1255. - hosts: DEPLOY_SOURCE_HOST
  1256. name: Gather facts from undercloud
  1257. gather_facts: yes
  1258. become: false
  1259. tags:
  1260. - always
  1261. - facts
  1262. # facts from overcloud may be needed for external installer inventory
  1263. - hosts: DEPLOY_TARGET_HOST
  1264. name: Gather facts from overcloud
  1265. gather_facts: yes
  1266. tags:
  1267. - always
  1268. - facts
  1269. - hosts: all
  1270. name: Load global variables
  1271. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1272. tasks:
  1273. - include_vars: global_vars.yaml
  1274. no_log: true
  1275. tags:
  1276. - always
  1277. - hosts: DEPLOY_TARGET_HOST
  1278. name: Render all_nodes data as group_vars for overcloud
  1279. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1280. tasks:
  1281. - name: Render all_nodes data as group_vars for overcloud
  1282. delegate_to: localhost
  1283. become: false
  1284. run_once: true
  1285. when: not ansible_check_mode|bool
  1286. block:
  1287. - name: Get current user
  1288. command: whoami
  1289. register: whoami
  1290. - name: render all_nodes data as group_vars for overcloud
  1291. template:
  1292. src: "{{ '{{' }} lookup('first_found', lookup('config', 'DEFAULT_ROLES_PATH') | map('regex_replace', '$', '/tripleo-hieradata') | list) ~ '/templates/all_nodes.j2' {{ '}}'}}"
  1293. dest: "{{ '{{' }} playbook_dir {{ '}}' }}/group_vars/overcloud.json"
  1294. owner: "{{ '{{' }} whoami.stdout {{ '}}' }}"
  1295. group: "{{ '{{' }} whoami.stdout {{ '}}' }}"
  1296. tags:
  1297. - facts
  1298. - hosts: DEPLOY_TARGET_HOST
  1299. name: Set all_nodes data as group_vars for overcloud
  1300. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1301. tasks:
  1302. - name: Set all_nodes data as group_vars for overcloud
  1303. include_vars: "{{ '{{ ' }} playbook_dir {{ ' }}' }}/group_vars/overcloud.json"
  1304. no_log: true
  1305. tags:
  1306. - facts
  1307. {%- for step in range(external_upgrade_steps_max) %}
  1308. - hosts: DEPLOY_SOURCE_HOST
  1309. name: External upgrade step {{step}}
  1310. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1311. any_errors_fatal: yes
  1312. become: false
  1313. vars:
  1314. # Explicit ansible_python_interpreter to allow connecting
  1315. # to different OS releases (EL7/8) while using delegate_to.
  1316. ansible_python_interpreter: /usr/libexec/platform-python
  1317. step: '{{step}}'
  1318. bootstrap_server_id: BOOTSTRAP_SERVER_ID
  1319. deploy_identifier: DEPLOY_IDENTIFIER
  1320. enable_debug: ENABLE_DEBUG
  1321. enable_puppet: ENABLE_PUPPET
  1322. container_cli: CONTAINER_CLI
  1323. container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
  1324. container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
  1325. docker_puppet_debug: DOCKER_PUPPET_DEBUG
  1326. docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
  1327. docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
  1328. tasks:
  1329. - import_tasks: external_upgrade_steps_tasks.yaml
  1330. tags:
  1331. - step{{step}}
  1332. - external
  1333. - external_upgrade_steps
  1334. {%- endfor %}
  1335. {%- for step in range(1,deploy_steps_max) %}
  1336. # putting both upgrade and deploy tasks in the same
  1337. # playbook allows influencing the deploy tasks by
  1338. # variables "exported" from upgrade tasks
  1339. - hosts: DEPLOY_SOURCE_HOST
  1340. name: External deploy step {{step}}
  1341. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1342. any_errors_fatal: yes
  1343. become: false
  1344. vars:
  1345. # Explicit ansible_python_interpreter to allow connecting
  1346. # to different OS releases (EL7/8) while using delegate_to.
  1347. ansible_python_interpreter: /usr/libexec/platform-python
  1348. step: '{{step}}'
  1349. bootstrap_server_id: BOOTSTRAP_SERVER_ID
  1350. deploy_identifier: DEPLOY_IDENTIFIER
  1351. enable_debug: ENABLE_DEBUG
  1352. enable_puppet: ENABLE_PUPPET
  1353. container_cli: CONTAINER_CLI
  1354. container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
  1355. container_healthcheck_disabled: CONTAINER_HEALTHCHECK_DISABLED
  1356. docker_puppet_debug: DOCKER_PUPPET_DEBUG
  1357. docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
  1358. docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
  1359. tasks:
  1360. - import_tasks: external_deploy_steps_tasks.yaml
  1361. tags:
  1362. - step{{step}}
  1363. - external
  1364. - external_deploy_steps
  1365. {%- endfor %}
  1366. scale_steps_tasks: {get_attr: [ScaleTasks, value]}
  1367. scale_playbook:
  1368. str_replace:
  1369. params:
  1370. DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts}
  1371. DEPLOY_TARGET_HOST: {get_param: deployment_target_hosts}
  1372. DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
  1373. BOOTSTRAP_SERVER_ID: {get_attr: [BootstrapServerId, value]}
  1374. ENABLE_DEBUG: {get_param: ConfigDebug}
  1375. ENABLE_PUPPET: {get_param: EnablePuppet}
  1376. ENABLE_PAUNCH: {get_param: EnablePaunch}
  1377. DOCKER_PUPPET_DEBUG: {get_param: DockerPuppetDebug}
  1378. DOCKER_PUPPET_PROCESS_COUNT: {get_param: DockerPuppetProcessCount}
  1379. DOCKER_PUPPET_MOUNT_HOST_PUPPET: {get_param: DockerPuppetMountHostPuppet}
  1380. CONTAINER_CLI: {get_param: ContainerCli}
  1381. CONTAINER_LOG_STDOUT_PATH: {get_param: ContainerLogStdoutPath}
  1382. template: |
  1383. - hosts: DEPLOY_SOURCE_HOST
  1384. name: Gather facts from undercloud
  1385. gather_facts: yes
  1386. become: false
  1387. tags:
  1388. - always
  1389. - facts
  1390. # Collect the facts from the overcloud nodes but ignore unreachable
  1391. # nodes in the case of a dead node which needs to be part of the
  1392. # scale-down operation.
  1393. - hosts: DEPLOY_TARGET_HOST
  1394. name: Gather facts from overcloud
  1395. gather_facts: yes
  1396. ignore_unreachable: True
  1397. tags:
  1398. - always
  1399. - facts
  1400. - hosts: all
  1401. name: Load global variables
  1402. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1403. tasks:
  1404. - include_vars: global_vars.yaml
  1405. no_log: true
  1406. tags:
  1407. - always
  1408. - hosts: DEPLOY_TARGET_HOST
  1409. name: Render all_nodes data as group_vars for overcloud
  1410. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1411. tasks:
  1412. - name: Render all_nodes data as group_vars for overcloud
  1413. delegate_to: localhost
  1414. become: false
  1415. run_once: true
  1416. when: not ansible_check_mode|bool
  1417. block:
  1418. - name: Get current user
  1419. command: whoami
  1420. register: whoami
  1421. - name: render all_nodes data as group_vars for overcloud
  1422. template:
  1423. src: "{{ '{{' }} lookup('first_found', lookup('config', 'DEFAULT_ROLES_PATH') | map('regex_replace', '$', '/tripleo-hieradata') | list) ~ '/templates/all_nodes.j2' {{ '}}'}}"
  1424. dest: "{{ '{{' }} playbook_dir {{ '}}' }}/group_vars/overcloud.json"
  1425. owner: "{{ '{{' }} whoami.stdout {{ '}}' }}"
  1426. group: "{{ '{{' }} whoami.stdout {{ '}}' }}"
  1427. tags:
  1428. - facts
  1429. - hosts: DEPLOY_TARGET_HOST
  1430. name: Set all_nodes data as group_vars for overcloud
  1431. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1432. tasks:
  1433. - name: Set all_nodes data as group_vars for overcloud
  1434. include_vars: "{{ '{{ ' }} playbook_dir {{ ' }}' }}/group_vars/overcloud.json"
  1435. no_log: true
  1436. tags:
  1437. - facts
  1438. - hosts: DEPLOY_TARGET_HOST
  1439. name: Scaling
  1440. gather_facts: {{ '"{{' }} gather_facts | default(false) {{ '}}"' }}
  1441. any_errors_fatal: yes
  1442. become: false
  1443. vars:
  1444. bootstrap_server_id: BOOTSTRAP_SERVER_ID
  1445. deploy_identifier: DEPLOY_IDENTIFIER
  1446. enable_debug: ENABLE_DEBUG
  1447. enable_puppet: ENABLE_PUPPET
  1448. container_cli: CONTAINER_CLI
  1449. container_log_stdout_path: CONTAINER_LOG_STDOUT_PATH
  1450. docker_puppet_debug: DOCKER_PUPPET_DEBUG
  1451. docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
  1452. docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
  1453. tasks:
  1454. # Only run the scale tasks on the nodes that are alive.
  1455. # We expect the tasks to work on the nodes that are alive.
  1456. # If a task is allowed to fail, it needs to be configured at
  1457. # the task definition level but not here.
  1458. - include_tasks: scale_steps_tasks.yaml
  1459. with_sequence: start=0 end={{scale_steps_max}}
  1460. loop_control:
  1461. loop_var: step
  1462. tags: always
  1463. # we use ansible_hostname to determine if the host is alive
  1464. # or not.
  1465. when: ansible_hostname is defined
  1466. # We don't want to run the scale tasks on dead nodes, to allow
  1467. # the operator to scale down the cloud no matter the state of
  1468. # the servers.
  1469. # However, we notify the operator if the node wasn't reachable.
  1470. # Using fail and not debug module to make it more visible
  1471. # in the logs.
  1472. - fail:
  1473. msg: "Node is unreachable. No scale tasks will be run."
  1474. ignore_errors: True
  1475. tags: always
  1476. # we use ansible_hostname to determine if the host is alive
  1477. # or not.
  1478. when: ansible_hostname is not defined
  1479. tags:
  1480. - scale
  1481. fast_forward_upgrade_playbook:
  1482. str_replace:
  1483. params:
  1484. DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts}
  1485. DEPLOY_TARGET_HOST: {get_param: deployment_target_hosts}
  1486. template: |
  1487. - hosts: DEPLOY_TARGET_HOST
  1488. any_errors_fatal: yes
  1489. tasks:
  1490. - set_fact:
  1491. releases: {get_param: [FastForwardUpgradeReleases]}
  1492. {% raw %}
  1493. - set_fact:
  1494. ffu_releases: "{{ releases | difference( releases | last )}}"
  1495. - include_tasks: fast_forward_upgrade_release_tasks.yaml
  1496. loop_control:
  1497. loop_var: release
  1498. with_items: '{{ ffu_releases }}'
  1499. - set_fact:
  1500. release: "{{ releases | last }}"
  1501. ffu_packages_apply: True
  1502. {% endraw %}
  1503. - include_tasks: fast_forward_upgrade_post_role_tasks.yaml
  1504. fast_forward_upgrade_release_tasks: |
  1505. - include_tasks: fast_forward_upgrade_prep_tasks.yaml
  1506. - include_tasks: fast_forward_upgrade_bootstrap_tasks.yaml
  1507. fast_forward_upgrade_prep_tasks: |
  1508. {%- for role in roles %}
  1509. - shell: |
  1510. #!/bin/bash
  1511. if [ ! -f /root/.ffu_workaround ]; then
  1512. touch /root/.ffu_workaround
  1513. os-apply-config -m /var/lib/os-collect-config/{{role.deprecated_server_resource_name|default(role.name)}}Deployment.json
  1514. systemctl stop os-collect-config
  1515. rm -r /var/lib/os-collect-config/*
  1516. rm -f /usr/libexec/os-refresh-config/configure.d/40-hiera-datafiles
  1517. rm -f /usr/libexec/os-apply-config/templates/etc/puppet/hiera.yaml
  1518. rm -f /usr/libexec/os-refresh-config/configure.d/10-hiera-disable
  1519. fi
  1520. when: tripleo_role_name == '{{role.name}}'
  1521. name: Run Fast Forward Upgrade Prep Workarounds for {{role.name}}
  1522. {%- endfor %}
  1523. - name: Create /var/lib/container-puppet
  1524. file: path=/var/lib/container-puppet state=directory setype=svirt_sandbox_file_t selevel=s0 recurse=true
  1525. - name: Write container-puppet.py
  1526. no_log: True
  1527. copy: src=docker_puppet_script.yaml dest=/var/lib/container-puppet/container-puppet.py force=yes mode=0600
  1528. - name: Write container-puppet.sh
  1529. no_log: True
  1530. copy: src=container_puppet_script.yaml dest=/var/lib/container-puppet/container-puppet.sh force=yes mode=0755
  1531. - include_tasks: fast_forward_upgrade_prep_role_tasks.yaml
  1532. with_sequence: start=0 end={{fast_forward_upgrade_prep_steps_max}}
  1533. loop_control:
  1534. loop_var: step
  1535. fast_forward_upgrade_post_role_tasks: |
  1536. {%- for role in roles %}
  1537. - include_tasks: {{role.name}}/fast_forward_post_upgrade_tasks.yaml
  1538. when: tripleo_role_name == '{{role.name}}'
  1539. {%- endfor %}
  1540. - name: Openstack Heat Agents package update
  1541. package: name=openstack-heat-agents state=latest
  1542. - name: Update os-collect-config
  1543. package: name=os-collect-config state=latest
  1544. - name: Start os-collect-config back up
  1545. service: name=os-collect-config state=started enabled=yes
  1546. fast_forward_upgrade_prep_role_tasks: |
  1547. {%- for role in roles %}
  1548. - include_tasks: {{role.name}}/fast_forward_upgrade_tasks.yaml
  1549. when: tripleo_role_name == '{{role.name}}'
  1550. {%- endfor %}
  1551. fast_forward_upgrade_bootstrap_tasks: |
  1552. - include_tasks: fast_forward_upgrade_bootstrap_role_tasks.yaml
  1553. with_sequence: start={{fast_forward_upgrade_prep_steps_max+1}} end={{fast_forward_upgrade_steps_max}}
  1554. loop_control:
  1555. loop_var: step
  1556. fast_forward_upgrade_bootstrap_role_tasks: |
  1557. {%- for role in roles %}
  1558. - include_tasks: {{role.name}}/fast_forward_upgrade_tasks.yaml
  1559. when:
  1560. - tripleo_role_name == '{{role.name}}'
  1561. - is_bootstrap_node|bool
  1562. {%- endfor %}
  1563. post_update_steps_tasks: |
  1564. {%- for role in roles %}
  1565. - import_tasks: {{role.name}}/post_update_tasks.yaml
  1566. when: tripleo_role_name == '{{role.name}}'
  1567. {%- endfor %}