Unless I'm reading that wrong (and I may be, still on my first coffee), you're applying the apache role to 'localhost' - don't you want to run that on the ec2 instance that ec2_apache created instead?
On 19 May 2016 at 18:46, Perry Hoekstra <[email protected]> wrote: > I am attempting to create an EC2 instance in one role and installing Apache > on it in the next role. > > The pertinent playbook entry looks like this: > > # Configure and deploy Apache > - hosts: localhost > connection: local > remote_user: ec2-user > gather_facts: false > roles: > - ec2_apache > - apache > > The 'ec2_apache' role allocates an ec2 instance and the first task within > the apache/main.yml looks like this: > > - name: confirm using the latest Apache server > become: yes > become_method: sudo > yum: > name: httpd > state: latest > > This is where the error message "sudo: a password is required" is returned > which leads me to believe I have somehow horked up with security. When it > fails, I can SSH into that newly created EC2 instance and do a 'sudo ls > /etc" command. > > Thoughts on what I am doing wrong? > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/57ffdb69-f3f8-460f-8759-6bd1e85da9e8%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAK5eLPSYi2YJs1e%3DgZHtNzzj-Th6vRV893ydy9AWZXWpL0TrTQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
