Question 249:
In your team, Ansible is used to configure more than 50 EC2 instances, and the playbook files are stored in an S3 bucket. The Ansible playbooks should only be executed locally on the instances which means other hosts such as a jump host cannot run the playbook remotely for the EC2 instances. You also need to run the playbooks for selected instances with specific tags. Which of the following methods is the most appropriate to configure instances via Ansible playbooks?
Answer options:
A.Configure a job in a Jenkins server to execute the Ansible playbooks with a tag parameter. The job uses the tag to determine which instances are included. B.Create a CloudFormation template with a tag parameter. When the CloudFormation stack is created or updated, EC2 instances with the tag are configured by the Ansible playbooks. C.Create a Lambda function that gets Ansible playbooks from the S3 bucket and executes the playbooks on selected EC2 instances based on tags. D.In Systems Manager Run Command, use the AWS-ApplyAnsiblePlaybooks document to run the playbooks on selected EC2 instances.