Hi there

I've got a play that creates an AWS EC2 instance through a CloudFormation 
template. After it's created I would like to configure it - I can use the 
AWS tools to do that but I prefer to use Ansible to be consistent with our 
other deployments.

What I have now is:

---
- name: Create Amazon Linux Instance
  hosts: localhost
  connection: local
  gather_facts: no
  vars_files:
  - config.yml

  tasks:
  - name: Create CloudFormation Stack
    cloudformation:
      stack_name: "{{ stack_name }}"
      state: present
      template: basic-ec2-stack.json
      template_parameters:
        KeyName: "{{ key_name }}"
        VpcId: "{{ vpc_id }}"
        SubnetId: "{{ subnet_id }}"
        ...
    register: stack

  # The new instance name is in stack.stack_outputs.DnsName ...
  - debug: var=stack.stack_outputs.DnsName


Now what? How can I run the rest of the playbook against the newly created 
host?
For example I would like to create user 'blah' but not on the localhost 
(against which the cloudformation module is running) but obviously on the 
EC2 instence. How do I do that?

Thanks!

Michael


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a91f1016-2b86-4682-8f92-1f1dcc23e1a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to