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).
- Ansible Lightspeed used the Playbook name "EC2 Cloud Operations" to use the correct "amazon.aws.ec2_vpc_subnet_info" module.
- Used the Playbook context to use AWS Ansible modules in the suggestion.
- Used natural language to generate the
vpc_subnet_id
variable using the correct variable keys. - The suggestion provides the correct key value from the previously task's registered variable.
- Used
tag:Name subnet-lightspeed
in the prompt to use the correct AWS filter.
- Used
tag:Name subnet-lightspeed
in the prompt to use the correct AWS filter.
- Suggestion provides good variable examples for module arguments.
- Ansible Lightspeed used the updated natural language prompt and referenced the
ec2_instance
variable in the suggestion.