Added scale_tasks to handle cleanup on scale down of nodes

scale_down tasks will be executed when a node is scaled down to
deregister the node with ipa and clean up the relevant subhosts and
services and revoke the issued certs.

Change-Id: Ib636dc528687dc67fae85c27a1571f51ae7332e7
changes/64/706564/14
Ade Lee 3 years ago
parent fe3f38d3a9
commit 3bb9cb3a62
  1. 16
      deployment/ipa/ipaservices-baremetal-ansible.yaml

@ -88,8 +88,8 @@ outputs:
vars:
tripleo_ipa_enroll_base_server: {get_param: IdMEnrollBaseServer}
tripleo_ipa_delegate_server: "{{ item }}"
tripleo_ipa_base_server_fqdn: "{{hostvars[item]['fqdn_canonical']}}"
tripleo_ipa_server_metadata: "{{hostvars[item]['service_metadata_settings'] | to_json }}"
tripleo_ipa_base_server_fqdn: "{{ hostvars[item]['fqdn_canonical'] }}"
tripleo_ipa_server_metadata: "{{ hostvars[item]['service_metadata_settings'] | to_json }}"
loop: "{{ groups.certmonger_user }}"
- include_role:
name: tripleo_ipa_dns
@ -132,3 +132,15 @@ outputs:
when:
- idm_enroll_base_server|bool
- not ipa_conf_exists.stat.exists
scale_tasks:
- when: step|int == 1
tags: down
block:
- name: unregister node from ipa server
import_role:
name: tripleo_ipa_cleanup
delegate_to: localhost
vars:
tripleo_ipa_keytab: {get_param: IdMNovaKeytab}
tripleo_ipa_hosts_to_delete:
- "{{ fqdn_canonical }}"

Loading…
Cancel
Save