diff --git a/plugins/modules/aws_az_info.py b/plugins/modules/aws_az_info.py index 44b61fe2c55..3a741ad3061 100644 --- a/plugins/modules/aws_az_info.py +++ b/plugins/modules/aws_az_info.py @@ -16,7 +16,7 @@ short_description: Gather information about availability zones in AWS. description: - Gather information about availability zones in AWS. - - This module was called C(aws_az_facts) before Ansible 2.9. The usage did not change. + - This module was called M(amazon.aws.aws_az_facts) before Ansible 2.9. The usage did not change. author: 'Henrique Rodrigues (@Sodki)' options: filters: @@ -38,11 +38,11 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Gather information about all availability zones -- aws_az_info: +- name: Gather information about all availability zones + amazon.aws.aws_az_info: -# Gather information about a single availability zone -- aws_az_info: +- name: Gather information about a single availability zone + amazon.aws.aws_az_info: filters: zone-name: eu-west-1a ''' diff --git a/plugins/modules/aws_caller_info.py b/plugins/modules/aws_caller_info.py index 5a3dd4c96cd..68091a04cbd 100644 --- a/plugins/modules/aws_caller_info.py +++ b/plugins/modules/aws_caller_info.py @@ -18,7 +18,7 @@ description: - This module returns information about the account and user / role from which the AWS access tokens originate. - The primary use of this is to get the account id for templating into ARNs or similar to avoid needing to specify this information in inventory. - - This module was called C(aws_caller_facts) before Ansible 2.9. The usage did not change. + - This module was called M(amazon.aws.aws_caller_facts) before Ansible 2.9. The usage did not change. author: - Ed Costello (@orthanc) @@ -35,7 +35,7 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Get the current caller identity information - aws_caller_info: + amazon.aws.aws_caller_info: register: caller_info ''' diff --git a/plugins/modules/aws_s3.py b/plugins/modules/aws_s3.py index 7570eaeda5b..4ac1198b98b 100644 --- a/plugins/modules/aws_s3.py +++ b/plugins/modules/aws_s3.py @@ -154,14 +154,14 @@ EXAMPLES = ''' - name: Simple PUT operation - aws_s3: + amazon.aws.aws_s3: bucket: mybucket object: /my/desired/key.txt src: /usr/local/myfile.txt mode: put - name: Simple PUT operation in Ceph RGW S3 - aws_s3: + amazon.aws.aws_s3: bucket: mybucket object: /my/desired/key.txt src: /usr/local/myfile.txt @@ -170,14 +170,14 @@ s3_url: "http://localhost:8000" - name: Simple GET operation - aws_s3: + amazon.aws.aws_s3: bucket: mybucket object: /my/desired/key.txt dest: /usr/local/myfile.txt mode: get - name: Get a specific version of an object. - aws_s3: + amazon.aws.aws_s3: bucket: mybucket object: /my/desired/key.txt version: 48c9ee5131af7a716edc22df9772aa6f @@ -185,7 +185,7 @@ mode: get - name: PUT/upload with metadata - aws_s3: + amazon.aws.aws_s3: bucket: mybucket object: /my/desired/key.txt src: /usr/local/myfile.txt @@ -193,7 +193,7 @@ metadata: 'Content-Encoding=gzip,Cache-Control=no-cache' - name: PUT/upload with custom headers - aws_s3: + amazon.aws.aws_s3: bucket: mybucket object: /my/desired/key.txt src: /usr/local/myfile.txt @@ -201,12 +201,12 @@ headers: 'x-amz-grant-full-control=emailAddress=owner@example.com' - name: List keys simple - aws_s3: + amazon.aws.aws_s3: bucket: mybucket mode: list - name: List keys all options - aws_s3: + amazon.aws.aws_s3: bucket: mybucket mode: list prefix: /my/desired/ @@ -214,25 +214,25 @@ max_keys: 472 - name: Create an empty bucket - aws_s3: + amazon.aws.aws_s3: bucket: mybucket mode: create permission: public-read - name: Create a bucket with key as directory, in the EU region - aws_s3: + amazon.aws.aws_s3: bucket: mybucket object: /my/directory/path mode: create region: eu-west-1 - name: Delete a bucket and all contents - aws_s3: + amazon.aws.aws_s3: bucket: mybucket mode: delete - name: GET an object but don't download if the file checksums match. New in 2.0 - aws_s3: + amazon.aws.aws_s3: bucket: mybucket object: /my/desired/key.txt dest: /usr/local/myfile.txt @@ -240,7 +240,7 @@ overwrite: different - name: Delete an object from a bucket - aws_s3: + amazon.aws.aws_s3: bucket: mybucket object: /my/desired/key.txt mode: delobj diff --git a/plugins/modules/cloudformation.py b/plugins/modules/cloudformation.py index b30e83ed8e2..9f9114ae59d 100644 --- a/plugins/modules/cloudformation.py +++ b/plugins/modules/cloudformation.py @@ -172,7 +172,7 @@ EXAMPLES = ''' - name: create a cloudformation stack - cloudformation: + amazon.aws.cloudformation: stack_name: "ansible-cloudformation" state: "present" region: "us-east-1" @@ -188,7 +188,7 @@ # Basic role example - name: create a stack, specify role that cloudformation assumes - cloudformation: + amazon.aws.cloudformation: stack_name: "ansible-cloudformation" state: "present" region: "us-east-1" @@ -197,14 +197,14 @@ role_arn: 'arn:aws:iam::123456789012:role/cloudformation-iam-role' - name: delete a stack - cloudformation: + amazon.aws.cloudformation: stack_name: "ansible-cloudformation-old" state: "absent" # Create a stack, pass in template from a URL, disable rollback if stack creation fails, # pass in some parameters to the template, provide tags for resources created - name: create a stack, pass in the template via an URL - cloudformation: + amazon.aws.cloudformation: stack_name: "ansible-cloudformation" state: present region: us-east-1 @@ -221,7 +221,7 @@ # Create a stack, passing in template body using lookup of Jinja2 template, disable rollback if stack creation fails, # pass in some parameters to the template, provide tags for resources created - name: create a stack, pass in the template body via lookup template - cloudformation: + amazon.aws.cloudformation: stack_name: "ansible-cloudformation" state: present region: us-east-1 @@ -239,7 +239,7 @@ # When use_previous_value is set to True, the given value will be ignored and # CloudFormation will use the value from a previously submitted template. # If use_previous_value is set to False (default) the given value is used. -- cloudformation: +- amazon.aws.cloudformation: stack_name: "ansible-cloudformation" state: "present" region: "us-east-1" @@ -256,7 +256,7 @@ # Enable termination protection on a stack. # If the stack already exists, this will update its termination protection - name: enable termination protection during stack creation - cloudformation: + amazon.aws.cloudformation: stack_name: my_stack state: present template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template @@ -265,7 +265,7 @@ # Configure TimeoutInMinutes before the stack status becomes CREATE_FAILED # In this case, if disable_rollback is not set or is set to false, the stack will be rolled back. - name: enable termination protection during stack creation - cloudformation: + amazon.aws.cloudformation: stack_name: my_stack state: present template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template @@ -277,7 +277,7 @@ # In this case, if on_create_failure is set to "DELETE", it will clean up the stack if # it fails to create - name: create stack which will delete on creation failure - cloudformation: + amazon.aws.cloudformation: stack_name: my_stack state: present template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template diff --git a/plugins/modules/cloudformation_info.py b/plugins/modules/cloudformation_info.py index cd4faf2a0f9..a7d29f5135e 100644 --- a/plugins/modules/cloudformation_info.py +++ b/plugins/modules/cloudformation_info.py @@ -17,8 +17,8 @@ short_description: Obtain information about an AWS CloudFormation stack description: - Gets information about an AWS CloudFormation stack. - - This module was called C(cloudformation_facts) before Ansible 2.9, returning C(ansible_facts). - Note that the M(cloudformation_info) module no longer returns C(ansible_facts)! + - This module was called C(amazon.aws.cloudformation_facts) before Ansible 2.9, returning C(ansible_facts). + Note that the M(amazon.aws.cloudformation_info) module no longer returns C(ansible_facts)! requirements: - boto3 >= 1.0.0 - python >= 2.6 @@ -69,8 +69,8 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Get summary information about a stack -- cloudformation_info: +- name: Get summary information about a stack + amazon.aws.cloudformation_info: stack_name: my-cloudformation-stack register: output @@ -81,7 +81,7 @@ # in ansible_facts['cloudformation'][] and can be used as follows. # Note that this is deprecated and will stop working in Ansible 2.13. -- cloudformation_facts: +- amazon.aws.cloudformation_facts: stack_name: my-cloudformation-stack - debug: @@ -91,7 +91,7 @@ - set_fact: stack_name: my-awesome-stack -- cloudformation_info: +- amazon.aws.cloudformation_info: stack_name: "{{ stack_name }}" register: my_stack @@ -99,19 +99,19 @@ msg: "{{ my_stack.cloudformation[stack_name].stack_outputs }}" # Get all stack information about a stack -- cloudformation_info: +- amazon.aws.cloudformation_info: stack_name: my-cloudformation-stack all_facts: true # Get stack resource and stack policy information about a stack -- cloudformation_info: +- amazon.aws.cloudformation_info: stack_name: my-cloudformation-stack stack_resources: true stack_policy: true # Fail if the stack doesn't exist - name: try to get facts about a stack but fail if it doesn't exist - cloudformation_info: + amazon.aws.cloudformation_info: stack_name: nonexistent-stack all_facts: yes failed_when: cloudformation['nonexistent-stack'] is undefined diff --git a/plugins/modules/ec2.py b/plugins/modules/ec2.py index 650e0092854..80f921591c2 100644 --- a/plugins/modules/ec2.py +++ b/plugins/modules/ec2.py @@ -264,7 +264,7 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Basic provisioning example -- ec2: +- amazon.aws.ec2: key_name: mykey instance_type: t2.micro image: ami-123456 @@ -275,7 +275,7 @@ assign_public_ip: yes # Advanced example with tagging and CloudWatch -- ec2: +- amazon.aws.ec2: key_name: mykey group: databases instance_type: t2.micro @@ -290,7 +290,7 @@ assign_public_ip: yes # Single instance with additional IOPS volume from snapshot and volume delete on termination -- ec2: +- amazon.aws.ec2: key_name: mykey group: webserver instance_type: c3.medium @@ -309,7 +309,7 @@ assign_public_ip: yes # Single instance with ssd gp2 root volume -- ec2: +- amazon.aws.ec2: key_name: mykey group: webserver instance_type: c3.medium @@ -327,7 +327,7 @@ exact_count: 1 # Multiple groups example -- ec2: +- amazon.aws.ec2: key_name: mykey group: ['databases', 'internal-services', 'sshable', 'and-so-forth'] instance_type: m1.large @@ -342,7 +342,7 @@ assign_public_ip: yes # Multiple instances with additional volume from snapshot -- ec2: +- amazon.aws.ec2: key_name: mykey group: webserver instance_type: m1.large @@ -359,8 +359,7 @@ assign_public_ip: yes # Dedicated tenancy example -- local_action: - module: ec2 +- amazon.aws.ec2: assign_public_ip: yes group_id: sg-1dc53f72 key_name: mykey @@ -371,7 +370,7 @@ wait: yes # Spot instance example -- ec2: +- amazon.aws.ec2: spot_price: 0.24 spot_wait_timeout: 600 keypair: mykey @@ -385,13 +384,13 @@ instance_initiated_shutdown_behavior: terminate # Examples using pre-existing network interfaces -- ec2: +- amazon.aws.ec2: key_name: mykey instance_type: t2.small image: ami-f005ba11 network_interface: eni-deadbeef -- ec2: +- amazon.aws.ec2: key_name: mykey instance_type: t2.small image: ami-f005ba11 @@ -411,7 +410,7 @@ region: us-east-1 tasks: - name: Launch instance - ec2: + amazon.aws.ec2: key_name: "{{ keypair }}" group: "{{ security_group }}" instance_type: "{{ instance_type }}" @@ -447,7 +446,7 @@ hosts: localhost tasks: - name: Terminate instances that were previously launched - ec2: + amazon.aws.ec2: state: 'absent' instance_ids: '{{ ec2.instance_ids }}' @@ -465,7 +464,7 @@ region: us-east-1 tasks: - name: Start the sandbox instances - ec2: + amazon.aws.ec2: instance_ids: '{{ instance_ids }}' region: '{{ region }}' state: running @@ -487,7 +486,7 @@ region: us-east-1 tasks: - name: Stop the sandbox instances - ec2: + amazon.aws.ec2: instance_ids: '{{ instance_ids }}' region: '{{ region }}' state: stopped @@ -498,8 +497,7 @@ # # Start stopped instances specified by tag # -- local_action: - module: ec2 +- amazon.aws.ec2: instance_tags: Name: ExtraPower state: running @@ -507,8 +505,7 @@ # # Restart instances specified by tag # -- local_action: - module: ec2 +- amazon.aws.ec2: instance_tags: Name: ExtraPower state: restarted @@ -518,7 +515,7 @@ # (Highly recommended!) # -- ec2: +- amazon.aws.ec2: key_name: mykey instance_type: c1.medium image: ami-40603AD1 @@ -535,7 +532,7 @@ # Enforce that 5 running instances named "database" with a "dbtype" of "postgres" # -- ec2: +- amazon.aws.ec2: key_name: mykey instance_type: c1.medium image: ami-40603AD1 @@ -556,23 +553,23 @@ # # instances with tag foo -- ec2: +- amazon.aws.ec2: count_tag: foo: # instances with tag foo=bar -- ec2: +- amazon.aws.ec2: count_tag: foo: bar # instances with tags foo=bar & baz -- ec2: +- amazon.aws.ec2: count_tag: foo: bar baz: # instances with tags foo & bar & baz=bang -- ec2: +- amazon.aws.ec2: count_tag: - foo - bar diff --git a/plugins/modules/ec2_ami.py b/plugins/modules/ec2_ami.py index eb6c02743f6..1a7a067daf1 100644 --- a/plugins/modules/ec2_ami.py +++ b/plugins/modules/ec2_ami.py @@ -160,8 +160,8 @@ EXAMPLES = ''' # Note: These examples do not set authentication details, see the AWS Guide for details. -# Basic AMI Creation -- ec2_ami: +- name: Basic AMI Creation + amazon.aws.ec2_ami: instance_id: i-xxxxxx wait: yes name: newtest @@ -169,14 +169,14 @@ Name: newtest Service: TestService -# Basic AMI Creation, without waiting -- ec2_ami: +- name: Basic AMI Creation, without waiting + amazon.aws.ec2_ami: instance_id: i-xxxxxx wait: no name: newtest -# AMI Registration from EBS Snapshot -- ec2_ami: +- name: AMI Registration from EBS Snapshot + amazon.aws.ec2_ami: name: newtest state: present architecture: x86_64 @@ -189,8 +189,8 @@ delete_on_termination: true volume_type: gp2 -# AMI Creation, with a custom root-device size and another EBS attached -- ec2_ami: +- name: AMI Creation, with a custom root-device size and another EBS attached + amazon.aws.ec2_ami: instance_id: i-xxxxxx name: newtest device_mapping: @@ -203,8 +203,8 @@ delete_on_termination: false volume_type: gp2 -# AMI Creation, excluding a volume attached at /dev/sdb -- ec2_ami: +- name: AMI Creation, excluding a volume attached at /dev/sdb + amazon.aws.ec2_ami: instance_id: i-xxxxxx name: newtest device_mapping: @@ -215,27 +215,27 @@ - device_name: /dev/sdb no_device: yes -# Deregister/Delete AMI (keep associated snapshots) -- ec2_ami: +- name: Deregister/Delete AMI (keep associated snapshots) + amazon.aws.ec2_ami: image_id: "{{ instance.image_id }}" delete_snapshot: False state: absent -# Deregister AMI (delete associated snapshots too) -- ec2_ami: +- name: Deregister AMI (delete associated snapshots too) + amazon.aws.ec2_ami: image_id: "{{ instance.image_id }}" delete_snapshot: True state: absent -# Update AMI Launch Permissions, making it public -- ec2_ami: +- name: Update AMI Launch Permissions, making it public + amazon.aws.ec2_ami: image_id: "{{ instance.image_id }}" state: present launch_permissions: group_names: ['all'] -# Allow AMI to be launched by another account -- ec2_ami: +- name: Allow AMI to be launched by another account + amazon.aws.ec2_ami: image_id: "{{ instance.image_id }}" state: present launch_permissions: diff --git a/plugins/modules/ec2_ami_info.py b/plugins/modules/ec2_ami_info.py index 420935d7651..ceb909d3e9b 100644 --- a/plugins/modules/ec2_ami_info.py +++ b/plugins/modules/ec2_ami_info.py @@ -16,7 +16,7 @@ short_description: Gather information about ec2 AMIs description: - Gather information about ec2 AMIs - - This module was called C(ec2_ami_facts) before Ansible 2.9. The usage did not change. + - This module was called C(amazon.aws.ec2_ami_facts) before Ansible 2.9. The usage did not change. author: - Prasad Katti (@prasadkatti) requirements: [ boto3 ] @@ -61,21 +61,21 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. - name: gather information about an AMI using ami-id - ec2_ami_info: + amazon.aws.ec2_ami_info: image_ids: ami-5b488823 - name: gather information about all AMIs with tag key Name and value webapp - ec2_ami_info: + amazon.aws.ec2_ami_info: filters: "tag:Name": webapp - name: gather information about an AMI with 'AMI Name' equal to foobar - ec2_ami_info: + amazon.aws.ec2_ami_info: filters: name: foobar - name: gather information about Ubuntu 17.04 AMIs published by Canonical (099720109477) - ec2_ami_info: + amazon.aws.ec2_ami_info: owners: 099720109477 filters: name: "ubuntu/images/ubuntu-zesty-17.04-*" diff --git a/plugins/modules/ec2_elb_lb.py b/plugins/modules/ec2_elb_lb.py index 43ff670da29..6ac6ff56a75 100644 --- a/plugins/modules/ec2_elb_lb.py +++ b/plugins/modules/ec2_elb_lb.py @@ -143,8 +143,7 @@ # Basic provisioning example (non-VPC) -- local_action: - module: ec2_elb_lb +- amazon.aws.ec2_elb_lb: name: "test-please-delete" state: present zones: @@ -164,8 +163,7 @@ # Internal ELB example -- local_action: - module: ec2_elb_lb +- amazon.aws.ec2_elb_lb: name: "test-vpc" scheme: internal state: present @@ -181,8 +179,7 @@ instance_port: 80 # Configure a health check and the access logs -- local_action: - module: ec2_elb_lb +- amazon.aws.ec2_elb_lb: name: "test-please-delete" state: present zones: @@ -205,21 +202,18 @@ s3_prefix: "logs" # Ensure ELB is gone -- local_action: - module: ec2_elb_lb +- amazon.aws.ec2_elb_lb: name: "test-please-delete" state: absent # Ensure ELB is gone and wait for check (for default timeout) -- local_action: - module: ec2_elb_lb +- amazon.aws.ec2_elb_lb: name: "test-please-delete" state: absent wait: yes # Ensure ELB is gone and wait for check with timeout value -- local_action: - module: ec2_elb_lb +- amazon.aws.ec2_elb_lb: name: "test-please-delete" state: absent wait: yes @@ -228,8 +222,7 @@ # Normally, this module will purge any listeners that exist on the ELB # but aren't specified in the listeners parameter. If purge_listeners is # false it leaves them alone -- local_action: - module: ec2_elb_lb +- amazon.aws.ec2_elb_lb: name: "test-please-delete" state: present zones: @@ -244,8 +237,7 @@ # Normally, this module will leave availability zones that are enabled # on the ELB alone. If purge_zones is true, then any extraneous zones # will be removed -- local_action: - module: ec2_elb_lb +- amazon.aws.ec2_elb_lb: name: "test-please-delete" state: present zones: @@ -258,8 +250,7 @@ purge_zones: yes # Creates a ELB and assigns a list of subnets to it. -- local_action: - module: ec2_elb_lb +- amazon.aws.ec2_elb_lb: state: present name: 'New ELB' security_group_ids: 'sg-123456, sg-67890' @@ -273,8 +264,7 @@ # Create an ELB with connection draining, increased idle timeout and cross availability # zone load balancing -- local_action: - module: ec2_elb_lb +- amazon.aws.ec2_elb_lb: name: "New ELB" state: present connection_draining_timeout: 60 @@ -290,8 +280,7 @@ instance_port: 80 # Create an ELB with load balancer stickiness enabled -- local_action: - module: ec2_elb_lb +- amazon.aws.ec2_elb_lb: name: "New ELB" state: present region: us-east-1 @@ -308,8 +297,7 @@ expiration: 300 # Create an ELB with application stickiness enabled -- local_action: - module: ec2_elb_lb +- amazon.aws.ec2_elb_lb: name: "New ELB" state: present region: us-east-1 @@ -326,8 +314,7 @@ cookie: SESSIONID # Create an ELB and add tags -- local_action: - module: ec2_elb_lb +- amazon.aws.ec2_elb_lb: name: "New ELB" state: present region: us-east-1 @@ -344,8 +331,7 @@ client: "Bob" # Delete all tags from an ELB -- local_action: - module: ec2_elb_lb +- amazon.aws.ec2_elb_lb: name: "New ELB" state: present region: us-east-1 diff --git a/plugins/modules/ec2_eni.py b/plugins/modules/ec2_eni.py index ec494a15faa..7774ded5d2f 100644 --- a/plugins/modules/ec2_eni.py +++ b/plugins/modules/ec2_eni.py @@ -120,13 +120,13 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Create an ENI. As no security group is defined, ENI will be created in default security group -- ec2_eni: +- amazon.aws.ec2_eni: private_ip_address: 172.31.0.20 subnet_id: subnet-xxxxxxxx state: present # Create an ENI and attach it to an instance -- ec2_eni: +- amazon.aws.ec2_eni: instance_id: i-xxxxxxx device_index: 1 private_ip_address: 172.31.0.20 @@ -134,14 +134,14 @@ state: present # Create an ENI with two secondary addresses -- ec2_eni: +- amazon.aws.ec2_eni: subnet_id: subnet-xxxxxxxx state: present secondary_private_ip_address_count: 2 # Assign a secondary IP address to an existing ENI # This will purge any existing IPs -- ec2_eni: +- amazon.aws.ec2_eni: subnet_id: subnet-xxxxxxxx eni_id: eni-yyyyyyyy state: present @@ -149,39 +149,39 @@ - 172.16.1.1 # Remove any secondary IP addresses from an existing ENI -- ec2_eni: +- amazon.aws.ec2_eni: subnet_id: subnet-xxxxxxxx eni_id: eni-yyyyyyyy state: present secondary_private_ip_address_count: 0 # Destroy an ENI, detaching it from any instance if necessary -- ec2_eni: +- amazon.aws.ec2_eni: eni_id: eni-xxxxxxx force_detach: true state: absent # Update an ENI -- ec2_eni: +- amazon.aws.ec2_eni: eni_id: eni-xxxxxxx description: "My new description" state: present # Update an ENI identifying it by private_ip_address and subnet_id -- ec2_eni: +- amazon.aws.ec2_eni: subnet_id: subnet-xxxxxxx private_ip_address: 172.16.1.1 description: "My new description" # Detach an ENI from an instance -- ec2_eni: +- amazon.aws.ec2_eni: eni_id: eni-xxxxxxx instance_id: None state: present ### Delete an interface on termination # First create the interface -- ec2_eni: +- amazon.aws.ec2_eni: instance_id: i-xxxxxxx device_index: 1 private_ip_address: 172.31.0.20 @@ -190,7 +190,7 @@ register: eni # Modify the interface to enable the delete_on_terminaton flag -- ec2_eni: +- amazon.aws.ec2_eni: eni_id: "{{ eni.interface.id }}" delete_on_termination: true diff --git a/plugins/modules/ec2_eni_info.py b/plugins/modules/ec2_eni_info.py index 1dbebae7ad6..16784bc0728 100644 --- a/plugins/modules/ec2_eni_info.py +++ b/plugins/modules/ec2_eni_info.py @@ -35,10 +35,10 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all ENIs -- ec2_eni_info: +- amazon.aws.ec2_eni_info: # Gather information about a particular ENI -- ec2_eni_info: +- amazon.aws.ec2_eni_info: filters: network-interface-id: eni-xxxxxxx diff --git a/plugins/modules/ec2_group.py b/plugins/modules/ec2_group.py index 1a35bc478e8..8bb90eb0fae 100644 --- a/plugins/modules/ec2_group.py +++ b/plugins/modules/ec2_group.py @@ -216,7 +216,7 @@ EXAMPLES = ''' - name: example using security group rule descriptions - ec2_group: + amazon.aws.ec2_group: name: "{{ name }}" description: sg with rule descriptions vpc_id: vpc-xxxxxxxx @@ -230,7 +230,7 @@ rule_desc: allow all on port 80 - name: example ec2 group - ec2_group: + amazon.aws.ec2_group: name: example description: an example EC2 group vpc_id: 12345 @@ -289,7 +289,7 @@ group_desc: other example EC2 group - name: example2 ec2 group - ec2_group: + amazon.aws.ec2_group: name: example2 description: an example2 EC2 group vpc_id: 12345 @@ -327,7 +327,7 @@ diff: True - name: "Delete group by its id" - ec2_group: + amazon.aws.ec2_group: region: eu-west-1 group_id: sg-33b4ee5b state: absent diff --git a/plugins/modules/ec2_group_info.py b/plugins/modules/ec2_group_info.py index e2d84d2774e..b10504270ec 100644 --- a/plugins/modules/ec2_group_info.py +++ b/plugins/modules/ec2_group_info.py @@ -17,7 +17,7 @@ short_description: Gather information about ec2 security groups in AWS. description: - Gather information about ec2 security groups in AWS. - - This module was called C(ec2_group_facts) before Ansible 2.9. The usage did not change. + - This module was called C(amazon.aws.ec2_group_facts) before Ansible 2.9. The usage did not change. requirements: [ boto3 ] author: - Henrique Rodrigues (@Sodki) @@ -44,36 +44,36 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all security groups -- ec2_group_info: +- amazon.aws.ec2_group_info: # Gather information about all security groups in a specific VPC -- ec2_group_info: +- amazon.aws.ec2_group_info: filters: vpc-id: vpc-12345678 # Gather information about all security groups in a specific VPC -- ec2_group_info: +- amazon.aws.ec2_group_info: filters: vpc-id: vpc-12345678 # Gather information about a security group -- ec2_group_info: +- amazon.aws.ec2_group_info: filters: group-name: example-1 # Gather information about a security group by id -- ec2_group_info: +- amazon.aws.ec2_group_info: filters: group-id: sg-12345678 # Gather information about a security group with multiple filters, also mixing the use of underscores as filter keys -- ec2_group_info: +- amazon.aws.ec2_group_info: filters: group_id: sg-12345678 vpc-id: vpc-12345678 # Gather information about various security groups -- ec2_group_info: +- amazon.aws.ec2_group_info: filters: group-name: - example-1 @@ -82,7 +82,7 @@ # Gather information about any security group with a tag key Name and value Example. # The quotes around 'tag:name' are important because of the colon in the value -- ec2_group_info: +- amazon.aws.ec2_group_info: filters: "tag:Name": Example ''' diff --git a/plugins/modules/ec2_key.py b/plugins/modules/ec2_key.py index b6d37d323b0..6e007d2acb0 100644 --- a/plugins/modules/ec2_key.py +++ b/plugins/modules/ec2_key.py @@ -66,29 +66,29 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. - name: create a new ec2 key pair, returns generated private key - ec2_key: + amazon.aws.ec2_key: name: my_keypair - name: create key pair using provided key_material - ec2_key: + amazon.aws.ec2_key: name: my_keypair key_material: 'ssh-rsa AAAAxyz...== me@example.com' - name: create key pair using key_material obtained using 'file' lookup plugin - ec2_key: + amazon.aws.ec2_key: name: my_keypair key_material: "{{ lookup('file', '/path/to/public_key/id_rsa.pub') }}" # try creating a key pair with the name of an already existing keypair # but don't overwrite it even if the key is different (force=false) - name: try creating a key pair with name of an already existing keypair - ec2_key: + amazon.aws.ec2_key: name: my_existing_keypair key_material: 'ssh-rsa AAAAxyz...== me@example.com' force: false - name: remove key pair by name - ec2_key: + amazon.aws.ec2_key: name: my_keypair state: absent ''' diff --git a/plugins/modules/ec2_metadata_facts.py b/plugins/modules/ec2_metadata_facts.py index 5690e559037..dc72184e729 100644 --- a/plugins/modules/ec2_metadata_facts.py +++ b/plugins/modules/ec2_metadata_facts.py @@ -29,7 +29,7 @@ EXAMPLES = ''' # Gather EC2 metadata facts -- ec2_metadata_facts: +- amazon.aws.ec2_metadata_facts: - debug: msg: "This instance is a t1.micro" diff --git a/plugins/modules/ec2_snapshot.py b/plugins/modules/ec2_snapshot.py index d8ac982dca2..c9702762111 100644 --- a/plugins/modules/ec2_snapshot.py +++ b/plugins/modules/ec2_snapshot.py @@ -84,18 +84,18 @@ EXAMPLES = ''' # Simple snapshot of volume using volume_id -- ec2_snapshot: +- amazon.aws.ec2_snapshot: volume_id: vol-abcdef12 description: snapshot of /data from DB123 taken 2013/11/28 12:18:32 # Snapshot of volume mounted on device_name attached to instance_id -- ec2_snapshot: +- amazon.aws.ec2_snapshot: instance_id: i-12345678 device_name: /dev/sdb1 description: snapshot of /data from DB123 taken 2013/11/28 12:18:32 # Snapshot of volume with tagging -- ec2_snapshot: +- amazon.aws.ec2_snapshot: instance_id: i-12345678 device_name: /dev/sdb1 snapshot_tags: @@ -103,14 +103,12 @@ source: /data # Remove a snapshot -- local_action: - module: ec2_snapshot +- amazon.aws.ec2_snapshot: snapshot_id: snap-abcd1234 state: absent # Create a snapshot only if the most recent one is older than 1 hour -- local_action: - module: ec2_snapshot +- amazon.aws.ec2_snapshot: volume_id: vol-abcdef12 last_snapshot_min_age: 60 ''' diff --git a/plugins/modules/ec2_snapshot_info.py b/plugins/modules/ec2_snapshot_info.py index b89c3668b94..935f5eda95b 100644 --- a/plugins/modules/ec2_snapshot_info.py +++ b/plugins/modules/ec2_snapshot_info.py @@ -66,35 +66,35 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all snapshots, including public ones -- ec2_snapshot_info: +- amazon.aws.ec2_snapshot_info: # Gather information about all snapshots owned by the account 0123456789 -- ec2_snapshot_info: +- amazon.aws.ec2_snapshot_info: filters: owner-id: 0123456789 # Or alternatively... -- ec2_snapshot_info: +- amazon.aws.ec2_snapshot_info: owner_ids: - 0123456789 # Gather information about a particular snapshot using ID -- ec2_snapshot_info: +- amazon.aws.ec2_snapshot_info: filters: snapshot-id: snap-00112233 # Or alternatively... -- ec2_snapshot_info: +- amazon.aws.ec2_snapshot_info: snapshot_ids: - snap-00112233 # Gather information about any snapshot with a tag key Name and value Example -- ec2_snapshot_info: +- amazon.aws.ec2_snapshot_info: filters: "tag:Name": Example # Gather information about any snapshot with an error status -- ec2_snapshot_info: +- amazon.aws.ec2_snapshot_info: filters: status: error diff --git a/plugins/modules/ec2_tag.py b/plugins/modules/ec2_tag.py index 146955f782d..efff54e24fc 100644 --- a/plugins/modules/ec2_tag.py +++ b/plugins/modules/ec2_tag.py @@ -59,7 +59,7 @@ EXAMPLES = ''' - name: Ensure tags are present on a resource - ec2_tag: + amazon.aws.ec2_tag: region: eu-west-1 resource: vol-XXXXXX state: present @@ -68,7 +68,7 @@ env: prod - name: Ensure all volumes are tagged - ec2_tag: + amazon.aws.ec2_tag: region: eu-west-1 resource: '{{ item.id }}' state: present @@ -78,7 +78,7 @@ loop: '{{ ec2_vol.volumes }}' - name: Remove the Env tag - ec2_tag: + amazon.aws.ec2_tag: region: eu-west-1 resource: i-xxxxxxxxxxxxxxxxx tags: @@ -86,7 +86,7 @@ state: absent - name: Remove the Env tag if it's currently 'development' - ec2_tag: + amazon.aws.ec2_tag: region: eu-west-1 resource: i-xxxxxxxxxxxxxxxxx tags: @@ -94,7 +94,7 @@ state: absent - name: Remove all tags except for Name from an instance - ec2_tag: + amazon.aws.ec2_tag: region: eu-west-1 resource: i-xxxxxxxxxxxxxxxxx tags: diff --git a/plugins/modules/ec2_tag_info.py b/plugins/modules/ec2_tag_info.py index 4d1d0a47c6e..e5c1ff79aef 100644 --- a/plugins/modules/ec2_tag_info.py +++ b/plugins/modules/ec2_tag_info.py @@ -37,13 +37,13 @@ EXAMPLES = ''' - name: Retrieve all tags on an instance - ec2_tag_info: + amazon.aws.ec2_tag_info: region: eu-west-1 resource: i-xxxxxxxxxxxxxxxxx register: instance_tags - name: Retrieve all tags on a VPC - ec2_tag_info: + amazon.aws.ec2_tag_info: region: eu-west-1 resource: vpc-xxxxxxxxxxxxxxxxx register: vpc_tags diff --git a/plugins/modules/ec2_vol.py b/plugins/modules/ec2_vol.py index faad6182bd4..1771d5d165b 100644 --- a/plugins/modules/ec2_vol.py +++ b/plugins/modules/ec2_vol.py @@ -100,31 +100,31 @@ EXAMPLES = ''' # Simple attachment action -- ec2_vol: +- amazon.aws.ec2_vol: instance: XXXXXX volume_size: 5 device_name: sdd # Example using custom iops params -- ec2_vol: +- amazon.aws.ec2_vol: instance: XXXXXX volume_size: 5 iops: 100 device_name: sdd # Example using snapshot id -- ec2_vol: +- amazon.aws.ec2_vol: instance: XXXXXX snapshot: "{{ snapshot }}" # Playbook example combined with instance launch -- ec2: +- amazon.aws.ec2: keypair: "{{ keypair }}" image: "{{ image }}" wait: yes count: 3 register: ec2 -- ec2_vol: +- amazon.aws.ec2_vol: instance: "{{ item.id }}" volume_size: 5 loop: "{{ ec2.instances }}" @@ -135,7 +135,7 @@ # * Nothing will happen if the volume is already attached. # * Requires Ansible 2.0 -- ec2: +- amazon.aws.ec2: keypair: "{{ keypair }}" image: "{{ image }}" zone: YYYYYY @@ -144,7 +144,7 @@ count: 1 register: ec2 -- ec2_vol: +- amazon.aws.ec2_vol: instance: "{{ item.id }}" name: my_existing_volume_Name_tag device_name: /dev/xvdf @@ -152,29 +152,29 @@ register: ec2_vol # Remove a volume -- ec2_vol: +- amazon.aws.ec2_vol: id: vol-XXXXXXXX state: absent # Detach a volume (since 1.9) -- ec2_vol: +- amazon.aws.ec2_vol: id: vol-XXXXXXXX instance: None # List volumes for an instance -- ec2_vol: +- amazon.aws.ec2_vol: instance: i-XXXXXX state: list # Create new volume using SSD storage -- ec2_vol: +- amazon.aws.ec2_vol: instance: XXXXXX volume_size: 50 volume_type: gp2 device_name: /dev/xvdf # Attach an existing volume to instance. The volume will be deleted upon instance termination. -- ec2_vol: +- amazon.aws.ec2_vol: instance: XXXXXX id: XXXXXX device_name: /dev/sdf diff --git a/plugins/modules/ec2_vol_info.py b/plugins/modules/ec2_vol_info.py index 749950846a7..e945cd69b09 100644 --- a/plugins/modules/ec2_vol_info.py +++ b/plugins/modules/ec2_vol_info.py @@ -36,20 +36,20 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all volumes -- ec2_vol_info: +- amazon.aws.ec2_vol_info: # Gather information about a particular volume using volume ID -- ec2_vol_info: +- amazon.aws.ec2_vol_info: filters: volume-id: vol-00112233 # Gather information about any volume with a tag key Name and value Example -- ec2_vol_info: +- amazon.aws.ec2_vol_info: filters: "tag:Name": Example # Gather information about any volume that is attached -- ec2_vol_info: +- amazon.aws.ec2_vol_info: filters: attachment.status: attached diff --git a/plugins/modules/ec2_vpc_dhcp_option.py b/plugins/modules/ec2_vpc_dhcp_option.py index a2843dd6455..77210c34c24 100644 --- a/plugins/modules/ec2_vpc_dhcp_option.py +++ b/plugins/modules/ec2_vpc_dhcp_option.py @@ -134,7 +134,7 @@ EXAMPLES = """ # Completely overrides the VPC DHCP options associated with VPC vpc-123456 and deletes any existing # DHCP option set that may have been attached to that VPC. -- ec2_vpc_dhcp_option: +- amazon.aws.ec2_vpc_dhcp_option: domain_name: "foo.example.com" region: us-east-1 dns_servers: @@ -154,7 +154,7 @@ # Ensure the DHCP option set for the VPC has 10.0.0.4 and 10.0.1.4 as the specified DNS servers, but # keep any other existing settings. Also, keep the old DHCP option set around. -- ec2_vpc_dhcp_option: +- amazon.aws.ec2_vpc_dhcp_option: region: us-east-1 dns_servers: - "{{groups['dns-primary']}}" @@ -166,7 +166,7 @@ ## Create a DHCP option set with 4.4.4.4 and 8.8.8.8 as the specified DNS servers, with tags ## but do not assign to a VPC -- ec2_vpc_dhcp_option: +- amazon.aws.ec2_vpc_dhcp_option: region: us-east-1 dns_servers: - 4.4.4.4 @@ -176,7 +176,7 @@ Environment: Test ## Delete a DHCP options set that matches the tags and options specified -- ec2_vpc_dhcp_option: +- amazon.aws.ec2_vpc_dhcp_option: region: us-east-1 dns_servers: - 4.4.4.4 @@ -187,7 +187,7 @@ state: absent ## Associate a DHCP options set with a VPC by ID -- ec2_vpc_dhcp_option: +- amazon.aws.ec2_vpc_dhcp_option: region: us-east-1 dhcp_options_id: dopt-12345678 vpc_id: vpc-123456 diff --git a/plugins/modules/ec2_vpc_dhcp_option_info.py b/plugins/modules/ec2_vpc_dhcp_option_info.py index e9d55901c30..d8fb7ddac4e 100644 --- a/plugins/modules/ec2_vpc_dhcp_option_info.py +++ b/plugins/modules/ec2_vpc_dhcp_option_info.py @@ -48,13 +48,13 @@ # # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Gather information about all DHCP Option sets for an account or profile - ec2_vpc_dhcp_option_info: + amazon.aws.ec2_vpc_dhcp_option_info: region: ap-southeast-2 profile: production register: dhcp_info - name: Gather information about a filtered list of DHCP Option sets - ec2_vpc_dhcp_option_info: + amazon.aws.ec2_vpc_dhcp_option_info: region: ap-southeast-2 profile: production filters: @@ -62,7 +62,7 @@ register: dhcp_info - name: Gather information about a specific DHCP Option set by DhcpOptionId - ec2_vpc_dhcp_option_info: + amazon.aws.ec2_vpc_dhcp_option_info: region: ap-southeast-2 profile: production DhcpOptionsIds: dopt-123fece2 diff --git a/plugins/modules/ec2_vpc_net.py b/plugins/modules/ec2_vpc_net.py index 7c888137ea4..54871e0d901 100644 --- a/plugins/modules/ec2_vpc_net.py +++ b/plugins/modules/ec2_vpc_net.py @@ -95,7 +95,7 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. - name: create a VPC with dedicated tenancy and a couple of tags - ec2_vpc_net: + amazon.aws.ec2_vpc_net: name: Module_dev2 cidr_block: 10.10.0.0/16 region: us-east-1 @@ -105,7 +105,7 @@ tenancy: dedicated - name: create a VPC with dedicated tenancy and request an IPv6 CIDR - ec2_vpc_net: + amazon.aws.ec2_vpc_net: name: Module_dev2 cidr_block: 10.10.0.0/16 ipv6_cidr: True diff --git a/plugins/modules/ec2_vpc_net_info.py b/plugins/modules/ec2_vpc_net_info.py index 507f36db300..84bb3642b97 100644 --- a/plugins/modules/ec2_vpc_net_info.py +++ b/plugins/modules/ec2_vpc_net_info.py @@ -42,14 +42,14 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all VPCs -- ec2_vpc_net_info: +- amazon.aws.ec2_vpc_net_info: # Gather information about a particular VPC using VPC ID -- ec2_vpc_net_info: +- amazon.aws.ec2_vpc_net_info: vpc_ids: vpc-00112233 # Gather information about any VPC with a tag key Name and value Example -- ec2_vpc_net_info: +- amazon.aws.ec2_vpc_net_info: filters: "tag:Name": Example diff --git a/plugins/modules/ec2_vpc_subnet.py b/plugins/modules/ec2_vpc_subnet.py index e5a5ccc57ef..3ebdc2b91b8 100644 --- a/plugins/modules/ec2_vpc_subnet.py +++ b/plugins/modules/ec2_vpc_subnet.py @@ -87,7 +87,7 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. - name: Create subnet for database servers - ec2_vpc_subnet: + amazon.aws.ec2_vpc_subnet: state: present vpc_id: vpc-123456 cidr: 10.0.1.16/28 @@ -96,20 +96,20 @@ register: database_subnet - name: Remove subnet for database servers - ec2_vpc_subnet: + amazon.aws.ec2_vpc_subnet: state: absent vpc_id: vpc-123456 cidr: 10.0.1.16/28 - name: Create subnet with IPv6 block assigned - ec2_vpc_subnet: + amazon.aws.ec2_vpc_subnet: state: present vpc_id: vpc-123456 cidr: 10.1.100.0/24 ipv6_cidr: 2001:db8:0:102::/64 - name: Remove IPv6 block assigned to subnet - ec2_vpc_subnet: + amazon.aws.ec2_vpc_subnet: state: present vpc_id: vpc-123456 cidr: 10.1.100.0/24 diff --git a/plugins/modules/ec2_vpc_subnet_info.py b/plugins/modules/ec2_vpc_subnet_info.py index 64b8da3cd13..3596966e4a9 100644 --- a/plugins/modules/ec2_vpc_subnet_info.py +++ b/plugins/modules/ec2_vpc_subnet_info.py @@ -43,19 +43,19 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Gather information about all VPC subnets -- ec2_vpc_subnet_info: +- amazon.aws.ec2_vpc_subnet_info: # Gather information about a particular VPC subnet using ID -- ec2_vpc_subnet_info: +- amazon.aws.ec2_vpc_subnet_info: subnet_ids: subnet-00112233 # Gather information about any VPC subnet with a tag key Name and value Example -- ec2_vpc_subnet_info: +- amazon.aws.ec2_vpc_subnet_info: filters: "tag:Name": Example # Gather information about any VPC subnet within VPC with ID vpc-abcdef00 -- ec2_vpc_subnet_info: +- amazon.aws.ec2_vpc_subnet_info: filters: vpc-id: vpc-abcdef00 @@ -63,7 +63,7 @@ # VPC with ID vpc-abcdef00 and then use the jinja map function to return the # subnet_ids as a list. -- ec2_vpc_subnet_info: +- amazon.aws.ec2_vpc_subnet_info: filters: vpc-id: vpc-abcdef00 "tag:Name": "{{ item }}" diff --git a/plugins/modules/s3_bucket.py b/plugins/modules/s3_bucket.py index 5e75ddf888a..c56656657c0 100644 --- a/plugins/modules/s3_bucket.py +++ b/plugins/modules/s3_bucket.py @@ -108,24 +108,24 @@ # Note: These examples do not set authentication details, see the AWS Guide for details. # Create a simple s3 bucket -- s3_bucket: +- amazon.aws.s3_bucket: name: mys3bucket state: present # Create a simple s3 bucket on Ceph Rados Gateway -- s3_bucket: +- amazon.aws.s3_bucket: name: mys3bucket s3_url: http://your-ceph-rados-gateway-server.xxx ceph: true # Remove an s3 bucket and any keys it contains -- s3_bucket: +- amazon.aws.s3_bucket: name: mys3bucket state: absent force: yes # Create a bucket, add a policy from a file, enable requester pays, enable versioning and tag -- s3_bucket: +- amazon.aws.s3_bucket: name: mys3bucket policy: "{{ lookup('file','policy.json') }}" requester_pays: yes @@ -135,25 +135,25 @@ another: tag2 # Create a simple DigitalOcean Spaces bucket using their provided regional endpoint -- s3_bucket: +- amazon.aws.s3_bucket: name: mydobucket s3_url: 'https://nyc3.digitaloceanspaces.com' # Create a bucket with AES256 encryption -- s3_bucket: +- amazon.aws.s3_bucket: name: mys3bucket state: present encryption: "AES256" # Create a bucket with aws:kms encryption, KMS key -- s3_bucket: +- amazon.aws.s3_bucket: name: mys3bucket state: present encryption: "aws:kms" encryption_key_id: "arn:aws:kms:us-east-1:1234/5678example" # Create a bucket with aws:kms encryption, default key -- s3_bucket: +- amazon.aws.s3_bucket: name: mys3bucket state: present encryption: "aws:kms"