Skip to content

This project contains a simple ansible utility for different OS for installing and configuring baseline utilities for bastion node.

License

Notifications You must be signed in to change notification settings

Code-Triarii/ansible-bastion-utils-installer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📝 Ansible Bastion Utils Installer

Ansible Badge Docker

This project allows to install some of the most common dependencies in the host machine for server OS. Starting with Ubuntu 22.04 LTS

📚 Table of contents

Structure

The repository configuration is simple, it contains the main ansible files:

  • ansible.cfg
  • playbooks: contains the different Ansible resources for installation.
    • dependencies: this playbooks are configured to be executed for a set of targets.

🔝 Back to top

🚀 Installation and Execution

🔨 Prerequisites

# Ubuntu installation
sudo apt-get update && sudo apt-get install -y python3 python3-pip

pip install ansible

# If local installation, include python bins in path
echo 'export PATH=/home/<user>/.local/bin:$PATH' > ${HOME}/.bashrc

🔝 Back to top

🔧 Execution

Local environment

There are several ways to execute it locally, depending on the use case.

  1. For localhost with password for sudo (-K is short version of --ask-become-pass)
# For localhost
ansible-playbook playbooks/main.yml -i "localhost" -u $(id -un) -K
  1. In remote machine with private key (assuming ubuntu as the remote user. You can change for your matching).
ansible-playbook playbooks/main.yml -i "<remote-host>" -u ubuntu --private-key priv.key

Note

Do not forget to fetch the priv.key and apply chmod 400 priv.key or it will raise an error.

Tip

You can add the environment variable ANSIBLE_HOST_KEY_CHECKING=False before the command execution if you face some issues. However, this is not a good security practice and should be avoided for production usage.

Ansible execution

Docker environment

  1. Build docker image:
docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) --build-arg GROUP=$(id -gn) --build-arg USER=$(id -un) \
-t ansible:1.0 .
  1. Run docker image:
docker run -it --rm -v $(pwd):/app -w /app ansible:1.0 ansible-playbook playbooks/main.yml -i "<remote-host>" -u ubuntu --private-key priv.key

🔝 Back to top

📍 Roadmap

  • Add Documentation
  • Support automatic installations for Ubuntu family (20.04, 22.04 and 23.10)
  • Contenerized execution prepared.

🔝 Back to top

📎 Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated 💹.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

  1. Fork the Project
  2. Create your Feature Branch
    git checkout -b feature/AmazingFeature
  3. Commit your Changes
    git commit -m 'Add some AmazingFeature
  4. Push to the Branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request

🔝 Back to top

📃 License

Distributed under the Apache 2.0 License. See LICENSE for more information.

🔝 Back to top

👥 Contact

X TikTok Medium YouTube Instagram

As we always state, our main purpose is keep learning, contributing to the community and finding ways to collaborate in interesting initiatives. Do not hesitate to contact us at [email protected]

If you are interested in our content creation, also check our social media accounts. We have all sorts of training resources, blogs, hackathons, write-ups and more! Do not skip it, you will like it 😏 😏 😏 👍

Don't forget to give the project a star if you liked it! Thanks again! 🌟 💛

🔝 Back to top

About

This project contains a simple ansible utility for different OS for installing and configuring baseline utilities for bastion node.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published