Specifying the private key file in a playbook

Hello all,

I’m trying to do this, conceptually:

# this playbook might create the public ssh key file
- hosts: 127.0.0.1
  connection: local
  […]

- hosts: base_instance
  connection: ssh
  remote_user: ubuntu
  # errors, since private_key_file isn’t a real play key.
  private_key_file: "{{ environment_public_ssh_key_file }}"

The idea being that the key file may be created as part of a previous play in the playbook.

Any suggestions are welcome.

-scott---