Giter Club home page Giter Club logo

ansible-2221's People

Contributors

aisgbnok avatar

Watchers

 avatar

ansible-2221's Issues

Improve SSH Deploy Flexibility and Robustness

Description

subprocess.run(
' '.join(['sudo', 'scp', '~/.ssh/id_rsa.pub', f'{user}@{ip}:/ProgramData/ssh/administrators_authorized_keys']),
shell=True)
print(f"Setting permissions for '{user}@{ip}'...")
subprocess.run(' '.join(['sudo', 'ssh', f'{user}@{ip}',
'\'icacls.exe "C:\ProgramData\ssh\\administrators_authorized_keys" /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"\'']),
shell=True)
subprocess.run(' '.join(['sudo', 'ssh', f'{user}@{ip}',
'\'icacls "C:\ProgramData\ssh\\administrators_authorized_keys" /remove "NT AUTHORITY\Authenticated Users"\'']),
shell=True)
subprocess.run(' '.join(['sudo', 'ssh', f'{user}@{ip}',
'\'icacls "C:\ProgramData\ssh\\administrators_authorized_keys" /inheritance:r\'']),
shell=True)

This is very rudimentary and requires user interaction which is annoying. Would be nice if this could automatically run and handle all required user input (e.g., known hosts yes/no, SSH password, etc.). Maybe also move to subprocess.popen?

def main():
print("Welcome to ")

This doesn't do anything?

Fix

  • Move everything from the interpreter module check to main.
  • Improve the Auto handling. Add ability to read from file.
  • Improve robustness. Handle errors, automatically handle requests (yes/no), handle passwords, etc.

Originally posted by @aisgbnok in #6 (comment) and #6 (comment).

Make `ansible-inventory.py` more flexible at handling multiple inventories.

Description

The ansible-inventory.py script overwrites the local Ansible inventory with the red-inventory.yaml, which is defined statically. This needs to be more intelligent and flexible.

src_path = path.abspath(path.join(base_path, "..", "configs", "red-inventory.yaml"))

Fix

  • Generate a list of all inventories in configs/ and allow user to choose one.
  • Provide option for user to manually provide an inventory path.

Originally posted by @aisgbnok in #6 (comment)

Windows Passwordless SSH Guide not working

Following the SSH Guide for Windows seems to no longer yield passwordless SSH. The authorized keys are moved over correctly, but key permissions seem to not stick. Microsoft provides an icacls command that was working before, but that seems to no longer be the case.

I was able to get passwordless SSH using another icacls command and changing permissions on the administrators_authorized_keys remotely but don't remember the exact steps. I need to take some time to look into this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.