Skip to content

ApiWeb for configure Switchs devices using Ansible

License

Notifications You must be signed in to change notification settings

AleDouglas/SwitchSetup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hi, guys! 👋

What is SwitchSetup?

This software is designed to configure network devices using Ansible
For now it works in a very simple way, but I plan to improve security and new features.
For more information, diagrams and project architecture, see our documentation.

Be free to collaborate!

Table of Contents

Setup

Git Clone

To set up the project locally, please follow these steps:

  1. Clone the repository: git clone https://github.com/AleDouglas/SwitchSetup.git .
  2. Install the packages from the requirements.txt file in your Virtual Environment or use the Dockerfile .
  3. You need generate your own Secret Key .
  4. Configure your .env .
  5. You can run it in your terminal or dockerfile .

SecretKey

Start the Python interpreter

import secrets
secrets.token_hex(32)
Copy the key in .env

Configure .env

Create an .env file in the /core directory:

SECRET_KEY=SECRET KEY
DEBUG=True

Use DEBUG=TRUE only when in development.

Be mindful that you can generate a new key whenever necessary. However, it is crucial to remember that if you are using our project, you should not disclose the key to anyone.

Terminal Local:

cd Alpha
python manage.py migrate
python manage.py runserver

Dockerfile:

cd Alpha
python manage.py migrate
cd ..
docker build -t image_name .
docker run -p 8000:8000 imagename

Login SwitchSetup

Use for login:

Username: admin
Password: 123

Database

We use SQLite at first, but it is possible to manage other databases.

Use Django's own reference.

If you lose the database file or decide to switch to a different one, you will need to follow these steps:

  1. Migration ( Inside the Alpha file )
python manage.py migrate

After this, you just need to either use Docker or run it on your local machine.

Use for login:

Username: admin
Password: 123

I recommend using MySQL or PostgreSQL to avoid the use of a physical database within the documents. Simply follow the Django reference for the necessary modifications.

FAQ

Problems for login authentication in Ansible-Docker

We have identified an issue regarding Ansible authentication. This might be caused by the required keys. Simply copy the keys from the ~/.ssh/ file to the 'sshkeys' folder within the project. We will work on resolving this problem in the upcoming updates.

Issue when trying to run the server, indicating something related to allauth

We've identified some issues on certain machines. You just need to add the:

'allauth.account.middleware.AccountMiddleware', 

to the MIDDLEWARE list in the settings.py file.

Version

Version Date
Alpha V.1.1 Added key system and resolve responsive bugs, this version for attribution via API is not yet ready 11/01/2024
Alpha V.1.0 Added an Alpha version with a new, more attractive and functional look, this version for attribution via API is not yet ready 27/12/2023
1.6.1 Fixing and Update system for customized playbooks and hosts 13/09/2023
1.6 Added a system for customized playbooks and hosts ( TEST ) 13/09/2023
1.5.3 Resolved Datetime Import and finish tests 18/08/2023
1.5.2 Resolved logging issue in certain system tasks 18/08/2023
1.5.1 Added ansible execution information control system 18/08/2023
1.5 Possible solution for connecting via docker-ansible and adding level of information when running ansible 17/08/2023
1.4 Fixed ansible conection 17/07/2023
1.3 SSH Save Credentials 16/07/2023
1.2 User Options 14/07/2023
1.1 Fixed login form 14/07/2023
1.0 Up version 1.0 14/07/2023

Videos

First impression ( 14/07/2023 )