How to run commands on a host created by add_host in a role run on localhost
34 views
Skip to first unread message
Zhu Wayne
unread,
Mar 12, 2017, 11:30:30 AM3/12/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Here is my ansible playbook. I want to use role ec2_jumphost to create an EC2 instance and format / mount attached EBS volumes. I used add_host in the role to add the new EC2 instance as a host. How can I run commands in the role on the new EC2 instance?
Here is my ansible playbook - aws.yml. --- ... - name: Create AWS Jump Host hosts: localhost connection: local gather_facts: no vars_files: - "derived_vars/{{ vpc_name }}.yml" roles: - ec2jumphost
Brian Coca
unread,
Mar 13, 2017, 7:14:05 PM3/13/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
You can use delegate_to , or add 2nd play that uses the new group and
put the tasks there.