Ansible: create Amazon ec2 instance
Revision as of 06:15, 31 March 2022 by Welcome (talk | contribs) (Welcome moved page Create Amazon ec2 instance with Ansible to Ansible: create Amazon ec2 instance)
#!/usr/bin/env ansible-playbook - hosts: localhost connection: local become: False tasks: - amazon.aws.ec2: key_name: mykey region: us-east-1 instance_type: t3.nano image: ami-07c1207a9d40bc3bd vpc_subnet_id: subnet-968913da wait: yes count: 1 assign_public_ip: yes
#!/usr/bin/env ansible-playbook - name: Status ec2 instances hosts: 127.0.0.1 vars: ansible_python_interpreter: "/usr/bin/python3" connection: local tasks: - ec2: key_name: YOUR_KEY_NAME profile: XXXX region: us-east-1 instance_type: t3.nano image: ami-0f4768a55eaaac3d7 wait: yes count: 1 assign_public_ip: no
Errors[edit]
WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details PLAY [localhost] ***************************************************************************************************************************************************************************************************************************** TASK [Gathering Facts] *********************************************************************************************************************************************************************************************************************** ok: [localhost] TASK [amazon.aws.ec2] ************************************************************************************************************************************************************************************************************************ fatal: [localhost]: FAILED! => {"changed": false, "msg": "No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV4Handler'] Check your credentials"} PLAY RECAP *********************************************************************************************************************************************************************************************************************************** localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Related terms[edit]
- Ansible playbooks examples
aws ec2 run-instances
,aws ec2 describe-instances
aws configure list
- amazon.aws.ec2_key
- Manage AWS infrastructure using Ansible
- Create VM
- Terraform:
aws_instance
See also[edit]
- AWS, Amazon Managed Services, AWS Management & Governance, computing, security, networking, AWS compliance, AWS Outposts AWS Free Tier, AWS certifications, AWS Trusted Advisor, AWS Systems Manager, AWS Config, IAM Access Analyzer, AWS Cost Explorer, AWS Cost Management, AWS Budgets, AWS Organizations, AWS dev: (CodeStar, Cloud9), AWS Partner Network (APN), AWS Resource Access Manager, AWS Quick Starts, AWS Global Accelerator, AWS Elemental MediaStore, AWS Enterprise support, AWS support, AWS Professional Services Consultants, AWS Cloud Map, AWS Marketplace, AWS CLI, AWS Management Console, AWS acceptable use policy, amazonaws.com, Quotas, AWS Support plans, AWS Resource Explorer, AWS Managed Services (AMS), AWS savings, AWS Nitro System, AWS Activate, Serverless, AWS timeline
- Ansible: modules, plugins, Playbooks (examples)
ansible-playbook
,ansible-vault
,ansible-inventory
,ansible-config
, Ansible Tower, Ansible Galaxy (Roles) (ansible-galaxy
),ansible-cmdb
,gather facts
,ansible.cfg
,Ansible Molecule
, Ansible collections,register
,template
,--ask-pass
,--ask-become-pass
,remote_user:
,/etc/ansible/hosts
,ansible-doc
,ansible-lint
,.ansible/
,--forks
,--start-at-task
,changelog
,inventory
,Notify:
,ansible HOSTNAME -m ping
,gathering
,/usr/bin/ansible
,ansible -m ping
,ansible.builtin
,hosts: (Ansible)
,set fact:
,when:
,blockinfile:
,become method:
,include:
,git:
, AWX,ansible --help
, Tags, Ansible variables, versions
Advertising: