gianlucaborello / aws-ssh-config

Generate SSH config files from AWS EC2 inventory
GNU General Public License v2.0
242 stars 83 forks source link

create a version that supports boto3/python3, updated requirements file #26

Open Trozz opened 5 years ago

Trozz commented 5 years ago

added a version of the file support Python 3 and boto3, functionality is the same still

if you want I will rewrite the base file as well as submit a setup.py file to support running and installing the script as an application

gianlucaborello commented 5 years ago

Thanks for this. I am a little bit hesitant to merge it as is because of the significant amount of code duplication, it might create a maintainability nightmare moving forward, requiring to cherry pick each change into both files.

Can you by any chance think of a way to implement the support to Python 2 + 3 that is more idiomatic, perhaps in the same script?

This might not be possible (admittedly I've never used boto3, so I'm not aware of how much changed), so I'm just asking for my information.

Thanks again

Trozz commented 5 years ago

well boto3 is supported under python2 so I could write in python2 that is compatible with python3.

Trozz commented 5 years ago

@gianlucaborello this is now pep8 compliant and works in both python2 / python3 using boto3

Trozz commented 5 years ago

@gianlucaborello any chance of merging?

gianlucaborello commented 5 years ago

Sorry, I've been super busy and had no time to review this. I will be able to take a look and test it after things calm down a little from my end. Thanks.

rromanchuk commented 4 years ago

Sent a PR https://github.com/Trozz/aws-ssh-config/pull/2

Not a python guy, also unfamiliar with boto3 lib, so there's probably a better way without this branching but i'm just limiting my exposure so i dont end up in the weeds. I'm now using this in my ansible playbooks.

Here's my usage in production. It's working well with the updated version, and i removed my python2 dependency.

- name: Update ssh config
  shell: ./aws-ssh-config.py --private --tags Name --default-user ubuntu > .ssh/config
  become_user: ubuntu
  args:
    chdir: /home/ubuntu
Trozz commented 4 years ago

Sent a PR Trozz#2

Not a python guy, also unfamiliar with boto3 lib, so there's probably a better way without this branching but i'm just limiting my exposure so i dont end up in the weeds. I'm now using this in my ansible playbooks.

Here's my usage in production. It's working well with the updated version, and i removed my python2 dependency.

- name: Update ssh config
  shell: ./aws-ssh-config.py --private --tags Name --default-user ubuntu > .ssh/config
  become_user: ubuntu
  args:
    chdir: /home/ubuntu

looks good, I wonder if you would be able to generate the same thing using the Ansible dynamic inventories :-)

Trozz commented 4 years ago

@gianlucaborello any luck getting this in

Trozz commented 4 years ago

@gianlucaborello appreciate that you've probably had other things going on, if you would like I am happy to become a collaborator on this with you to keep development up

Trozz commented 3 years ago

Hi @gianlucaborello,

Hope all is well, any chance we can look to get these merged? I would be happy to take over this repo if you no-longer have the time

Trozz

borisvezmar commented 2 years ago

Just a little nudge to show interest in this merge. This tool is useful and it would be very nice to have it working again

noahdahlman commented 2 years ago

Wanted to bump this as well, would be great to have an update