Giter Site home page Giter Site logo

ansible-proxmox-automation's Introduction

Dilden's Ansible + Proxmox Homelab Automation

What is this?

This repo contains the Ansible playbooks and configuration used to manage and automate my Proxmox based homelab. It makes use of the proxmox and proxmox_kvm modules.

Requirements

Installation

Clone this repo Ensure you also have Ansible (and all other requirements) installed

The main points

  • Configuration is set in ansible.cfg. This exists only to tell Ansible where to look for server definitions (inventory).
  • Servers (inventory) are defined in the hosts file and are placed in "groups" defined by []
  • The group_vars folder contains variables and credentials for use with the servers in those groups.
  • creds.yml will need to be created via ansible-vault create in the appropriate folder and will need to be configured like so:
vault_api_password: 'PROXMOX_HOST_PASSWORD'
vault_100: 'CONTAINER_PASSWORD'
vault_101: 'CONTAINER_PASSWORD'

Just as the host API key needs to be set in group_vars/host/creds.yml, the containers will need to have passwords configured within group_vars/containers/creds.yml matching the appropriate variables set in group_vars/containers/vars.yml.

After setting up everything, run ansible-playbook books\prep-host.yml to ensure proxmoxer and other various dependencies are installed on the host.

Usage

  • Note: Only commands run on the host will need to be run with --ask-vault-pass appended to them to work with this config. Commands run inside containers will be able to connect via SSH if using the create-containers.yml playbook since it automatically adds the SSH key to each of those systems.

To create new containers, add a new entry to group_vars/host/vars.yml and run ansible-playbook books/create-containers.yml --ask-vault-pass.

Update host: ansible-playbook books/update-host-all.yml --ask-vault-pass

Update containers: ansible-playbook books/update-containers.yml --ask-vault-pass

Some useful ad-hoc commands might look like: ansible closingtags -a "find /var/www/html/. -type f -mtime -15" to find any files modified in the past 15 days

or ansible closingtags -a "grep -nr 'atob' /var/www/html/." to search all files for 'atob'.

Sponsorship

If you've found this project useful in any way, consider sponsoring this project.

ansible-proxmox-automation's People

Contributors

dilden avatar

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.