Ansible Automation | Automating AWS EC2 Instance Creation using Ansible Playbook | Ansible Tutorials



We will learn how to create Ansible Playbook for provisioning a new EC2 instance in AWS cloud.

Pre-requistes:
Ansible is installed and Boto is also installed on Ubuntu EC2 instance
Make sure you create an IAM role with AmazonEC2FullAccess policy and attach the role to EC2 instance.

source

16 thoughts on “Ansible Automation | Automating AWS EC2 Instance Creation using Ansible Playbook | Ansible Tutorials”
  1. Though my target instance was created but I still got this error in the TASK; what could be the issue?

    [DEPRECATION WARNING]: amazon.aws.ec2 has been deprecated. The ec2 module is based upon a deprecated version of the AWS SDKs and is deprecated in favor of the ec2_instance module. Please update your tasks.

    This feature will be removed from amazon.aws in version 4.0.0. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

    [DEPRECATION WARNING]: The 'ec2' module has been deprecated and replaced by the 'ec2_instance' module'. This feature will be removed from amazon.aws in version 4.0.0. Deprecation warnings can be disabled

    by setting deprecation_warnings=False in ansible.cfg.

  2. fatal: [localhost]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "msg": "boto required for this module"}

    Getting this error even though I have installed boto

  3. fatal: [local -> localhost]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (botocore or boto3) on vm's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"}

  4. Hi coach love your channel i fell in love ever since i stumbled onto your channel, by the way have subscribed and always reading your blogs very educative have really leant a lot, appreciate you on this well done.
    But a point of notice i was of the opinion that terraform should have been used for provisioning and creating a new Ec2 instance in AWs cloud in this video instead of Ansible that is basically used as configuration management tools, my views anyway would love to be corrected on this. thanks

Leave a Reply

Your email address will not be published.

Captcha loading...