Skip to content

Commit

Permalink
trying new key method
Browse files Browse the repository at this point in the history
  • Loading branch information
IPvSean committed Mar 20, 2018
1 parent 8aac458 commit 9d3c06f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
15 changes: 13 additions & 2 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# FAQ
# FAQ for the Provisioner
Frequently Asked Questions... or rather common problems that people have hit.

## Problem: boto3 missing

```
fatal: [localhost]: FAILED! => {"attempts": 1, "changed": false, "msg": "Python modules \"botocore\" or \"boto3\" are missing, please install both"}
```
Expand Down Expand Up @@ -41,3 +41,14 @@ aws_secret_access_key = ABCDEFGHIJKLMNOP/ABCDEFGHIJKLMNOP
```
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ClientError: An error occurred (AuthFailure) when calling the DescribeImageAttribute operation: Not authorized for image:ami-26ebbc5c
```

Solution:
Install latest dev of Ansible (will lock down specific version after 2.5 launches)

```
pip install git+https://github.com/ansible/ansible.git@devel
```

Refer to direction for Ansible Installation: http://docs.ansible.com/ansible/latest/intro_installation.html

## Problem: TASK [connectivity_test : Wait 400 seconds, but only start checking after 30 seconds] ****************************************************
4 changes: 4 additions & 0 deletions provisioner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ networking: true
- [Setup (per workshop)](#setup-per-workshop)
- [Accessing student documentation and slides](#Accessing-student-documentation-and-slides)
- [AWS Teardown](#aws-teardown)
- [FAQ](../docs/faq.md)

# Requirements

Expand Down Expand Up @@ -121,3 +122,6 @@ To destroy all the EC2 instances after training is complete:
1. Run the playbook:

ansible-playbook teardown_lab.yml -e @extra_vars.yml -e @users.yml

# FAQ
For frequently asked questions see the [FAQ](../docs/faq.md)
13 changes: 9 additions & 4 deletions provisioner/roles/manage_ec2_instances/tasks/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,6 @@
- networking
- ec2_vpc_id2 is undefined

- name: enable ssh-agent
shell: eval $(ssh-agent)

- name: Create ssh key pair for workshop {{ ec2_name_prefix }}
ec2_key:
name: "{{ ec2_name_prefix }}-key"
Expand All @@ -201,9 +198,17 @@
mode: 0400
when: create_key.changed


### SSH TRICKERY SECTION
- name: see if ssh-agent is running
command: ssh-add -L
register: sshagent_output

- name: enable ssh-agent
shell: eval $(ssh-agent)

- name: add the private key
command: ssh-add ./aws-private.pem
ignore_errors: yes
when: create_key.changed

- name: add key to user
Expand Down

0 comments on commit 9d3c06f

Please sign in to comment.