feat: Implement Ansible Vault for secrets management and improve documentation
This commit is contained in:
parent
0f1fb6f2bf
commit
48d44de2c9
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,4 +3,4 @@
|
||||
private
|
||||
.vscode
|
||||
.ansible
|
||||
.git
|
||||
.git.vault_password
|
||||
|
||||
1
.vault_password
Normal file
1
.vault_password
Normal file
@ -0,0 +1 @@
|
||||
changeme
|
||||
44
README.md
44
README.md
@ -1,3 +1,45 @@
|
||||
# HomeCloudPlaybooks
|
||||
|
||||
My Ansible Playbooks live here
|
||||
This repository contains Ansible playbooks for setting up and configuring a home cloud environment.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Ansible 2.9 or higher
|
||||
- Python 3.6 or higher
|
||||
- `sshpass` installed on the control node
|
||||
|
||||
## Usage
|
||||
|
||||
1. **Clone the repository:**
|
||||
```bash
|
||||
git clone https://gitea.tobjend.de/tobi/HomeCloudPlaybooks.git
|
||||
cd HomeCloudPlaybooks
|
||||
```
|
||||
|
||||
2. **Install Ansible collections:**
|
||||
```bash
|
||||
ansible-galaxy collection install -r playbooks/requirements.yml
|
||||
```
|
||||
|
||||
3. **Configure the inventory:**
|
||||
- Copy the `inventory/hosts.yml.example` to `inventory/hosts.yml`.
|
||||
- Update the `inventory/hosts.yml` file with your host information.
|
||||
|
||||
4. **Configure secrets:**
|
||||
- This project uses Ansible Vault to manage secrets.
|
||||
- Create a `vault_password.txt` file with your vault password.
|
||||
- Run the playbooks using the `--vault-password-file` option:
|
||||
```bash
|
||||
ansible-playbook playbooks/main.yml --vault-password-file vault_password.txt
|
||||
```
|
||||
|
||||
## Inventory Structure
|
||||
|
||||
The inventory is located in the `inventory` directory. The main inventory file is `hosts.yml`. The inventory is organized into groups of hosts.
|
||||
|
||||
## Roles
|
||||
|
||||
The following roles are available in the `playbooks/roles` directory:
|
||||
|
||||
- `gitea`: Installs and configures Gitea, a self-hosted Git service.
|
||||
- ... (more roles to be documented here)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
[defaults]
|
||||
inventory = ./inventory/hosts.yml
|
||||
remote_user = ubuntu
|
||||
private_key_file = ./private/astronomican.pem
|
||||
vault_password_file = ./.vault_password
|
||||
host_key_checking = False
|
||||
interpreter_python = auto_silent
|
||||
roles_path = ./roles
|
||||
roles_path = ./playbooks/roles
|
||||
7
inventory/group_vars/all.yml
Normal file
7
inventory/group_vars/all.yml
Normal file
@ -0,0 +1,7 @@
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
65626131663665313435333366626231396433653332376436636164303438343137633031363335
|
||||
3365373662376231636637326138313032353237353264340a643737653636316237363761386434
|
||||
36396636626638316166333332383437306532613532343333623864616234616637383566396636
|
||||
6439656639343938630a363437393735663939363566396166386137616232306336333631366335
|
||||
37653335346131346631376634303933626631643563366264383535323433653032306232636134
|
||||
6161376664353231636239363163616264656665363032386161
|
||||
10
playbooks/requirements.yml
Normal file
10
playbooks/requirements.yml
Normal file
@ -0,0 +1,10 @@
|
||||
# requirements.yml
|
||||
|
||||
# This file lists the Ansible collections required by the playbooks.
|
||||
# The collections are based on the commented-out roles in main.yml.
|
||||
|
||||
collections:
|
||||
- name: community.general
|
||||
version: "3.0.0"
|
||||
- name: community.crypto
|
||||
version: "2.0.0"
|
||||
Loading…
x
Reference in New Issue
Block a user