Ask Your Question

Revision history [back]

Yes, you can using the if macro (you're already correctly creating the resources conditionally). I'm not 100% sure it's possible without some duplication, but this should certainly work:

server_init:
  type: OS::Heat::MultipartMime
  properties:
    parts:
      if:
        - playbook_included
        - - config: { get_attr: [ssh_keys_admins, resource.cloud_config_ssh] }
          - config: { get_attr: [playbook_runner, resource.playbook_runner] }
        - - config: { get_attr: [ssh_keys_admins, resource.cloud_config_ssh] }