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.
 
 
 
 

673 lines
27 KiB

  1. heat_template_version: rocky
  2. description: >
  3. TripleO Package installation settings
  4. parameters:
  5. ServiceData:
  6. default: {}
  7. description: Dictionary packing service data
  8. type: json
  9. ServiceNetMap:
  10. default: {}
  11. description: Mapping of service_name -> network name. Typically set
  12. via parameter_defaults in the resource registry. This
  13. mapping overrides those in ServiceNetMapDefaults.
  14. type: json
  15. DefaultPasswords:
  16. default: {}
  17. type: json
  18. RoleName:
  19. default: ''
  20. description: Role name on which the service is applied
  21. type: string
  22. RoleParameters:
  23. default: {}
  24. description: Parameters specific to the role
  25. type: json
  26. EndpointMap:
  27. default: {}
  28. description: Mapping of service endpoint -> protocol. Typically set
  29. via parameter_defaults in the resource registry.
  30. type: json
  31. EnablePackageInstall:
  32. default: 'false'
  33. description: Set to true to enable package installation at deploy time
  34. type: boolean
  35. FastForwardRepoType:
  36. default: 'tripleo-repos'
  37. type: string
  38. constraints:
  39. - allowed_values: ['tripleo-repos', 'custom-script']
  40. FastForwardRepoArgs:
  41. default: {'tripleo_repos': {'rocky': '-b rocky current', 'stein': '-b stein current', 'train': '-b train current'}}
  42. type: json
  43. FastForwardCustomRepoScriptContent:
  44. default: |
  45. #!/bin/bash
  46. set -e
  47. echo "If you use FastForwardRepoType 'custom-script' you have to provide the upgrade repo script content."
  48. echo "It will be installed as /root/ffu_upgrade_repo.sh on the node"
  49. echo "and passed the upstream name (rocky, stein, train) of the release as first argument"
  50. exit 1
  51. type: string
  52. GlanceNodeStagingUri:
  53. default: 'file:///var/lib/glance/staging'
  54. description: >
  55. URI that specifies the staging location to use when importing images
  56. type: string
  57. UpgradeLeappEnabled:
  58. description: Use Leapp for operating system upgrade
  59. type: boolean
  60. default: false
  61. UpgradeLeappDebug:
  62. description: Print debugging output when running Leapp
  63. type: boolean
  64. default: true
  65. UpgradeLeappDevelSkip:
  66. description: |
  67. Skip Leapp checks by setting env variables when running Leapp in
  68. development/testing. For example, LEAPP_DEVEL_SKIP_RHSM=1.
  69. type: string
  70. default: ''
  71. UpgradeLeappCommandOptions:
  72. description: |
  73. In case or using UpgradeLeappDevelSkip with LEAPP_NO_RHSM=1 user
  74. can specify --enablerepo <repo1> --enablerepo <repo2> options for
  75. leapp to use these repositories for the upgrade process.
  76. type: string
  77. default: ''
  78. UpgradeLeappRebootTimeout:
  79. description: Timeout (seconds) for the OS upgrade phase via Leapp
  80. type: number
  81. default: 3600
  82. UpgradeLeappToRemove:
  83. default: []
  84. description: List of packages to remove during Leapp upgrade.
  85. type: comma_delimited_list
  86. UpgradeLeappToInstall:
  87. default: []
  88. description: List of packages to install after Leapp upgrade.
  89. type: comma_delimited_list
  90. LeappRepoInitCommand:
  91. type: string
  92. description: |
  93. Command or script snippet to run on all overcloud nodes to
  94. initialize the Leapp process. E.g. a repository switch.
  95. default: ''
  96. LeappInitCommand:
  97. type: string
  98. description: |
  99. Command or script snippet to run on all overcloud nodes to
  100. apply any necessary workarounds to get Leapp working.
  101. default: ''
  102. UpgradeInitCommand:
  103. type: string
  104. description: |
  105. Command or script snippet to run on all overcloud nodes to
  106. initialize the upgrade process. E.g. a repository switch.
  107. default: ''
  108. UpgradeInitCommonCommand:
  109. type: string
  110. description: |
  111. Common commands required by the upgrades process. This should not
  112. normally be modified by the operator and is set and unset in the
  113. major-upgrade-composable-steps.yaml and major-upgrade-converge.yaml
  114. environment files.
  115. default: ''
  116. SkipPackageUpdate:
  117. default: 'false'
  118. description: Set to true to skip the update all packages
  119. type: boolean
  120. SkipRhelEnforcement:
  121. default: "false"
  122. description: Whether to avoid or not RHEL/OSP policies enforcement on Red Hat.
  123. Mainly for CI purpose. It shouldn't matter on other distributions
  124. where it's disabled in the role. Set to true to skip the enforcement.
  125. type: string
  126. outputs:
  127. role_data:
  128. description: Role data for the TripleO package settings
  129. value:
  130. service_name: tripleo_packages
  131. config_settings:
  132. tripleo::packages::enable_install: {get_param: EnablePackageInstall}
  133. step_config: |
  134. include ::tripleo::packages
  135. upgrade_tasks:
  136. - name: Gather missing facts
  137. setup:
  138. gather_subset: "distribution"
  139. when: >-
  140. ansible_facts['distribution'] is not defined or
  141. ansible_facts['distribution_major_version'] is not defined
  142. tags:
  143. - always
  144. - name: Set leapp facts
  145. set_fact:
  146. upgrade_leapp_enabled: >-
  147. {{ _upgradeLeappEnabled | bool and
  148. ansible_facts['distribution'] == 'RedHat' and
  149. ansible_facts['distribution_major_version'] is version('7', '==') }}
  150. upgrade_leapp_debug: {get_param: UpgradeLeappDebug}
  151. upgrade_leapp_devel_skip: {get_param: UpgradeLeappDevelSkip}
  152. upgrade_leapp_command_options: {get_param: UpgradeLeappCommandOptions}
  153. upgrade_leapp_reboot_timeout: {get_param: UpgradeLeappRebootTimeout}
  154. vars:
  155. _upgradeLeappEnabled: {get_param: UpgradeLeappEnabled}
  156. tags:
  157. - always
  158. - name: system_upgrade_prepare step 3
  159. tags:
  160. - never
  161. - system_upgrade
  162. - system_upgrade_prepare
  163. when:
  164. - step|int == 3
  165. - upgrade_leapp_enabled
  166. block:
  167. - name: Hack around broken ceph-common rpm removing /etc/ceph /var/lib/ceph
  168. ignore_errors: true
  169. shell: |
  170. rpm -e --nodeps --noscripts ceph-common
  171. - name: remove all OpenStack packages
  172. shell: >-
  173. yum -y remove
  174. *el7ost*
  175. galera*
  176. xinetd*
  177. haproxy*
  178. httpd
  179. kernel-devel
  180. mysql*
  181. pacemaker*
  182. python-jsonpointer
  183. qemu-kvm-common-rhev
  184. qemu-img-rhev
  185. rabbit*
  186. redis*
  187. --
  188. -*openvswitch*
  189. -python-docker
  190. -python-PyMySQL
  191. -python-pysocks
  192. -python2-asn1crypto
  193. -python2-babel
  194. -python2-cffi
  195. -python2-cryptography
  196. -python2-dateutil
  197. -python2-idna
  198. -python2-ipaddress
  199. -python2-jinja2
  200. -python2-jsonpatch
  201. -python2-markupsafe
  202. -python2-pyOpenSSL
  203. -python2-requests
  204. -python2-six
  205. -python2-urllib3
  206. - name: Run LeappRepoInitCommand
  207. shell:
  208. list_join:
  209. - ''
  210. - - "#!/bin/bash\n\n"
  211. - {get_param: LeappRepoInitCommand}
  212. - name: install leapp
  213. package:
  214. name: leapp
  215. state: latest
  216. - name: Check that the /etc/leapp/files/pes-events.json exists on UC
  217. delegate_to: undercloud
  218. stat:
  219. path: '/etc/leapp/files/pes-events.json'
  220. register: pes_present
  221. - name: Check that the /etc/leapp/files/repomap.csv exists on UC
  222. delegate_to: undercloud
  223. stat:
  224. path: '/etc/leapp/files/repomap.csv'
  225. register: repomap_present
  226. - name: Fetch the Leapp data from undercloud
  227. fetch:
  228. dest: '{{ playbook_dir }}'
  229. src: '{{ item }}'
  230. delegate_to: undercloud
  231. with_items:
  232. - /etc/leapp/files/pes-events.json
  233. - /etc/leapp/files/repomap.csv
  234. when:
  235. - repomap_present.stat.exists
  236. - pes_present.stat.exists
  237. - name: Copy the Leapp data from undercloud
  238. copy:
  239. dest: '{{ item }}'
  240. src: '{{ playbook_dir }}/{{ inventory_hostname }}/{{ item }}'
  241. with_items:
  242. - /etc/leapp/files/pes-events.json
  243. - /etc/leapp/files/repomap.csv
  244. when:
  245. - repomap_present.stat.exists
  246. - pes_present.stat.exists
  247. - name: Run LeappInitCommand
  248. shell:
  249. list_join:
  250. - ''
  251. - - "#!/bin/bash\n\n"
  252. - {get_param: LeappInitCommand}
  253. - name: "add packages into Leapp's to_remove file"
  254. vars:
  255. pkg_to_remove: { get_param: UpgradeLeappToRemove }
  256. lineinfile:
  257. path: "/etc/leapp/transaction/to_remove"
  258. line: "{{ item }}"
  259. loop: "{{ pkg_to_remove }}"
  260. - name: "add packages into Leapp's to_install file"
  261. vars:
  262. pkg_to_install: { get_param: UpgradeLeappToInstall }
  263. lineinfile:
  264. path: "/etc/leapp/transaction/to_install"
  265. line: "{{ item }}"
  266. loop: "{{ pkg_to_install }}"
  267. - name: system_upgrade_prepare step 4
  268. tags:
  269. - never
  270. - system_upgrade
  271. - system_upgrade_prepare
  272. when:
  273. - step|int == 4
  274. - upgrade_leapp_enabled
  275. block:
  276. - name: unmount and remove nfs glance entry
  277. mount: path=/var/lib/glance/images state=absent
  278. ignore_errors: true
  279. - name: unmount and remove nfs glance staging entry
  280. vars:
  281. glance_node_staging_uri: {get_param: GlanceNodeStagingUri}
  282. mount: path="{{glance_node_staging_uri[7:]}}" state=absent
  283. ignore_errors: true
  284. - name: unmount and remove nfs nova entry
  285. mount: path=/var/lib/nova/instances state=absent
  286. ignore_errors: true
  287. - name: set leapp options
  288. shell: >
  289. leapp answer --section remove_pam_pkcs11_module_check.confirm=True --add
  290. - name: run leapp upgrade (download packages)
  291. shell: >
  292. {% if upgrade_leapp_devel_skip|default(false) %}{{ upgrade_leapp_devel_skip }}{% endif %}
  293. leapp upgrade
  294. {% if upgrade_leapp_debug|default(true) %}--debug{% endif %}
  295. {% if upgrade_leapp_command_options|default(false) %}{{ upgrade_leapp_command_options }}{% endif %}
  296. - name: system_upgrade_run step 4
  297. tags:
  298. - never
  299. - system_upgrade
  300. - system_upgrade_run
  301. # In case someone needs to re-run system_upgrade_run post-tasks
  302. # but doesn't want to reboot, they can run with
  303. # `--skip-tags system_upgrade_reboot`.
  304. - system_upgrade_reboot
  305. when:
  306. - step|int == 4
  307. - upgrade_leapp_enabled
  308. block:
  309. - name: reboot to perform the upgrade
  310. reboot:
  311. reboot_timeout: "{{upgrade_leapp_reboot_timeout}}"
  312. - name: Clear gathered facts from all currently targeted hosts
  313. meta: clear_facts
  314. - name: Force facts refresh after OS upgrade to refresh cache.
  315. setup:
  316. - name: Set the python to python3
  317. shell: alternatives --set python /usr/bin/python3
  318. - name: Package and repo update tasks
  319. when: step|int == 0
  320. block:
  321. - name: Run UpgradeInitCommand
  322. shell:
  323. list_join:
  324. - ''
  325. - - "#!/bin/bash\n\n"
  326. - {get_param: UpgradeInitCommand}
  327. - name: Run UpgradeInitCommonCommand
  328. shell:
  329. list_join:
  330. - ''
  331. - - "#!/bin/bash\n\n"
  332. - {get_param: UpgradeInitCommonCommand}
  333. - name: Ensure EL modules are in proper state
  334. shell: dnf -y distro-sync
  335. when: ansible_distribution_major_version == '8'
  336. - name: Ensure TripleO prerequisite packages are installed
  337. package:
  338. name:
  339. - jq
  340. - lvm2
  341. - net-snmp
  342. - openstack-selinux
  343. - os-net-config
  344. - pacemaker
  345. - pcs
  346. - puppet-tripleo
  347. - python3-heat-agent*
  348. - rsync
  349. state: present
  350. when: ansible_distribution_major_version == '8'
  351. # With the layered product packaging, the key package is rhosp-openvswitch. It depends on
  352. # a openvswitch package that includes the version as part of the name (e.g openvswitch2.10).
  353. # This requires some additional special handling:
  354. # - During an upgrade the package name for openvswitch may change so
  355. # upgrading the currently installed package won't do anything.
  356. # - The rhosp-openvswitch package "obsoletes" several packages,
  357. # including older openvswitch packages. This results in a pretty
  358. # severe uninstall/install sequence of operations that stops and
  359. # removes openvswitch which could break network links required to
  360. # continue the upgrade.
  361. # - To prevent rhosp-openvswitch breaking connectivity, the currently
  362. # installed core openvswitch packages need to be erased from the rpm
  363. # database but leave the binaries intact. This effectively
  364. # short-circuits the obsoletes mechanism in rhosp-openvswitch and
  365. # leaves the core elements of openvswitch running. In the future we
  366. # may replace this mechanism with "an upgrade on reboot". We only
  367. # do this for the core openvswitch packages so other packages
  368. # obsoleted by rhosp-openvswitch will be removed when
  369. # rhosp-openvswitch is installed/upgraded.
  370. # - Neither the rhosp-openvswitch nor openvswitch{m.n} package enables
  371. # or starts the systemd service so there must always be a task
  372. # to ensure that it is enabled or OpenvSwitch functionality won't be
  373. # available on reboot.
  374. # - With LP, we expect that the core openvswitch package name will
  375. # change with every major upgrade so this special handling will
  376. # eventually replace the special handling of upgrading the
  377. # openvswitch package "in place"
  378. - name: Get current OpenvSwitch package name
  379. register: ovs_pkg_out
  380. shell:
  381. rpm -qa | awk -F- '/^(openvswitch[0-9]+\.[0-9]+-[0-9]+\.[0-9]+\.[-0]+-|openvswitch-2)/{print $1}'
  382. - name: Don't update if not present
  383. set_fact:
  384. run_ovs_update: "{{ (ovs_pkg_out.stdout | length) > 0 }}"
  385. - name: Block for gathering information for upgrading OpenvSwitch layered product packaging
  386. when:
  387. - step|int == 2
  388. - run_ovs_update|bool
  389. block:
  390. - name: Process rhosp-openvswitch layered package for new version number
  391. shell: |
  392. set -o pipefail
  393. yum info -q rhosp-openvswitch | awk '/^Version/{print $NF}'
  394. register: rhosp_package_result
  395. failed_when: false
  396. - name: Set fact for triggering OpenvSwitch layered product package handling
  397. set_fact:
  398. ovs_lp_packaging: "{{ rhosp_package_result.rc == 0 }}"
  399. - name: Capture the expected OpenvSwitch version.
  400. set_fact:
  401. new_ovs_version: "{{ rhosp_package_result.stdout }}"
  402. when: ovs_lp_packaging|default(false)
  403. - name: Get version from current OpenvSwitch package
  404. register: ovs_version_out
  405. shell:
  406. rpm -qi "{{ ovs_pkg_out.stdout }}" | awk '/^Version/{print $NF}'
  407. - name: split numeric version for OpenvSwitch into parts
  408. set_fact:
  409. ovs_version_parts: "{{ ovs_version_out.stdout.split('.') }}"
  410. - name: get major minor version for OpenvSwitch package naming
  411. set_fact:
  412. current_ovs_version: "{{ ovs_version_parts[0] }}.{{ ovs_version_parts[1] }}"
  413. - name: get OpenvSwitch major version
  414. set_fact:
  415. current_ovs_major_version: "{{ ovs_version_parts[0]|int }}"
  416. - name: get OpenvSwitch minor version
  417. set_fact:
  418. current_ovs_minor_version: "{{ ovs_version_parts[1]|int }}"
  419. - name: Block for upgrading OpenvSwitch when layer package is present
  420. when:
  421. - step|int == 2
  422. - ovs_lp_packaging|default(false)
  423. block:
  424. - name: set current OpenvSwitch package suffix if old version is layered product format
  425. set_fact:
  426. package_suffix: "{{ current_ovs_version }}"
  427. when:
  428. - current_ovs_major_version|int >= 3 or current_ovs_minor_version|int >=10
  429. - name: remove old OpenvSwitch package(s) if version doesn't match
  430. shell: |
  431. rpm -e --noscripts --nopreun --nopostun --notriggers --nodeps $(rpm -qa 'openvswitch{{ package_suffix|default('') }}*' | grep -v 'selinux')
  432. args:
  433. warn: false
  434. when: new_ovs_version != current_ovs_version
  435. - name: install/upgrade OpenvSwitch LP package
  436. package:
  437. name: rhosp-openvswitch
  438. state: latest
  439. - name: set flag to skip other upgrade steps since OpenvSwitch is already upgraded!
  440. set_fact:
  441. run_ovs_update: false
  442. - name: Check for openvswitch upgrade if not layered package installs
  443. when:
  444. - step|int == 2
  445. - run_ovs_update|bool
  446. block:
  447. - name: check if an upgrade is required
  448. register: ovs_need_upgrade
  449. failed_when: false
  450. shell: |
  451. yum check-upgrade openvswitch | awk '/openvswitch/{print}'
  452. - name: Check openvswitch packaging.
  453. shell: rpm -q --scripts openvswitch | awk '/postuninstall/,/*/' | grep -q "systemctl.*try-restart"
  454. register: ovs_packaging_issue
  455. failed_when: false
  456. - name: Upgrade openvswitch
  457. block:
  458. - name: "Ensure empty directory: emptying."
  459. file:
  460. state: absent
  461. path: /root/OVS_UPGRADE
  462. - name: "Ensure empty directory: creating."
  463. file:
  464. state: directory
  465. path: /root/OVS_UPGRADE
  466. owner: root
  467. group: root
  468. mode: 0750
  469. - name: Make yum cache.
  470. command: yum makecache
  471. - name: Download OVS packages.
  472. command: yumdownloader --destdir /root/OVS_UPGRADE --resolve openvswitch
  473. - name: Get rpm list for manual upgrade of OVS.
  474. shell: ls -1 /root/OVS_UPGRADE/*.rpm
  475. register: ovs_list_of_rpms
  476. - name: Manual upgrade of OVS
  477. shell: |
  478. rpm -U --replacepkgs --notriggerun --nopostun {{item}}
  479. args:
  480. chdir: /root/OVS_UPGRADE
  481. with_items:
  482. - "{{ovs_list_of_rpms.stdout_lines}}"
  483. when:
  484. - step|int == 2
  485. - run_ovs_update|bool
  486. - ovs_packaging_issue.rc == 0 | default(false)
  487. - ovs_need_upgrade.stdout|default('')
  488. - name: Install libibverbs (https://bugs.launchpad.net/tripleo/+bug/1817743)
  489. when: step|int == 2
  490. package:
  491. name: libibverbs
  492. state: installed
  493. # The openvswitch package disables the systemd service on install. When installing
  494. # the layered product we prevent the service from being killed, but it doesn't
  495. # do anything to prevent the systemd service from being removed and it is not
  496. # re-enabled by default by the new package.
  497. - name: Always ensure the openvswitch service is enabled and running after upgrades
  498. when: step|int == 2
  499. service:
  500. name: openvswitch
  501. enabled: yes
  502. state: started
  503. - name: Check for os-net-config upgrade
  504. shell: "yum check-upgrade | awk '/os-net-config/{print}'"
  505. register: os_net_config_need_upgrade
  506. when: step|int == 3
  507. - name: Check that os-net-config has configuration
  508. shell: test -s /etc/os-net-config/config.json
  509. register: os_net_config_has_config
  510. failed_when: false
  511. when: step|int == 3
  512. - block:
  513. - name: Upgrade os-net-config
  514. package: name=os-net-config state=latest
  515. - name: take new os-net-config parameters into account now
  516. command: os-net-config --no-activate -c /etc/os-net-config/config.json -v --detailed-exit-codes
  517. register: os_net_config_upgrade
  518. failed_when: os_net_config_upgrade.rc not in [0,2]
  519. changed_when: os_net_config_upgrade.rc == 2
  520. when:
  521. - step|int == 3
  522. - os_net_config_need_upgrade.stdout
  523. - os_net_config_has_config.rc == 0
  524. - name: Set boolean skip_package_update
  525. set_fact:
  526. skip_package_update: {get_param: SkipPackageUpdate}
  527. # Exclude ansible until https://github.com/ansible/ansible/issues/56636
  528. # is available
  529. - name: Update all packages
  530. when:
  531. - step|int == 3
  532. - not skip_package_update|bool
  533. yum:
  534. name: '*'
  535. state: latest
  536. exclude: ansible
  537. external_upgrade_tasks:
  538. - name: Clean up upgrade artifacts
  539. when: step|int == 1
  540. tags:
  541. - never
  542. - system_upgrade_cleanup
  543. block:
  544. - name: cleanup tripleo_persist
  545. include_role:
  546. name: tripleo-persist
  547. tasks_from: cleanup.yml
  548. - name: cleanup tripleo_transfer
  549. include_role:
  550. name: tripleo-transfer
  551. tasks_from: cleanup.yml
  552. update_tasks:
  553. - name: Enforce RHOSP rules regarding subscription.
  554. include_role:
  555. name: tripleo-redhat-enforce
  556. vars:
  557. skip_rhel_enforcement: {get_param: SkipRhelEnforcement}
  558. when:
  559. - step|int == 0
  560. - ansible_distribution == 'RedHat'
  561. - not (skip_rhel_enforcement | bool)
  562. - name: Check for existing yum.pid
  563. stat: path=/var/run/yum.pid
  564. register: yum_pid_file
  565. when: step|int == 0 or step|int == 3
  566. - name: Exit if existing yum process
  567. fail: msg="ERROR existing yum.pid detected - can't continue! Please ensure there is no other package update process for the duration of the minor update worfklow. Exiting."
  568. when: (step|int == 0 or step|int == 3) and yum_pid_file.stat.exists
  569. - name: Set boolean skip_package_update
  570. set_fact:
  571. skip_package_update: {get_param: SkipPackageUpdate}
  572. # Exclude ansible until https://github.com/ansible/ansible/issues/56636
  573. # is available
  574. - name: Update all packages
  575. when:
  576. - step|int == 3
  577. - not skip_package_update|bool
  578. yum:
  579. name: '*'
  580. state: latest
  581. exclude: ansible
  582. # This is failsafe unless openvswitch package does something to the systemd service state.
  583. - name: Ensure openvswitch is running after update
  584. when: step|int == 3
  585. service:
  586. name: openvswitch
  587. enabled: yes
  588. state: started
  589. fast_forward_upgrade_tasks:
  590. - block:
  591. - name: set is_bootstrap_node fact
  592. set_fact: is_bootstrap_node={{tripleo_packages_short_bootstrap_node_name|lower == ansible_hostname|lower}}
  593. - name: Register repo type and args
  594. set_fact:
  595. fast_forward_repo_type: {get_param: FastForwardRepoType}
  596. fast_forward_repo_args: {get_param: FastForwardRepoArgs}
  597. - debug:
  598. msg: "fast_forward_repo_type: {{ fast_forward_repo_type }} fast_forward_repo_args: {{ fast_forward_repo_args }}"
  599. when:
  600. - step|int == 3
  601. - block:
  602. - name: clone tripleo-repos
  603. git:
  604. repo: https://github.com/openstack/tripleo-repos.git
  605. dest: /home/stack/tripleo-repos/
  606. - name: install tripleo-repos
  607. command: python setup.py install
  608. args:
  609. chdir: /home/stack/tripleo-repos/
  610. - name: Enable tripleo-repos
  611. command: "tripleo-repos {{ fast_forward_repo_args.tripleo_repos[release] }}"
  612. when:
  613. - step|int == 3
  614. - is_bootstrap_node|bool
  615. - fast_forward_repo_type == 'tripleo-repos'
  616. - block:
  617. - name: Create custom Script for upgrading repo.
  618. copy:
  619. dest: /root/ffu_update_repo.sh
  620. content: {get_param: FastForwardCustomRepoScriptContent}
  621. mode: 0700
  622. - name: Execute custom script for upgrading repo.
  623. shell: "/root/ffu_update_repo.sh {{release}}"
  624. when:
  625. - step|int == 3
  626. - is_bootstrap_node|bool
  627. - fast_forward_repo_type == 'custom-script'
  628. fast_forward_post_upgrade_tasks:
  629. - block:
  630. - name: Register repo type and args
  631. set_fact:
  632. fast_forward_repo_type: {get_param: FastForwardRepoType}
  633. fast_forward_repo_args: {get_param: FastForwardRepoArgs}
  634. - debug:
  635. msg: "fast_forward_repo_type: {{ fast_forward_repo_type }} fast_forward_repo_args: {{ fast_forward_repo_args }}"
  636. when:
  637. - step|int == 3
  638. - block:
  639. - name: clone tripleo-repos
  640. git:
  641. repo: https://github.com/openstack/tripleo-repos.git
  642. dest: /home/stack/tripleo-repos/
  643. - name: install tripleo-repos
  644. command: python setup.py install
  645. args:
  646. chdir: /home/stack/tripleo-repos/
  647. - name: Enable tripleo-repos
  648. command: "tripleo-repos {{ fast_forward_repo_args.tripleo_repos[release] }}"
  649. when:
  650. - step|int == 3
  651. - is_bootstrap_node|bool
  652. - fast_forward_repo_type == 'tripleo-repos'
  653. - block:
  654. - name: Create custom Script for upgrading repo.
  655. copy:
  656. dest: /root/ffu_update_repo.sh
  657. content: {get_param: FastForwardCustomRepoScriptContent}
  658. mode: 0700
  659. - name: Execute custom script for upgrading repo.
  660. shell: "/root/ffu_update_repo.sh {{release}}"
  661. when:
  662. - step|int == 3
  663. - is_bootstrap_node|bool
  664. - fast_forward_repo_type == 'custom-script'