Skip to content

Error when launching #4

Description

I get this error every time I run ./test-factor.sh. I believe it is to do with the line instance_id: “{{ hostvars[groups[ami_builder.group][0]].ec2_id }}” in build-finish.yml. Any help would be much appreciated.

./test-factor.sh
 [WARNING]: provided hosts list is empty, only localhost is available


PLAY [Launch EC2 instance] *****************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [launch : Launch EC2 instance(s)] *****************************************
changed: [localhost]

TASK [launch : Add new instance to host group] *********************************
changed: [localhost] => (item={u'kernel': None, u'root_device_type': u'ebs', u'private_dns_name': u'ip-10-0-0-8.us-west-2.compute.internal', u'public_ip': u'35.165.135.112', u'private_ip': u'10.0.0.8', u'id': u'i-091291f85e94c9a99', u'ebs_optimized': False, u'state': u'running', u'virtualization_type': u'hvm', u'root_device_name': u'/dev/sda1', u'ramdisk': None, u'block_device_mapping': {u'/dev/sda1': {u'status': u'attached', u'delete_on_termination': True, u'volume_id': u'vol-0ecb64135cfe3dd39'}}, u'key_name': u'faas', u'image_id': u'ami-5189a661', u'tenancy': u'default', u'groups': {u'sg-2ddb4255': u'faas'}, u'public_dns_name': u'ec2-35-165-135-112.us-west-2.compute.amazonaws.com', u'state_code': 16, u'tags': {u'launch_group': u'faas_ami_builder', u'Name': u'faas_ami_builder'}, u'placement': u'us-west-2a', u'ami_launch_index': u'0', u'dns_name': u'ec2-35-165-135-112.us-west-2.compute.amazonaws.com', u'region': u'us-west-2', u'launch_time': u'2017-02-07T00:56:01.000Z', u'instance_type': u'm4.large', u'architecture': u'x86_64', u'hypervisor': u'xen'})

TASK [launch : Wait for SSH to come up] ****************************************
ok: [localhost] => (item={u'kernel': None, u'root_device_type': u'ebs', u'private_dns_name': u'ip-10-0-0-8.us-west-2.compute.internal', u'public_ip': u'35.165.135.112', u'private_ip': u'10.0.0.8', u'id': u'i-091291f85e94c9a99', u'ebs_optimized': False, u'state': u'running', u'virtualization_type': u'hvm', u'root_device_name': u'/dev/sda1', u'ramdisk': None, u'block_device_mapping': {u'/dev/sda1': {u'status': u'attached', u'delete_on_termination': True, u'volume_id': u'vol-0ecb64135cfe3dd39'}}, u'key_name': u'faas', u'image_id': u'ami-5189a661', u'tenancy': u'default', u'groups': {u'sg-2ddb4255': u'faas'}, u'public_dns_name': u'ec2-35-165-135-112.us-west-2.compute.amazonaws.com', u'state_code': 16, u'tags': {u'launch_group': u'faas_ami_builder', u'Name': u'faas_ami_builder'}, u'placement': u'us-west-2a', u'ami_launch_index': u'0', u'dns_name': u'ec2-35-165-135-112.us-west-2.compute.amazonaws.com', u'region': u'us-west-2', u'launch_time': u'2017-02-07T00:56:01.000Z', u'instance_type': u'm4.large', u'architecture': u'x86_64', u'hypervisor': u'xen'})

PLAY RECAP *********************************************************************
localhost                  : ok=4    changed=2    unreachable=0    failed=0   

 [WARNING]: provided hosts list is empty, only localhost is available

[DEPRECATION WARNING]: Instead of sudo/sudo_user, use become/become_user and 
make sure become_method is 'sudo' (default).
This feature will be removed in a 
future release. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.

PLAY RECAP *********************************************************************

 [WARNING]: provided hosts list is empty, only localhost is available


PLAY [Create AMI from running instance and terminate instance upon completion] *

TASK [setup] *******************************************************************
ok: [localhost]

TASK [Remove previous custom image (if it exists)] *****************************
ok: [localhost]

TASK [Create AMI from temporary instance] **************************************
fatal: [localhost]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'dict object' has no attribute u'tag_Name_faas_ami_builder'\n\nThe error appears to have been in '/Users/usr/faas/ec2/build-finish.yml': line 17, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n    - name: Create AMI from temporary instance\n      ^ here\n"}
	to retry, use: --limit @/Users/usr/faas/ec2/build-finish.retry

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=1   

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions