Improved readme file
This commit is contained in:
29
README.md
29
README.md
@@ -1,18 +1,21 @@
|
||||
# Ansible Playbooks
|
||||
# Ansible for Homelab
|
||||
|
||||
This directory contains Ansible playbooks for automating server configuration and management tasks.
|
||||
This Ansible setup is designed to automate the configuration and maintenance of servers and applications in the homelab. It includes playbooks for common tasks, inventory management for different environments, and a structured way to handle variables and secrets.
|
||||
|
||||
## Playbooks
|
||||
## Directory Structure
|
||||
|
||||
- **apt_upgrade.yml**: This playbook updates all packages on a Debian/Ubuntu server.
|
||||
- **zabbix_agent_upgrade.yml**: This playbook upgrades the Zabbix agent on a server.
|
||||
- `inventory/`: Contains the inventory files that define the hosts and groups of hosts managed by Ansible. The `hosts.ini` file should be updated with your server details, and `example_hosts.ini` serves as a template.
|
||||
- `group_vars/`: This directory can be used to store variables that apply to specific groups of hosts defined in the inventory.
|
||||
- `*.yml` files: These are the Ansible playbooks that define the automation tasks.
|
||||
- `secrets.yml`: This file is intended to store sensitive data like passwords and API keys. It is recommended to encrypt this file using Ansible Vault. An `example_secrets.yml` is provided as a template.
|
||||
- `vars.yml`: This file can be used to store non-sensitive variables that are used across multiple playbooks.
|
||||
|
||||
## Usage
|
||||
## Getting Started
|
||||
|
||||
To use these playbooks, you will need to have Ansible installed on your control machine. You will also need to have an inventory file that defines the hosts you want to manage.
|
||||
|
||||
Once you have Ansible and an inventory file set up, you can run a playbook using the following command:
|
||||
|
||||
```
|
||||
ansible-playbook -i <inventory_file> <playbook>.yml
|
||||
```
|
||||
1. **Install Ansible:** Make sure you have Ansible installed on your control machine.
|
||||
2. **Inventory:** Update the `inventory/hosts.ini` file with the IP addresses and connection details for your servers.
|
||||
3. **Secrets:** Create a `secrets.yml` file based on the `example_secrets.yml` template and encrypt it using Ansible Vault for security.
|
||||
4. **Run a Playbook:** You can run a playbook using the `ansible-playbook` command. For example:
|
||||
```bash
|
||||
ansible-playbook -i inventory/hosts.ini apt_upgrade.yml
|
||||
```
|
||||
Reference in New Issue
Block a user