Install the VS Code extension and activate Ansible Lightspeed using resources in the getting started guide.
The Ansible Lightspeed model continues to improve with each release and generated suggestions may differ from the examples provided.
Tested Ansible content starts with the solution_*.yml
prefix. For example, solution_provision_ec2_instance.yml
Please use this to compare your generated suggestions to the tested Ansible content.
This demo provisions an AWS EC2 instance using pre-existing variables.
- Configure your AWS credential environment variables as outlined in the Ansible AWS guide.
- Run the ./prepare_ec2_environment.yml Playbook to create the required AWS demo resources before running the
demo_provision_aws_instance.yml
Playbook.
- If you're running this outside of the Ansible Interactive Labs (Instruqt) environment, the
./prepare_ec2_environment.yml
creates a temporary SSH private .pem key file in the./playbooks/cloud/aws/files
folder to access the instance. - An example inventory is located the inventory folder.
./playbooks/cloud/aws/demo_provision_ec2_instance.yml
./playbooks/cloud/aws/solution_provision_ec2_instance.yml
Run the steps below in the ./playbooks/cloud/aws/demo_provision_aws_instance.yml example Ansible Playbook.
- Used natural language prompt to generate syntactically correct Ansible Playbook Task.
- Suggestion incorporated Ansible best practices and used Fully Qualified Collection Name (FQCN).
- The first task used the correct AWS tag "tag:Name" in the filter.
- The second task used the correct variable created in the previous task.
- Used details specified in the prompt. For example, "t3.small"
- The suggestion used the "my_instance" variable declared in the "vars:" section.
- The suggestion used the correct variable from the previous task and added the
retries
paramater. - The second task used the "public_ip_address" variable based on the previous task.