some ansible variables

  • ec2_facts
# These are the instance local ec2_facts keys.
"ansible_facts"
  "ansible_ec2_ami_id"
  "ansible_ec2_ami_launch_index"
  "ansible_ec2_ami_manifest_path"
  "ansible_ec2_block_device_mapping_ami"
  "ansible_ec2_block_device_mapping_ephemeral0"
  "ansible_ec2_block_device_mapping_ephemeral1"
  "ansible_ec2_block_device_mapping_root"
  "ansible_ec2_hostname"
  "ansible_ec2_iam_info"
  "ansible_ec2_iam_security_credentials_demo_etcd_role"
  "ansible_ec2_instance_action"
  "ansible_ec2_instance_id"
  "ansible_ec2_instance_type"
  "ansible_ec2_local_hostname"
  "ansible_ec2_local_ipv4"
  "ansible_ec2_mac"
  "ansible_ec2_metrics_vhostmd"
  "ansible_ec2_network_interfaces_macs_12_20_32_7f_db_7a_device_number"
  "ansible_ec2_network_interfaces_macs_12_20_32_7f_db_7a_interface_id"
  "ansible_ec2_network_interfaces_macs_12_20_32_7f_db_7a_local_hostname"
  "ansible_ec2_network_interfaces_macs_12_20_32_7f_db_7a_local_ipv4s"
  "ansible_ec2_network_interfaces_macs_12_20_32_7f_db_7a_mac"
  "ansible_ec2_network_interfaces_macs_12_20_32_7f_db_7a_owner_id"
  "ansible_ec2_network_interfaces_macs_12_20_32_7f_db_7a_security_group_ids"
  "ansible_ec2_network_interfaces_macs_12_20_32_7f_db_7a_security_groups"
  "ansible_ec2_network_interfaces_macs_12_20_32_7f_db_7a_subnet_id"
  "ansible_ec2_network_interfaces_macs_12_20_32_7f_db_7a_subnet_ipv4_cidr_block"
  "ansible_ec2_network_interfaces_macs_12_20_32_7f_db_7a_vpc_id"
  "ansible_ec2_network_interfaces_macs_12_20_32_7f_db_7a_vpc_ipv4_cidr_block"
  "ansible_ec2_network_interfaces_macs_12_20_32_7f_db_7a_vpc_ipv4_cidr_blocks"
  "ansible_ec2_placement_availability_zone"
  "ansible_ec2_placement_region"
  "ansible_ec2_profile"
  "ansible_ec2_public_key"
  "ansible_ec2_reservation_id"
  "ansible_ec2_security_groups"
  "ansible_ec2_services_domain"
  "ansible_ec2_services_partition"
  "ansible_ec2_user_data"
  • ec2_remote_facts
# These are the ec2_remote_facts keys.
"instances"
        "ami_launch_index"
        "architecture"
        "block_device_mapping"
                "attach_time"
                "delete_on_termination"
                "device_name"
                "status"
                "volume_id"
        "client_token"
        "ebs_optimized"
        "groups"
                "id"
                "name"
        "hypervisor"
        "id"
        "image_id"
        "instance_profile"
            "arn"
            "id"
        "interfaces"
                "id"
                "mac_address"
        "kernel"
        "key_name"
        "launch_time"
        "monitoring_state"
        "persistent"
        "placement"
            "tenancy"
            "zone"
        "private_dns_name"
        "private_ip_address"
        "public_dns_name"
        "public_ip_address"
        "ramdisk"
        "region"
        "requester_id"
        "root_device_type"
        "source_destination_check"
        "spot_instance_request_id"
        "state"
        "tags"
            "Environment"
            "Name"
            "Role"
            "sshUser"
            "terraform_id"
        "virtualization_type"
        "vpc_id"
        "ami_launch_index"
        "architecture"
        "block_device_mapping"
                "attach_time"
                "delete_on_termination"
                "device_name"
                "status"
                "volume_id"
        "client_token"
        "ebs_optimized"
        "groups"
                "id"
                "name"
        "hypervisor"
        "id"
        "image_id"
        "instance_profile"
            "arn"
            "id"
        "interfaces"
                "id"
                "mac_address"
        "kernel"
        "key_name"
        "launch_time"
        "monitoring_state"
        "persistent"
        "placement"
            "tenancy"
            "zone"
        "private_dns_name"
        "private_ip_address"
        "public_dns_name"
        "public_ip_address"
        "ramdisk"
        "region"
        "requester_id"
        "root_device_type"
        "source_destination_check"
        "spot_instance_request_id"
        "state"
        "tags"
            "Environment"
            "Name"
            "Role"
            "sshUser"
            "terraform_id"
        "virtualization_type"
        "vpc_id"
  • Get a variable from another hosts
"{{< hostvars['127.0.0.1']['ec2_remote_facts']['instances'] >}}"