All Projects → Valian → ansible-multienv-base

Valian / ansible-multienv-base

Licence: other
Template for ansible project allowing to manage multiple environments (e.g. staging, production) and harden new hosts

Projects that are alternatives of or similar to ansible-multienv-base

avbot-charts
Aviation charts
Stars: ✭ 20 (-48.72%)
Mutual labels:  playbook
ansible
Ansible playbooks to deploy a fullblown geOrchestra instance
Stars: ✭ 14 (-64.1%)
Mutual labels:  playbook
multi-master-kubernetes
Multi-master Kubernetes cluster on Exoscale
Stars: ✭ 65 (+66.67%)
Mutual labels:  playbook
usegalaxy-playbook
Ansible Playbook for usegalaxy.org
Stars: ✭ 30 (-23.08%)
Mutual labels:  playbook
dotfiles
🔨 My dotfiles for setting up my Macs with Ansible
Stars: ✭ 31 (-20.51%)
Mutual labels:  playbook
ansible-taskrunner
Ansible Taskrunner - ansible-playbook wrapper with YAML-abstracted python click cli options!
Stars: ✭ 14 (-64.1%)
Mutual labels:  playbook
ansible-role-etcd
Ansible role for installing etcd cluster
Stars: ✭ 38 (-2.56%)
Mutual labels:  playbook
passbolt ansible
A complete (set of) playbook(s) to selfhost passbolt.
Stars: ✭ 15 (-61.54%)
Mutual labels:  playbook
initial-webserver-setup
Ansible playbook for initial ubuntu 16.04 webserver setup and Laravel zero time deployment
Stars: ✭ 50 (+28.21%)
Mutual labels:  playbook
RHEL7-CIS
Ansible RHEL 7 - CIS Benchmark Hardening Script
Stars: ✭ 28 (-28.21%)
Mutual labels:  harden
easy-ansible
基于Ansible的自动部署平台-Automatical Deployment Platform Based on Ansible。
Stars: ✭ 41 (+5.13%)
Mutual labels:  playbook
ansible-aws-infra-services
Manage your AWS infrastructure and ECS tasks with two separate ansible playbooks
Stars: ✭ 23 (-41.03%)
Mutual labels:  playbook
openvpn
Build your own private VPN server. OpenVPN, Scramblesuit and DNS up in less then 5 minutes
Stars: ✭ 78 (+100%)
Mutual labels:  playbook
raspberry-metrics
Expose Raspberry PI metrics using Prometheus and Grafana. Install with single command.
Stars: ✭ 41 (+5.13%)
Mutual labels:  playbook
ansible-avd
Ansible Arista Validated Design
Stars: ✭ 134 (+243.59%)
Mutual labels:  playbook
ansible-docgen
Generate documentation from annotated Ansible Playbooks and Roles
Stars: ✭ 61 (+56.41%)
Mutual labels:  playbook
action-ansible-playbook
⚙️ A GitHub Action for running Ansible playbooks
Stars: ✭ 133 (+241.03%)
Mutual labels:  playbook
wormhole
A minimalistic Ansible-like tool for configuring remote servers via ssh
Stars: ✭ 22 (-43.59%)
Mutual labels:  playbook
ansible-role-dsvpn
Install and configure dsvpn on your system.
Stars: ✭ 18 (-53.85%)
Mutual labels:  playbook
ansible-role-dns
Install and configure dns on your system.
Stars: ✭ 39 (+0%)
Mutual labels:  playbook

ansible-multienv-base

Template for ansible project that allows to easily manage multiple environments (e.g. staging, test, production) and harden new hosts

Description

This is my base template for ansible projects requiring multiple environment deployment. General idea is to use multiple inventories, and be able to easily add new hosts / groups / environments, each with own variables.

Structure

|- hosts
|  |- shared-secrets.yml  # encrypted vars, used in all environments
|  |- shared-vars.yml     # not encrypted vars, used in all environments
|  |- environment1        # directory for environment (e.g. test or staging)
|  |  |- inventory        # inventory file with definitions of all required hosts
|  |  |- secrets.yml      # encrpted vars for this environment
|  |  |- groups_vars
|  |     |- all.yml       # normal group_vars, like in typical ansible project
|  |- environment2        # directory for other environment
|     |- inventory
|     |- secrets.yml
|     |- groups_vars
|        |- all.yml
|- roles                  # all ansible roles used in playbooks
|  |- role1
|     |- ...
|- playbook1.yml          # here we put our playbooks

Usage

git clone https://github.com/Valian/ansible-multienv-base

Next, we must create our playbooks, fill inventories and variables, create roles etc. To encrypt secret variables file, use

ansible-vault encrypt path-to-file     # Caution! Pass must be the same in every encrypted file

There is also a special task, that we should include in pre_tasks in each playbook, called tasks/load_vars.yml. To run playbook against specified environemnt, we must use

ansible-playbook -i hosts/desired_env/inventory --ask-vault-pass playbook.yml

Hope this will be helpful to somebody.

You can find me on Twitter @jskalc

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].